question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android docs outdated

See original GitHub issue

Intercom 5 is due to be discontinued and will stop working in June 2020.

Users need to install Intercom 6:

implementation 'io.intercom.android:intercom-sdk:6.+'
implementation 'com.google.firebase:firebase-messaging:20.+'

https://github.com/intercom/intercom-android

Additionally the MainMessagingService example for combining Intercom pushes with react-native-firebase no longer works due to a major version change on that library.

I’m currently integrating this library with all the newer stuff - will post in this issue the necessary changes and then we can hopefully update the docs!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
nabilfreemancommented, May 4, 2020

To get react-native-intercom working with the newest React Native Firebase (there is an example for this in the docs…

The change is quite simple to be honest, RNFirebaseMessagingService has changed to ReactNativeFirebaseMessagingService. That’s it. Also, the original implementation was missing something for the Intercom push token that also needs to be present.

Feel free to remove the below logs, I found them really helpful.

PushNotificationService.java (make sure the name matches in AndroidManifest.xml)

package com.your.package.name.here;

import io.intercom.android.sdk.push.IntercomPushClient;
import io.invertase.firebase.messaging.ReactNativeFirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import android.util.Log;
import java.util.Map;

public class PushNotificationService extends ReactNativeFirebaseMessagingService {
	private static final String TAG = "PushNotificationService";
	private final IntercomPushClient intercomPushClient = new IntercomPushClient();

	@Override
	public void onNewToken(String refreshedToken) {
		intercomPushClient.sendTokenToIntercom(getApplication(), refreshedToken);

		super.onNewToken(refreshedToken);
	}

	@Override
	public void onMessageReceived(RemoteMessage remoteMessage) {
		Map message = remoteMessage.getData();

		Log.d(TAG, "Hi I received a push message: " + message.toString());

		if (intercomPushClient.isIntercomPush(message)) {
			Log.d(TAG, "The message is from Intercom.");
			intercomPushClient.handlePush(getApplication(), message);
		} else {
			Log.d(TAG, "The message is from Firebase.");
			super.onMessageReceived(remoteMessage);
		}
	}
}
2reactions
aibrahim3546commented, Jul 29, 2020

@nabilfreeman I am getting this error

error: package io.invertase.firebase.messaging does not exist

what am i lacking of? any idea?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deprecations - Android Developers
With each release, specific Android APIs may become obsolete or need to be refactored to provide a better developer experience or support new...
Read more >
Official Android docs containing deprecated code : r/androiddev
Official Android docs containing deprecated code ... It's infuriating. Google changes the "approved" way of doing things so frequently it's a ...
Read more >
The documentation is incorrect/very outdated for building ...
The documentation is incorrect/very outdated for building under Android ... Bug exists in Snapshot Version 1.1.2-SNAPSHOT (Android Service ...
Read more >
Fix an installed Android app that isn't working - Google Support
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >
Deprecated. Why I stopped being an Android Developer.
... I just want to mention that these are personal reasons and opinions. If you love Android, then your determination for this development...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found