Opening a chat when clicking on a push message | Community
Skip to main content

I encountered a problem with opening a chat with a conversation when clicking on a push, when clicking it just opens the application

 

implementation 'io.intercom.android:intercom-sdk:15.11.5'
    private final IntercomPushClient intercomPushClient = new IntercomPushClient();

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {

Map<String, String> message = remoteMessage.getData();

if (intercomPushClient.isIntercomPush(message)) {
intercomPushClient.handlePush(getApplication(), message);
}



 

    @Override
protected void onResume() {
super.onResume();
checkPendingDeepLink();
Intercom.client().handlePushMessage();



 

    @Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
.....

Bundle bundle = getIntent().getExtras();
if (bundle != null) {

String link = bundle.getString("link");

if (link != null) {
IntercomManager.openChat(link);
}
}


onMessageReceived callback works, but onNewIntent doesn't triggers
Have I missed something ? thanks 

Hey ​@Viacheslav kolisnichenko 👋 Jacques here from Intercom Support. I hope all is well today!

It looks like you're correctly checking if the message is from Intercom and calling handlePush() inside onMessageReceived, which is great. However, the issue seems to be with how the intent is handled when the app is resumed or launched via a push tap.

Intercom’s handlePush() doesn't automatically deep link into a conversation. It shows the launcher or home screen unless you handle the push intent properly.

You must capture the push intent from the Activity that launches when tapping the notification and pass it to Intercom.client().handlePushMessage() inside onNewIntent() or onResume() - which you're trying to do.

More on DeepLinking here:

Hope this helps!


Reply