1 |
a59f38d6
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2022 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Magic Cube. //
|
5 |
|
|
// //
|
6 |
296219b4
|
Leszek Koltunski
|
// 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 |
a59f38d6
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
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 |
cda03d84
|
Leszek Koltunski
|
android.util.Log.e("D", "In App Messaging: url="+url);
|
28 |
a59f38d6
|
Leszek Koltunski
|
|
29 |
|
|
// Get general information about the campaign
|
30 |
|
|
CampaignMetadata metadata = inAppMessage.getCampaignMetadata();
|
31 |
|
|
|
32 |
cda03d84
|
Leszek Koltunski
|
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 |
a59f38d6
|
Leszek Koltunski
|
}
|
40 |
|
|
}
|