Trying to setup FCM on an ExpoKit project... so close! (I think)

Figured out the double notification thing. The GCM configuration in AndroidManifest.xml needs to be removed.

So, to expand on @jesse’s directions from the original post, here’s the steps as best I can tell so far to add FCM to an ExpoKit project:

  1. Copy over the google-services.json file in the android project folder with the one you get from Firebase when you create a new Android app on their console.
  2. Copy the FCM service declarations into AndroidManifest.xml referenced in this forum post. (from comments on later versions of this code, it sounds like maybe this is already in AndroidManifest.xml when you detach if you had already configured FCM?).
  3. Delete the GCM service declarations in AndroidManifest.xml.
  4. Set AppConstants.FCM_ENABLED = true in AppConstants.java.

To test sending to a specific device, call Expo.Notifications.getDevicePushTokenAsync() to get your FCM token, then feed that into the cloud messaging tester on the Firebase console.

2 Likes