Reputation: 11
I'm a new in iOS development.
I have a app which like to receive Notification push, i generated the certificate, registered my iPhone as a device, create a App ID, and generate the profile. By now, I'm able to build/debug in my iPhone(iOS 5.0.1, my iPhone is JeailBreaked). Then in my AppDelegate didFinishLaunchingWithOptions, I add below code:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound];
With this code, I wish when the app is first loaded, it can pop up a alert to promote Approve/DisApprove to receive the Notification Push. But nothing is pop up.
I'm not quite sure about the profile file. May be I need to do something about it? Or did I missed some other thing?
Thanks All,
Benroo
Upvotes: 0
Views: 288
Reputation: 11
I've resolved. I need to create a new profile file. And delete the old from xCode Orginazer, and to import the new one.
Upvotes: 1
Reputation: 2822
Are you using a Team Provisioning Profile perhaps? Notifications will not work with these, you must set it to a specific profile for that app identifier. Check the delegate method
– application:didFailToRegisterForRemoteNotificationsWithError:
described here for more info on why it is not working.
Upvotes: 1