Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

registerForRemoteNotificationTypes not working?

I am trying to implement Parse Push Notifications. I have it all set up for my other app and it works great. However, I am trying to implement it in the app I am working on now. The thing is, is that I just can't get it to work.

I am doing this in the applicationDidFinishLaunching method:

[application registerForRemoteNotificationTypes:
     (UIRemoteNotificationType)
     (UIRemoteNotificationTypeBadge | 
      UIRemoteNotificationTypeSound | 
      UIRemoteNotificationTypeAlert)];

I have also renewed my provisioning profiles, set the app up on Parse, and made sure push notifications were enabled in the portal.

This is the issue, the alert view that says whether or not I want to allow the app to enable Push Notifications never shows. I have no idea why. I am doing the exact same thing in my other app and it works fine so I am unsure why this isn't working.

Does anyone have any ideas?

like image 617
SimplyKiwi Avatar asked Jun 11 '12 00:06

SimplyKiwi


1 Answers

Turns out that my provisioning profiles in my Organizer were not updating from the portal for some odd reason. I had to logout and log back in. Then I refreshed it and everything worked.

Another thing I checked is if my provisioning profile had something called: aps-environment or something similar to that and it didn't so thats what lead me to believe it wasn't my code that was wrong.

like image 122
SimplyKiwi Avatar answered Nov 04 '22 14:11

SimplyKiwi