Integrating Growth Action [Android]
Follow
Getting Started
DFINERY Growth Action provides functions to help customers engage with their engagement marketing activities.
[Learn about the Growth Action service]
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
Definery To integrate the growth action feature, you need to set up subscription settings for notifications. The SDK allows subscription and unsubscription settings not only for push notifications but also for other channels, and it also provides the ability to retrieve the currently set values.
Subscribe and Unsubscribe Notifications
After setting subscription information using SubscriptionStatus.Builder, pass the set information to the server with the setSubscriptionStatus method.
[[Quote:Risk:Moderate]]
Precautions
Consent to receive informational notifications is a higher-level item that includes consent to receive promotional notifications. Therefore, if the consent to receive informational notifications is UNSUBSCRIBED, promotional push notifications will not be sent even if consent to receive promotional notifications and nighttime promotional notifications is SUBSCRIBED.
[[Citation: Risk: Moderate]]
Notice
Notifications may be sent if there is no setting history according to the sending logic, so please be sure to set items for which you do not wish to receive notifications to UNSUBSCRIBED.
[[Quote:Risk:Moderate]]
Note
If you use this API without calling the login(String user_Id) API, only informational notifications can be used, and it will be classified as a device-based audience. To use user-based audiences and promotional notifications, the login(String user_Id) call must be made first.
-
Create Subscription Information
-
SubscriptionStatus.Builder
- setInformativeNotificationFlag() : Set consent for receiving informative notifications
- setMarketingNotificationFlag() : Set consent for receiving marketing notifications
- setMarketingNotificationFlagForPushChannel() : Set consent for receiving marketing notifications (Push Channel)
- setMarketingNotificationFlagForSmsChannel() : Set consent for receiving marketing notifications (SMS Channel)
- setMarketingNotificationFlagForKakaoChannel() : Set consent for receiving marketing notifications (KakaoTalk Channel)
- setMarketingNotificationAtNightFlag() : Set consent for receiving marketing notifications at night
- setMarketingNotificationAtNightFlagForPushChannel() : Set consent for receiving marketing notifications at night (Push Channel)
- setMarketingNotificationAtNightFlagForSmsChannel() : Set consent for receiving marketing notifications at night (SMS Channel)
- setMarketingNotificationAtNightFlagForKakaoChannel() : Set consent for receiving marketing notifications at night (KakaoTalk Channel)
-
SubscriptionStatus.Type
- SUBSCRIBED : Consented
- UNSUBSCRIBED : Not Consented
-
SetSubscriptionStatusResult
- isSuccess() : Whether it was successfully applied on the server
- 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 : Agreed
- UNSUBSCRIBED : Not Agreed
- UNDEFINED : No Setting History
-
GetSubscriptionStatusResult
- isSuccess() : Whether it was applied correctly on the server
- getResultCode() : Get result code
- getResultMessage() : Get result message
- getInformativeNotificationFlag() : Get consent value for receiving informational notifications
- getMarketingNotificationFlag() : Get consent value for receiving marketing notifications
- getMarketingNotificationFlagForPushChannel() : Get consent value for receiving marketing notifications (Push Channel)
- getMarketingNotificationFlagForSmsChannel() : Get consent value for receiving marketing notifications (SMS Channel)
- getMarketingNotificationFlagForKakaoChannel() : Get consent value for receiving marketing notifications (KakaoTalk Channel)
- getMarketingNotificationAtNightFlag() : Get consent value for receiving marketing notifications at night
- getMarketingNotificationAtNightFlagForPushChannel() : Get consent value for receiving marketing notifications at night (Push Channel)
- getMarketingNotificationAtNightFlagForSmsChannel() : Get consent value for receiving marketing notifications at night (SMS Channel)
- getMarketingNotificationAtNightFlagForKakaoChannel() : Get consent value for receiving marketing notifications at night (KakaoTalk 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 confirmation
For the notification push channel, it is separate from the device's Push on/off settings, so please refer to the
Push on/off section
below and set Push to On if you wish to use push notifications.
Get notification settings value
The getSubscriptionStatus method retrieves the information set on the server.
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 Default Settings
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 Firebase Cloud Messaging Client App on Android
[[Caution: Risk: Moderate]]NoticeThe sending method using Firebase Server Key and Sender ID will no longer be supported after June 13, 2024, due to the discontinuation of support for the existing Firebase HTTP API. Please integrate according to the Firebase certificate issuance and registration guide introduced below.
View previous integration method
Register Firebase Server Key, Sender ID
To use the DFINERY Growth Action, you must register the Firebase Server Key / Sender ID in the
DFINERY Console
.
You can check the Firebase Server Key / Server ID in the Firebase console -> Settings -> Cloud Messaging.
a. Check the Firebase Server Key and Sender ID in the Firebase console.
b. Enter the verified key value in the Growth Action - Settings menu of the adbrix console.
Issuing a Firebase Certificate
1. Access 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, so refer to Adding Firebase to your Android project to create a Firebase project.
3. Click on ⋮ in the task at the bottom right.
4. Click on Key Management from the dropdown.
5. Select Add Key.
If a key has already been generated, it means there is a history of a previously generated key, and you can use that key. If the key cannot be found, please generate a new key.
6. Click Create New Key from the dropdown.
7. Select JSON and click create.
8. The key issuance has been completed.
Register Firebase certificate in console
[[Citation:Warning:Normal]] Console setup opening date
The feature to register Firebase certificates in the console is scheduled to open on June 13th.
1.Access the console .
2. Click on Settings of GrowthAction in the left panel.
3. In the Android Push Setting tab, click Register in the Firebase Cloud Messaging certificate.
4. Click the upload button to upload the key.
5. After completing the upload, click the confirm button.
6. Click Save to apply the certificate.
7. The certificate has been registered in the console.
Push notification settings
Register the following receiver in AndroidManifest.xml.
<receiver android:name="com.igaworks.v2.core.push.notification.AbxPushReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE"/>; <action android:name="com.igaworks.v2.core.pushServiceImplement.CLIENT_PUSH_RECEIVE"/> </intent-filter> </receiver>
In the onMessageReceived of the FirebaseMessagingService you wrote, set up push reception using AdBrixRm.onMessageReceived.
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) } }
Set Token Value
To set the Token value of Firebase in adbrix, add the Token value using AdBrixRm.setRegistrationId within onNewToken() of FirebaseMessagingService.
And add the following code so that the Token value can be updated in the Application you are using.
public class MyApplicationClass extends Application { @Override public void onCreate() { super.onCreate(); refreshToken(); } private void refreshToken(){ FirebaseMessaging.getInstance().getToken() .addOnCompleteListener(new OnCompleteListener<String>() { @Override public void onComplete(@NonNull Task<String> 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 integrated to use the adbrix Gross Action service. This API allows you to manage push services.
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 of the dictionary
is 'Push off'.
Therefore, after completing the growth action integration, you must call the Push On API after obtaining push reception consent from users.
For users who have previously given consent for push reception, you must also call the Push On API to receive pushes.
Push Notification Runtime Permission Request
On Android 13 and above, obtaining
android.permission.POST_NOTIFICATIONS
runtime permission
is required to receive push notifications on the device.Please refer to the following guide to obtain runtime permissions in the app.
[[Quote:Guide:Normal]]
Congratulations~!
Definery
basic integration for Growth Action service has been completed.
From then on, you can receive server pushes, and please continue integration to set local push and other push message options.
Additional Push Service Settings
KakaoTalk Settings
Settings 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:Warning:Small]] This API is available after logging in.
SMS Settings
This is the setting for using SMS. *PHONE_NUMBER : Value excluding "+" from country code + number following 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 phoneNumber format 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 becomes false. } else { println("Failure: ${result.resultMessage}") } } })
[[Quote:Warning:Small]] PHONE_NUMBER: Value excluding "+" from country code + number compliant with E.164 (Example: 8210********)
[[Quote:Warning:Small]] This API can be used 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 in this way is exposed as shown below.
[[Quote: Danger: Moderate]]
Precautions
1) Enter only the name of the image file without the extension.
2) You must add all images with that name to the Drawable folder of all resolutions.
3) If you have set a largeIcon in the server push, that icon will be displayed with priority.
4) ARGB settings change 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.
Push notification channel settings
To create notifications on Android 8.0 and above, 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")
Push Notification Settings
Sets the exposure level of push notifications. The push notification settings API below is only available on Android versions below 8.0.
AdBrixRm.setNotificationOption(this,NotificationCompat.PRIORITY_MIN,NotificationCompat.VISIBILITY_SECRET);
AdBrixRm.setNotificationOption(this,NotificationCompat.PRIORITY_MIN,NotificationCompat.VISIBILITY_SECRET)
Head-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 : Do not use lock screen notifications
- VISIBILITY_PRIVATE: Lock screen notifications are displayed, but the content is not shown
- VISIBILITY_PUBLIC: Display all content on the lock screen
Push Notification Listener
Setting up listeners 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 { ... } } }
[[Citation: Danger: Moderate]]
Precautions
Push listener must be added to the Application Class.
This listener operates when the push is clicked and transmits the following information upon clicking.
-
Local Push
-
OnLocalPushClickResult
- openViewByDeeplink(): Open the browser using the received Deeplink value
- getDeeplinkUri() : Retrieve the Uri value of the given Deeplink
- getDeeplink() : Get the received Deeplink value string
- getUrlDecodedDeeplinkUri() : Get the URL-decoded received Deeplink value Uri
- getUrlDecodedDeeplink(): Get the URL-decoded received Deeplink value string
-
OnLocalPushClickResult
-
Server Push
-
OnRemotePushClickResult
- openViewByDeeplink() : Open the browser using the received Deeplink value
- getDeeplinkUri() : Retrieve the Uri value of the given Deeplink
- getDeeplink() : Retrieve the string value of the received Deeplink
- getUrlDecodedDeeplinkUri() : Get the URL decoded received Deeplink value Uri
- getUrlDecodedDeeplink() : Get the URL-decoded received Deeplink value string
- getPushModel() : Retrieve push data received from the server
-
OnRemotePushClickResult
[[Quote:Danger:Small]]
If an operation is not implemented: When a 'Not yet implemented' error is reported
There are instances where this error occurs when using TODO comments within the callback method, regardless of the SDK.
If there is a TODO within 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 Value
- title : 제목
- body : content
- deeplink : The deep link address to be delivered to the listener upon push click
Image Push
Set up a push message composed 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 Value
- title : 제목
- body : Content
- deeplink: The deep link address to be delivered to the listener when the push is clicked
- imageUrl : Image URL
[[Quote:Warning:Normal]] It is recommended to use images with a 2:1 ratio and a maximum size of 1350x675.
Local Push Control
Used for management and control of currently set local push notifications.
List<PushEvent> 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: Check the currently scheduled local push list. The list is displayed as PushEvent.
- cancelLocalPushNotificationAll : Cancels the delivery of all local pushes.
In-app message service settings
Default settings
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 from Android SDK version 2.1.0.0 and above.
Parent view user settings
By default, the Definery in-app message automatically finds the area to display and shows the in-app message screen.However, there are cases where it is not displayed depending on the app's environment.
At that time, you can set the parent view where the in-app message will be displayed directly.
[[Quote:Guide:Normal]] If you set it to null or do not call this API, it will automatically find and display the area to be shown from the dictionary.
Dfinery.getInstance().setCustomInAppMessageParentView(findViewById(R.id.container));
Dfinery.getInstance().setCustomInAppMessageParentView(findViewById(R.id.container))
Set click event listener
The users in-app message click event is delivered through the configured listener.
You can define additional actions for the click event using this listener.
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 Pass Value Details
The type and example of the value 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 is closed.
Using Self-serve In-App Messages
What is a Self-Serve In-App Message?
Self-Serve in-app messages refer to in-app messages that are opened by the user fetching data directly, unlike in-app messages triggered by events occurring in the SDK.
Utilization Plan
Retrieve and open Self-Serve in-app messages at your desired timing.
Guide
Step 1.Retrieve all in-app message data using
getSelfServeInAppMessages()
.
AdBrixRm.getSelfServeInAppMessages(new AdBrixRm.GetSelfServeInAppMessagesCallback() { @Override public void onCallback(List<SelfServeInAppMessage> list) { } });
AdBrixRm.getSelfServeInAppMessages { }
Step 2.Looking for in-app message data to display.
[[Quote:Warning:Normal]] 💡 When creating a Self-Serve in-app message campaign, you can more easily find the desired data by utilizing the additional configuration values (extAttr in the code) you set.
//Find one in-app message with the value of {keyWhatIFound} AdBrixRm.getSelfServeInAppMessages(new AdBrixRm.GetSelfServeInAppMessagesCallback() { @Override public void onCallback(List<SelfServeInAppMessage> list) { SelfServeInAppMessage foundInAppMessage = null; for(SelfServeInAppMessage inAppMessage: list){ if(inAppMessage.getExtAttr().has("{keyWhatIFound}")){ foundInAppMessage = inAppMessage; } } } });
//Find a single in-app message with 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 the 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()) }) }