Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable/Disable Apple Push Notification from iPhone app?

Tags:

I have one more doubt on APNS. That is when the app first launch the app asks for Apple Push Notification Permission if the user accepted the they can receive the notifications. If the user cancelled they can't receive any notifications. Am I clear??

Now my doubt is,

  1. At first time if the user cancelled the push notification service from the app (Clicked Cancel button) again after some days if they want receive Apple Push Notification it is possible to enable the Apple Push Notification again for the particular user from the App.

  2. And if the user accept the apple push notification service first and after some days if they don't want to receive the notifications it is possible to disable the APNS in our app? I hope you understand my doubt. Can any one please clarify this doubt?

  3. It is possible to do these above scenarios in our iPhone app?

Please help me. Thanks in advance.

like image 543
Gopinath Avatar asked May 08 '12 06:05

Gopinath


People also ask

How to turn on push notifications on iOS devices?

How to Turn on Push Notifications on iOS 1 Tap the Settings icon on your device’s Home screen to launch the Settings app. 2 Now tap Notifications. 3 Select the app for which you would like to turn on push notifications and set all of the available switches to ON. See More....

Is it possible to enable Apple Push Notification again after cancelling?

Now my doubt is, At first time if the user cancelled the push notification service from the app (Clicked Cancelbutton) again after some days if they want receive Apple Push Notification it is possible to enable the Apple Push Notification again for the particular user from the App.

How do I turn off notifications on iPhone?

To turn off notifications selectively for apps, go to Settings > Notifications > Siri Suggestions, then turn off any app. When you use Focus, it delays the delivery of notifications on iPhone to prevent interruptions. You can schedule a time to receive a summary of the notifications you missed.

How do I change the notification settings on my Device?

Most notification settings can be customized for each app. You can turn app notifications on or off, have notifications play a sound, choose how and where you want app notifications to appear when your device is unlocked, and more. Go to Settings > Notifications.


1 Answers

You can read your app's permissions using UIRemoteNotificationType enabledTypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; and then performing a bitwise and operation with the different types to see which are enabled. You can also call unregisterForRemoteNotifications to disable notifications. The one thing you can't do is turn on notifications, although you can direct the user.

like image 82
jrtc27 Avatar answered Nov 25 '22 17:11

jrtc27