From c2c4771c8ee4ce5af0112a83d5168022a38de715 Mon Sep 17 00:00:00 2001 From: Daniel Braun Date: Sat, 18 Jun 2016 08:53:58 -0700 Subject: [PATCH] Added logging to push registration failure. Summary: It seems it's a common problem people trying to register for push notifications in their simulator, and not understanding why the "register" event never works. I've wasted a few hours myself on this issue. This commit simply logs any failures with push registration, preventing confusion. Closes https://github.com/facebook/react-native/pull/8046 Differential Revision: D3454922 Pulled By: javache fbshipit-source-id: a96896d97d97cfe1bd319e6490750838dfaad3cd --- Libraries/PushNotificationIOS/PushNotificationIOS.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/PushNotificationIOS/PushNotificationIOS.js b/Libraries/PushNotificationIOS/PushNotificationIOS.js index f6f5ffc90e5469..5089e7ee601b4b 100644 --- a/Libraries/PushNotificationIOS/PushNotificationIOS.js +++ b/Libraries/PushNotificationIOS/PushNotificationIOS.js @@ -70,6 +70,10 @@ const DEVICE_LOCAL_NOTIF_EVENT = 'localNotificationReceived'; * { * [RCTPushNotificationManager didReceiveLocalNotification:notification]; * } + * - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error + * { + * NSLog(@"%@", error); + * } * ``` */ class PushNotificationIOS {