In Android, we are observing that in-app messages, of type system full page or modal, are getting auto dismissed within a few seconds.
In our understanding by doc, in-app msg feature is auto included since integrating the salesforce sdk. But we are facing that auto dismissed issue.
Hence, We tried show the msg by capturing message id and show that message by using below method which is describe in this doc : https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/in-app-message/in-app-messaging.html
MarketingCloudSdk.requestSdk(new MarketingCloudSdk.WhenReadyListener() {
@Override
public void ready(@NonNull MarketingCloudSdk marketingCloudSdk) {
String inAppMessage = LocalDataManager.getSharedInstance().
getString(AppCoreConstants.SALESFORCE_CLOUD_INAPP_MESSAGE_ID,AppCoreConstants.EMPTY_STRING);
if(!AppCoreUtils.isEmpty(inAppMessage)){
marketingCloudSdk.getInAppMessageManager().showMessage(inAppMessage);
Log.d("SF_INAPP_SHOW", ""+inAppMessage + "");
}
}
});
But when sending the in app from server, app is not showing the msg.
In Android Studio Log, we found that in app msg is get downloaded. I have logged the msg after showMessage() method. I can confirm that log generate the msg.
However it cannot show in app.
I go back to background and come to foreground multiple time . But still do not see the in app pop up although Android logcat is generated the msg.
We used Salesforce SDK version 6.3.5
MarketingCloudSdk.requestSdk(new MarketingCloudSdk.WhenReadyListener() {
@Override public void ready(@NonNull MarketingCloudSdk sdk) {
Log.d("SDKSTATE", sdk.getSdkState().toString());
//Generate token here to test the saleforce push notification
Log.d("TOKEN", sdk.getPushMessageManager().getPushToken()+" ");
sdk.getInAppMessageManager().setInAppMessageListener(
new InAppMessageManager.EventListener() {
@Override
public boolean shouldShowMessage(@NonNull InAppMessage inAppMessage) {
Log.d("SF_INAPP_RECEIVE" , ""+ inAppMessage + "");
LocalDataManager.getSharedInstance().set
(AppCoreConstants.SALESFORCE_CLOUD_INAPP_MESSAGE_ID, inAppMessage.id());
return false;
}
@Override
public void didShowMessage(@NonNull InAppMessage inAppMessage) {
}
@Override
public void didCloseMessage(@NonNull InAppMessage inAppMessage) {
Log.d("SF_INAPP_CLOSE" , ""+ inAppMessage + "");
}
});
}
});
Can anyone help? Thanks in advance.