IPhone : Method not being called: - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken

on Tuesday, March 31, 2015

Been stuck on this forever, but could not get the following methods to be called. I am able to get the phone to ask for permission but after that it gets stuck.



- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
NSLog(@"My token is: %@", deviceToken);
}

- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
NSLog(@"Failed to get token, error: %@", error);
}


I have tried quite a few things including:


1) everything offered in the following stackoverflow post: why didRegisterForRemoteNotificationsWithDeviceToken is not called


2) Looking at this technical note from Apple: https://developer.apple.com/library/ios/technotes/tn2265/_index.html


3) This entire tutorial: http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1 (so hopefully my certificates are all good)


4) (And yes I have internet connection)


Does anyone have any possible solutions? I have been rattling my brains out for the last 2-3 days and have already had to factory reset my phone twice, as well as change the date on my phone N^e number of times in order to get the notification popup to appear to test over and over again.


Would love any help! Thanks!


0 comments:

Post a Comment