1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2022 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9
|
|
10
|
package org.distorted.messaging;
|
11
|
|
12
|
import com.google.firebase.inappmessaging.FirebaseInAppMessagingClickListener;
|
13
|
import com.google.firebase.inappmessaging.model.Action;
|
14
|
import com.google.firebase.inappmessaging.model.CampaignMetadata;
|
15
|
import com.google.firebase.inappmessaging.model.InAppMessage;
|
16
|
|
17
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
18
|
|
19
|
public class RubikInAppMessanging implements FirebaseInAppMessagingClickListener
|
20
|
{
|
21
|
@Override
|
22
|
public void messageClicked(InAppMessage inAppMessage, Action action)
|
23
|
{
|
24
|
// Determine which URL the user clicked
|
25
|
String url = action.getActionUrl();
|
26
|
|
27
|
android.util.Log.e("D", "In App Messaging: url="+url);
|
28
|
|
29
|
// Get general information about the campaign
|
30
|
CampaignMetadata metadata = inAppMessage.getCampaignMetadata();
|
31
|
|
32
|
if( metadata!=null )
|
33
|
{
|
34
|
String id = metadata.getCampaignId();
|
35
|
String name = metadata.getCampaignName();
|
36
|
boolean test = metadata.getIsTestMessage();
|
37
|
android.util.Log.e("D", "In App Messaging: id="+id+" name="+name+" test="+test);
|
38
|
}
|
39
|
}
|
40
|
}
|