ricky
ricky

Reputation: 11

How can I turn on push notification by code?

When one application supports remote notifications, iOS will ask the user if the app should be allowed to push remote notification at the first launch.

If you tap the "DON'T ALLOW" button, the iOS system will turn off all notification options(show in notification center, badge, etc.) in Settings-> Notification-> AppName.

But actually, I found some apps (such as Angry Birds) still turns on some notification options in Settings-> Notification-> AppName even if I clicked "DON'T ALLOW" button, then, how did they do that?

Is there any way to turn on app's notification options by code?

Upvotes: 1

Views: 251

Answers (2)

Steve
Steve

Reputation: 1

You're confusing push notifications with all types of notifications, which can include local notifications. The settings you refer control all types of notification.

Upvotes: 0

LJ Wilson
LJ Wilson

Reputation: 14427

I don't think you can do that. Aside from the application asking the user when you have the registerForRemoteNotifications in the didFinishLaunchingWithOptions:

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:...];

You don't have control over whether the user accepts or rejects notifications.

Upvotes: 1

Related Questions