Reputation: 116
In my app, i created a develop provision profile with Push Notification enabled, and i put it to work by adding code
[application registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeAlert];
in my app -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
The push notification works fine. the problem is: for the first time i ran my app on my device, there was supposed to be a alert view to ask the user whether they allow the Push notification or not. But this alert option doesn't show, i have deleted my app from my iphone and re-installed many times, never had a time show this alert view for the first time running, the app just go straight to register the push notification.
As in the App Review Guideline: 5.3 Apps that send Push Notifications without first obtaining user consent will be rejected. my app will be rejected due to this issue.
Upvotes: 0
Views: 1186
Reputation: 81
Please check following conditions:
Instead of using "application" you can use "[UIApplication sharedApplication]" in your code.
For ex:-
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
It usually happens with the apple device's, if once you click allow for notification confirmation & though you delete the app, next time it won't ask for the confirmation(not show the notification alert). But this happens only in case of development profile. If you install the app from app-store(which use distribution profile), it will ask the confirmation each time after installation.
Also check the settings of device on which you are testing notifications, the Notification center should be always "ON" for the notifications.
Upvotes: 1