tinycreative / react-native-intercom

React Native wrapper for Intercom.io
MIT License
406 stars 280 forks source link

Push Notification (iOS) Are there additional steps? #377

Closed darkABCD closed 4 years ago

darkABCD commented 4 years ago

I have push notifications successfully setup with FCM. I'm able to send notifications from my own server without any problems whatsoever.

However, I'd like to enable push notifications for Intercom too.

In the documentation, step (5)(iii) says to add the following:

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {

    // Intercom
    [Intercom setDeviceToken:deviceToken];

}

Are there any additional steps to get this to work. Because it seems like this isn't actually doing anything.

This is how my AppDelegate.m file looks right now.

....

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if DEBUG
  InitializeFlipper(application);
#endif

  if ([FIRApp defaultApp] == nil) {
    [FIRApp configure];
  }

  // Intercom
  [Intercom setApiKey:@"API_KEY_PLACED_HERE" forAppId:@"APP_ID_HERE"];
  ......
}

.....

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {

    // Intercom
    [Intercom setDeviceToken:deviceToken];

}

@end

Thank you in advance for the help.

darkABCD commented 4 years ago

Nevermind. You can close this. Additional steps in (https://developers.intercom.com/installing-intercom/docs/ios-push-notifications) are required.

AlphaJuliettOmega commented 3 years ago

@darkABCD can you perhaps elaborate?

Are the steps marked 'optional' required? It seems to me like custom handling of the Push Notifications might be required because on v19 of this library the push notification just does... nothing.

I wish it logged something so It's clear what's going on.

My messages are 'sent' Intercom side but never arrive at the target device.