react-native: [PushNotificationIOS] No register event ever gets triggered
I’m trying to get push notifications working on my device:
Pulling this commit on React 0.5.0.
Adding a PushNotificationIOS.requestPermissions()
in my render pops open the permissions box, but when I add:
PushNotificationIOS.addEventListener('register', function(data) {
console.log(data);
});
I get nothing logged. I’ve tried in the simulator and on an actual device but once I click the allow button, nothing. I’ve tried using this component too.
I also tried adding the following code to my AppDelegate.m
from this thread:
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[RCTPushNotificationManager application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
Any ideas?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 46 (24 by maintainers)
Commits related to this issue
- Fix for IOS 8 Summary: **Problem** Using push notifications in IOS 8 will throw this error: `registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.` The problem is that the check ... — committed to facebook/react-native by DannyvanderJagt 9 years ago
- Fix for IOS 8 Summary: **Problem** Using push notifications in IOS 8 will throw this error: `registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.` The problem is that the check ... — committed to purposecampaigns/react-native by DannyvanderJagt 9 years ago
- Fix for IOS 8 Summary: **Problem** Using push notifications in IOS 8 will throw this error: `registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.` The problem is that the check ... — committed to philly-d/react-native by DannyvanderJagt 9 years ago
- Fix for IOS 8 Summary: **Problem** Using push notifications in IOS 8 will throw this error: `registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.` The problem is that the check ... — committed to skillz/react-native by DannyvanderJagt 9 years ago
- Fix for IOS 8 Summary: **Problem** Using push notifications in IOS 8 will throw this error: `registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.` The problem is that the check ... — committed to Crash--/react-native by DannyvanderJagt 9 years ago
Push notifications on IOS does not work in Simulator. To see an error, you need to register this delegate
Finally got it working. For those who still couldn’t get the register event working:
1.) Clean up your provisioning profiles. Even better generate new profiles with the new cert and apn and delete the rest from your device and xcode. 2.) Clean project and run again.
http://stackoverflow.com/a/8036052/4563055