Integrate Growth Action [Android]
Follow
Getting started
DFINERY Growth Action provides functions to help customers engage with their engagement marketing activities.
[Learn about Growth Action services]
Using the functions provided by DFINERY, you can create audience groups and conduct personalized marketing targeting each audience.
[[Quote: Guide: Normal]] To use Growth Action, you must use the DFINERY paid plan.[ Contact Us ]
Notification subscription and opt-out settings
In order to integrate the Definary Growth Action feature, you need to set up a subscription for notifications. The SDK allows you to set up subscriptions and rejections for channels other than push, and also provides a function to retrieve the currently set values.
Subscribe to and opt out of notifications
After setting up subscription information using SubscriptionStatus.Builder, send the set information to the server using the setSubscriptionStatus method.
[[Quote:Danger:Moderate]]
Caution
The consent to receive informational notifications is a higher-level item that includes the consent to receive advertising notifications. Therefore, if the consent to receive informational notifications is UNSUBSCRIBED, advertising push notifications will not be sent even if the consent to receive advertising notifications and the consent to receive nighttime advertising notifications are SUBSCRIBED.
[[Quote:Danger:Moderate]]
Caution
Since there are cases where notifications are sent when there is no setting history depending on the sending logic, if you do not wish to receive notifications for items, be sure to set them to UNSUBSCRIBED when calling.
[[Quote:Risk:Moderate]]
Caution
If you use the API without calling the login(String user_Id) API, only informational notifications will be available and the audience will be classified as device-based. To use the user-based audience and advertising notifications, the login(String user_Id) call must be made first.
-
Create subscription information
-
SubscriptionStatus.Builder
- setInformativeNotificationFlag(): Setting consent to receive informational notifications
- setMarketingNotificationFlag(): Set your consent to receive advertising notifications
- setMarketingNotificationFlagForPushChannel(): Set up consent to receive advertising notifications (push channel)
- setMarketingNotificationFlagForSmsChannel(): Setting consent to receive advertising notifications (SMS channel)
- setMarketingNotificationFlagForKakaoChannel(): Set up consent to receive advertising notifications (notification talk channel)
- setMarketingNotificationAtNightFlag(): Set your consent to receive nighttime advertising notifications
- setMarketingNotificationAtNightFlagForPushChannel(): Set the consent to receive nighttime advertising notifications (push channel)
- setMarketingNotificationAtNightFlagForSmsChannel(): Set your consent to receive nighttime advertising notifications (SMS channel)
- setMarketingNotificationAtNightFlagForKakaoChannel(): Set the consent to receive nighttime advertising notifications (notification talk channel)
-
SubscriptionStatus.Type
- SUBSCRIBED : agree
- UNSUBSCRIBED: do not agree
-
SetSubscriptionStatusResult
- isSuccess(): Whether it was applied normally on the server or not
- getResultCode(): Get result code
- getResultMessage(): Get result message
-
SubscriptionStatus.Builder
SubscriptionStatus subscriptionStatus = new SubscriptionStatus.Builder() .setInformativeNotificationFlag(SubscriptionStatus.Type.SUBSCRIBED) .setMarketingNotificationFlag(SubscriptionStatus.Type.SUBSCRIBED) .setMarketingNotificationFlagForPushChannel(SubscriptionStatus.Type.UNSUBSCRIBED) .setMarketingNotificationFlagForSmsChannel(SubscriptionStatus.Type.SUBSCRIBED) .setMarketingNotificationFlagForKakaoChannel(SubscriptionStatus.Type.SUBSCRIBED) .setMarketingNotificationAtNightFlag(SubscriptionStatus.Type.UNSUBSCRIBED) .setMarketingNotificationAtNightFlagForPushChannel(SubscriptionStatus.Type.UNSUBSCRIBED) .setMarketingNotificationAtNightFlagForSmsChannel(SubscriptionStatus.Type.UNSUBSCRIBED) .setMarketingNotificationAtNightFlagForKakaoChannel(SubscriptionStatus.Type.SUBSCRIBED) .build();
val subscriptionStatus = SubscriptionStatus.Builder() .setInformativeNotificationFlag(SubscriptionStatus.Type.SUBSCRIBED) .setMarketingNotificationFlag(SubscriptionStatus.Type.SUBSCRIBED) .setMarketingNotificationFlagForPushChannel(SubscriptionStatus.Type.UNSUBSCRIBED) .setMarketingNotificationFlagForSmsChannel(SubscriptionStatus.Type.SUBSCRIBED) .setMarketingNotificationFlagForKakaoChannel(SubscriptionStatus.Type.SUBSCRIBED) .setMarketingNotificationAtNightFlag(SubscriptionStatus.Type.UNSUBSCRIBED) .setMarketingNotificationAtNightFlagForPushChannel(SubscriptionStatus.Type.UNSUBSCRIBED) .setMarketingNotificationAtNightFlagForSmsChannel(SubscriptionStatus.Type.UNSUBSCRIBED) .setMarketingNotificationAtNightFlagForKakaoChannel(SubscriptionStatus.Type.SUBSCRIBED) .build()
-
Reflect subscription information
-
SubscriptionStatus.Type
- SUBSCRIBED : agree
- UNSUBSCRIBED: do not agree
- UNDEFINED: No setting history
-
GetSubscriptionStatusResult
- isSuccess(): Whether it was applied normally on the server
- getResultCode(): Get result code
- getResultMessage(): Get result message
- getInformativeNotificationFlag(): Get the value of consent to receive informative notifications
- getMarketingNotificationFlag(): Get the value of consent to receive advertising notifications
- getMarketingNotificationFlagForPushChannel(): Get the value of consent to receive advertising notifications (push channel)
- getMarketingNotificationFlagForSmsChannel(): Get advertising notification consent value (SMS channel)
- getMarketingNotificationFlagForKakaoChannel(): Get the value of consent to receive advertising notifications (Notification Talk channel)
- getMarketingNotificationAtNightFlag(): Get the value of consent to receive nighttime advertising notifications.
- getMarketingNotificationAtNightFlagForPushChannel(): Get the value of consent to receive nighttime advertising (push channel) notifications.
- getMarketingNotificationAtNightFlagForSmsChannel(): Get the value of consent to receive nighttime advertising notifications (SMS channel)
- getMarketingNotificationAtNightFlagForKakaoChannel(): Get the value of consent to receive nighttime advertising notifications (Notification Talk channel)
-
SubscriptionStatus.Type
AdBrixRm.setSubscriptionStatus(subscriptionStatus, new AdBrixRm.SetSubscriptionStatusCallback() { @Override public void onCallback(SetSubscriptionStatusResult result) { if(result.isSuccess()){ ... } } });
AdBrixRm.setSubscriptionStatus(subscriptionStatus, AdBrixRm.SetSubscriptionStatusCallback { if(it.isSuccess){ ... } })
[[Quote:Warning:Normal]]
Push on/off check
For the notification push channel, it is separate from the device's Push on/off setting, so please refer to
the Push on/off section
below and set Push to On if you want to use Push.
Get notification settings values
Get the information set on the server with the getSubscriptionStatus method.
AdBrixRm.getSubscriptionStatus(new AdBrixRm.GetSubscriptionStatusCallback() { @Override public void onCallback(GetSubscriptionStatusResult result) { if(result.isSuccess()){ SubscriptionStatus.Type infoFlag = result.getInformativeNotificationFlag(); SubscriptionStatus.Type mktFlag = result.getMarketingNotificationFlag(); SubscriptionStatus.Type mktPushFlag = result.getMarketingNotificationFlagForPushChannel(); SubscriptionStatus.Type mktSmsFlag = result.getMarketingNotificationFlagForSmsChannel(); SubscriptionStatus.Type mktKakaoFlag = result.getMarketingNotificationFlagForKakaoChannel(); SubscriptionStatus.Type nightFlag = result.getMarketingNotificationAtNightFlag(); SubscriptionStatus.Type nightPushFlag = result.getMarketingNotificationAtNightFlagForPushChannel(); SubscriptionStatus.Type nightSmsFlag = result.getMarketingNotificationAtNightFlagForSmsChannel(); SubscriptionStatus.Type nightKakaoFlag = result.getMarketingNotificationAtNightFlagForKakaoChannel(); } } });
AdBrixRm.getSubscriptionStatus { if(it.isSuccess){ val infoFlag = it.informativeNotificationFlag; val mktFlag = it.marketingNotificationFlag val mktPushFlag = it.marketingNotificationFlagForPushChannel val mktSmsFlag = it.marketingNotificationAtNightFlagForSmsChannel val mktKakaoFlag = it.marketingNotificationFlagForKakaoChannel val nightFlag = it.marketingNotificationAtNightFlag val nightPushFlag = it.marketingNotificationAtNightFlagForPushChannel val nightSmsFlag = it.marketingNotificationAtNightFlagForSmsChannel val nightKakaoFlag = it.marketingNotificationAtNightFlagForKakaoChannel } }
Push service preferences
Required
In order to integrate the push function,
the DFINERY (Adbrix)
basic SDK and Firebase Cloud Messaging SDK (hereinafter referred to as FCM) are required.
You must complete the basic adbrix integration steps to be able to integrate with Growth Action.
- DFINERY (Adbrix) basic SDK - Integrating DFINERY [Android]
- FCM SDK - Setting up a Firebase Cloud Messaging client app on Android
[[Quote:Danger:Moderate]]
Caution
The sending method using Firebase Server Key and Sender ID will be discontinued after June 13, 2024 due to the discontinuation of support for Firebase's existing HTTP API. Please link according to the Firebase certificate issuance and registration guide introduced below.
View previous linking methods
Register Firebase Server Key and Sender ID
To use the Definery Growth Action, you must register the Firebase Server Key / Sender ID in
the Definery Console
.
You can check your Firebase Server Key / Server ID in Firebase Console -> Settings -> Cloud Messaging.
a. Check the Firebase Server Key and Sender ID in the Firebase console.
b. Enter the key value you checked in the Growth Action - Settings menu of the adbrix console.
Issue a Firebase certificate
1. Log in to the service account .
2. Select the project for which you want to issue a key.
If there is no project, it means that the Firebase project has not been created. Refer to Add Firebase to your Android project to create a Firebase project.
3. Click ⋮ in the Actions section at the bottom right.
4. Click Key Management from the dropdown.
5. Select Add Key.
If there is a key that has already been generated, it means that there is a history of generating a key in the past and you can use that key. If you cannot find the key, please generate a new key.
6. Click Create New Key from the dropdown.
7. After selecting JSON, click Create.
8. Key issuance has been completed.
Register in the Firebase Certificates Console
[[Quote:Warning:Normal]] Console Settings Open Date
The ability to register Firebase certificates in the console will be available on June 13th.
1.Connect to the console .
2. In the left panel, click Settings under GrowthAction.
3. In the Android Push Setting tab, click Register in Firebase Cloud Messaging Certificate.
4. Click the Upload button to upload your key.
5. After uploading is complete, click the Confirm button.
6. Click Save to apply the certificate.
7. The certificate has been registered in the console.
Push reception settings
Register the receiver below in AndroidManifest.xml.
Set up push reception using AdBrixRm.onMessageReceived within onMessageReceived of the FirebaseMessagingService you created.
public class MyFirebaseMessagingService extends FirebaseMessagingService { @Override public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); AdBrixRm.onMessageReceived(getApplicationContext(), remoteMessage); } }
class MyFirebaseMessagingService :FirebaseMessagingService() { override fun onMessageReceived(message: RemoteMessage) { super.onMessageReceived(message) AdBrixRm.onMessageReceived(applicationContext, message) } }
Token value setting
To set the Firebase Token value in adbrix, add the Token value using AdBrixRm.setRegistrationId in onNewToken() of FirebaseMessagingService.
And add the following code to the application you are using so that the Token value can be updated as follows.
public class MyApplicationClass extends Application { @Override public void onCreate() { super.onCreate(); refreshToken(); } private void refreshToken(){ FirebaseMessaging.getInstance().getToken() .addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { if (!task.isSuccessful()) { return; } String token = task.getResult(); AdBrixRm.setRegistrationId(token); } }); } }
class MyApplicationClass : Application() { override fun onCreate() { super.onCreate() refreshToken() } private fun refreshToken(){ FirebaseMessaging.getInstance().token.addOnCompleteListener(OnCompleteListener { task -> if (!task.isSuccessful) { return@OnCompleteListener } val token = task.result AdBrixRm.setRegistrationId(token) }) } }
Push on/off
This is a mandatory API that must be linked to use the adbrix gross action service. You can manage the push service with this API.
AdBrixRm.setPushEnable(true); // Push On AdBrixRm.setPushEnable(false); // Push Off
AdBrixRm.setPushEnable(true) // Push On AdBrixRm.setPushEnable(false) // Push Off
[[Quote:Warning:Normal]]
Check default settings
The default setting for
Definery
is 'Push off'.
Therefore, after completing the gross action integration, you must get consent from users to receive push notifications and then call the Push On API.
Users who have previously agreed to receive push notifications must also call the Push On API to receive push notifications.
Push notification runtime permission request
In Android 13 and higher,
android.permission.POST_NOTIFICATIONS
runtime permission
is required to receive push notifications on the device. Please refer to the following guide to obtain runtime permission for the app.
[[Quote:Guide:Normal]]
Congratulations~!
The basic integration for
the Definary Growth
Action service has been completed.
From now on, you will be able to receive server pushes. Please continue linking to set local push and other push message options.
Additional push service settings
KakaoTalk settings
This is the setting for using Kakao Notification Talk and Friend Talk. *KAKAOID: 10-digit Kakao ID received through Kakao Sync API
AdBrixRm.setKakaoId("KAKAOID", new SetCiProfileCallback() { @Override public void onCallback(SetCiProfileResult result) { if(result.isSuccess()){ Log.d(TAG, "Success: " + result.getResultCode());
//If the format of kakaoId is incorrect, isSuccess will be false. } else { Log.d(TAG, "Failure: " + result.getResultMessage()); } } });
AdBrixRm.setKakaoId("KAKAOID", object : SetCiProfileCallback { override fun onCallback(result: SetCiProfileResult) { if(result.isSuccess) { println("Success: ${result.resultCode}")
//If the format of kakaoId is incorrect, isSuccess will be false. } else { println("Failure: ${result.resultMessage}") } } })
[[Quote:Danger:Small]] This API is available after logging in.
SMS settings
Settings for SMS use. *PHONE_NUMBER: Country code + number excluding "+" in compliance with E.164 (Example: 8210********)
AdBrixRm.setPhoneNumber("PHONE_NUMBER", new SetCiProfileCallback() { @Override public void onCallback(SetCiProfileResult result) { if(result.isSuccess()){ Log.d(TAG, "Success: " + result.getResultCode());
//If the format of phoneNumber is incorrect, isSuccess will be false. } else { Log.d(TAG, "Failure: " + result.getResultMessage()); } } });
AdBrixRm.sePhoneNumber("PHONE_NUMBER", object : SetCiProfileCallback { override fun onCallback(result: SetCiProfileResult) { if(result.isSuccess) { println("Success: ${result.resultCode}")
//If the format of phoneNumber is incorrect, isSuccess will be false. } else { println("Failure: ${result.resultMessage}") } } })
[[Quote:Warning:Small]] PHONE_NUMBER: Country code that complies with E.164 + the number minus “+” (Example: 8210********)
[[Quote:Danger:Small]] This API is available after logging in.
Push icon and color settings
Sets the color of the icon and app name displayed when receiving a push.
AdBrixRm.setPushIconStyle(this,"smallicon","largeicon",Color.argb(1,255,0,0)); //Using Color class ARGB AdBrixRm.setPushIconStyle(this,"smallicon","largeicon",AdBrixRm.PushColor.Yellow); // Using AdBrixRm class
AdBrixRm.setPushIconStyle(this,"smallicon","largeicon",Color.argb(1,255,0,0)) //Using Color class ARGB AdBrixRm.setPushIconStyle(this,"smallicon","largeicon",AdBrixRm.PushColor.Yellow) // Using AdBrixRm class
The push icon set this way is displayed as shown below.
[[Quote:Risk:Moderate]]
Caution
1) Enter only the image file name without the extension.
2) You need to add all images with that name to the Drawable folder for all resolutions.
3) If largeIcon is set in server push, the icon will be displayed with priority.
4) ARGB setting changes the color of the app name.
5) ARGB supports the ARGB format of the Color class.
6) ARGB supports the PushColor format defined in the AdbrixRm class.
Set up push notification channel
To create a notification on Android 8.0 or higher, you must use NotificationChannel. To use this API, AdBrixRm.setPushEnable(true); must be applied first.
Set the name and description of the notification channel . (Only one notification channel is created)
//channelName, channelDescription AdBrixRm.createDefaultNotificationChannel("myPushChannelName", "my Channel description");
//channelName, channelDescription AdBrixRm.createDefaultNotificationChannel("myPushChannelName", "my Channel description")
Set up push notifications
Set the visibility of push notifications. The push notification settings API below is only available on Android 8.0 and below.
AdBrixRm.setNotificationOption(this,NotificationCompat.PRIORITY_MIN,NotificationCompat.VISIBILITY_SECRET);
AdBrixRm.setNotificationOption(this,NotificationCompat.PRIORITY_MIN,NotificationCompat.VISIBILITY_SECRET)
Heads-up notification settings (PRIORITY)
- PRIORITY_MAX : Use heads-up notifications
- PRIORITY_HIGH : Use heads-up notifications
- PRIORITY_DEFAULT: Do not use heads-up notifications
- PRIORITY_LOW: Do not use heads-up notifications
- PRIORITY_MIN : Do not use heads-up notifications
Lock screen notification settings (VISIBILITY)
- VISIBILITY_SECRET: Disable lock screen notifications
- VISIBILITY_PRIVATE: Lock screen notifications are displayed, but content is not displayed.
- VISIBILITY_PUBLIC: Show entire content on lock screen
push notification listener
Set up a listener for client/server push.
public class MyApplication extends Application{ @Override public void onCreate() { super.onCreate(); //SDK init API must call first AbxActivityHelper.initializeSdk(MyApplicationClass.this, "your_adbrix_remastered_app_key", "your_adbrix_remastered_secret_key"); AdBrixRm.setOnRemotePushClickListener(new AdBrixRm.onRemotePushClickListener() { @Override public void onClick(OnRemotePushClickResult result) { ... } }); AdBrixRm.setOnLocalPushClickListener(new AdBrixRm.onLocalPushClickListener() { @Override public void onClick(OnLocalPushClickResult result) { ... } }); } }
class MyApplication: Application(){ override fun onCreate() { super.onCreate() //SDK init API must call first AbxActivityHelper.initializeSdk(applicationContext , "your_adbrix_remastered_app_key", "your_adbrix_remastered_secret_key"); AdBrixRm.setOnRemotePushClickListener { ... } AdBrixRm.setOnLocalPushClickListener { ... } } }
[[Quote:Danger:Moderate]]
Caution
Push listener must be added to the Application Class.
This listener fires when the push is clicked and passes the information below when clicked.
-
Local Push
-
OnLocalPushClickResult
- openViewByDeeplink(): Open the browser using the received Deeplink value
- getDeeplinkUri(): Get Uri of the received Deeplink value
- getDeeplink(): Get the received Deeplink value string
- getUrlDecodedDeeplinkUri(): Get the Uri of the received Deeplink value that has been URL decoded.
- getUrlDecodedDeeplink(): Get the URL decoded received Deeplink value string.
-
OnLocalPushClickResult
-
Server Push
-
OnRemotePushClickResult
- openViewByDeeplink(): Open the browser using the received Deeplink value
- getDeeplinkUri(): Get Uri of the received Deeplink value
- getDeeplink(): Get the received Deeplink value string
- getUrlDecodedDeeplinkUri(): Get the Uri of the received Deeplink value that has been URL decoded.
- getUrlDecodedDeeplink(): Get the URL decoded received Deeplink value string.
- getPushModel(): Get push data received from the server
-
OnRemotePushClickResult
[[Quote:Danger:Small]]
An operation is not implemented: Not yet implemented error is reported.
Regardless of the SDK, this error may occur when using the TODO annotation within a callback method.
If there is a TODO in the callback method, please remove it.
Local push settings
text push
Set up a local push with text.
AdBrixRm.notifyLocalPushNotification("PushTest", "This is ContentText", "adbrixrm://main");
AdBrixRm.notifyLocalPushNotification("PushTest", "This is ContentText", "adbrixrm://main")
Parameter values
- title : Title
- body : content
- deeplink: Deep link address to be passed to the listener when push is clicked
Image Push
Set up a push message consisting of text + image.
AdBrixRm.notifyLocalPushNotification("PushTest", "This is ContentText", "adbrixrm://main","http://myimage/image.png");
AdBrixRm.notifyLocalPushNotification("PushTest", "This is ContentText", "adbrixrm://main","http://myimage/image.png")
Parameter values
- title : Title
- body : content
- deeplink: Deep link address to be passed to the listener when push is clicked
- imageUrl : Image URL
[[Quote:Warning:Normal]] Images are recommended to be at least 1350x675 in size and have a 2:1 aspect ratio.
local push control
Used to manage and control the currently configured local pushes.
List localPushList = AdBrixRm.getRegisteredLocalPushNotification(); // Current Local push List AdBrixRm.cancelLocalPushNotificationAll(this); // Cancel the Local Push
>val localPushList = AdBrixRm.getRegisteredLocalPushNotification() // Current Local push List AdBrixRm.cancelLocalPushNotificationAll(this) // Cancel the Local Push
- getRegisteredLocalPushNotification: Get the list of currently scheduled local pushes. The list is represented as a PushEvent.
- cancelLocalPushNotificationAll : Cancels the delivery of all local pushes.
In-app messaging service settings
Basic setting
DFINERY in-app messages do not require separate integration.
In-app messages can be exposed by triggering events delivered through the DFINERY SDK, and all settings can be made in the DFINERY console.
[[Quote:Guide:Normal]] The in-app messaging feature is available in Android SDK version 2.1.0.0 and later.
Customizing Parent Views
By default, Definery In-App Messages automatically finds an area to display and displays the In-App Messages screen. However, depending on the app's environment, it may not be displayed.
At that time, you can directly set the parent view where the in-app message will be displayed and display it.
[[Quote:Guide:Normal]] If set to null or this API is not called, the definer will automatically find the area to display and display it.
Dfinery.getInstance().setCustomInAppMessageParentView(findViewById(R.id.container));
Dfinery.getInstance().setCustomInAppMessageParentView(findViewById(R.id.container))
Click event listener settings
The users in-app message click event is delivered through the configured listener.
You can use this listener to define additional actions for click events.
public class MainApplication extends Application implements AdBrixRm.InAppMessageClickListener{ @Override public void onCreate() { AdBrixRm.setInAppMessageClickListener(this); } @Override public void onReceiveInAppMessageClick(String actionId, String actionType, String actionArg, boolean isClosed) { Log.d("abxrm", "onReceiveInAppMessageClick actionId = " + actionId); Log.d("abxrm", "onReceiveInAppMessageClick actionType = " + actionType); Log.d("abxrm", "onReceiveInAppMessageClick actionArg = " + actionArg); Log.d("abxrm", "onReceiveInAppMessageClick isClosed = " + isClosed); } }
class MainApplication: Application(), AdBrixRm.InAppMessageClickListener { override fun onCreate() { super.onCreate() AdBrixRm.setInAppMessageClickListener(this) } override fun onReceiveInAppMessageClick(actionId: String, actionType: String, actionArg: String, isClosed: Boolean) { Log.d("abxrm", "onReceiveInAppMessageClick actionId = " + actionId); Log.d("abxrm", "onReceiveInAppMessageClick actionType = " + actionType); Log.d("abxrm", "onReceiveInAppMessageClick actionArg = " + actionArg); Log.d("abxrm", "onReceiveInAppMessageClick isClosed = " + isClosed); } }
Click listener passed value details
The types and examples of values passed through the click listener are as follows.
- actionId (String): button_1, button_2, image, sticky
- actionType (String): close, deeplink_and_close, weblink, weblink_and_close, dont_show_me_today_and_close
- actionArg (String): weblink address, deeplink path
- isClosed (Boolean): Whether the in-app message was closed.
Using self-serve in-app messages
What is Self-Serve In-App Message?
Self-Serve in-app messages refer to in-app messages that the user directly retrieves and opens data, unlike in-app messages that are triggered by events occurring in the SDK.
Utilization method
Get and open Self-Serve in-app messages at the timing you want.
guide
Step 1. Use
getSelfServeInAppMessages()
to get all in-app message data.
AdBrixRm.getSelfServeInAppMessages(new AdBrixRm.GetSelfServeInAppMessagesCallback() { @Override public void onCallback(List list) { } });
AdBrixRm.getSelfServeInAppMessages { }
Step 2. Find the in-app message data you want to display.
[[Quote:Warning:Normal]] 💡 You can find the data you want more easily by using the additional settings value (extAttr in the code) set when creating a Self-Serve in-app message campaign.
//Find one in-app message that has the additional setting {keyWhatIFound} value AdBrixRm.getSelfServeInAppMessages(new AdBrixRm.GetSelfServeInAppMessagesCallback() { @Override public void onCallback(List list) { SelfServeInAppMessage foundInAppMessage = null; for(SelfServeInAppMessage inAppMessage: list){ if(inAppMessage.getExtAttr().has("{keyWhatIFound}")){ foundInAppMessage = inAppMessage; } } } });
//Find one in-app message that has the additional setting {keyWhatIFound} value AdBrixRm.getSelfServeInAppMessages { var foundInAppMessage: SelfServeInAppMessage for (inAppMessage in it){ val extAttr = inAppMessage.extAttr if(extAttr!=null){ if(extAttr.has("keyWhatIFound")){ foundInAppMessage = inAppMessage } } } }
Step 3. Enter the campaign ID to display an in-app message.
if(foundInAppMessage != null){ AdBrixRm.openInAppMessage(foundInAppMessage.campaignId, new Completion() { @Override public void handle(Result emptyResult) { Log.d(TAG, emptyResult.toString()); } }); }
if(foundInAppMessage != null){ AdBrixRm.openInAppMessage(foundInAppMessage.campaignId, Completion { Log.d(TAG, it.toString()) }) }