0

Someone gave me the task to develop push setting

  • that user can set (receive/do not receive) push notification.

I'm confused because I thought it's not possible to control it inside an application.

Is it possible to control push receive setting inside iOS App? may be in newer version?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
  • 1
    You can't change the notification permissions. What you can do is do is tell your server not to send notifications to your device. – Paulw11 Oct 24 '16 at 09:20
  • you can use `registerForRemoteNotificationTypes ` and `unregisterForRemoteNotificationTypes` for enable and disable push notification – Divyesh Savaliya Oct 24 '16 at 09:22
  • 1
    Possible duplicate of [Enable or Disable Iphone Push Notifications inside the app](http://stackoverflow.com/questions/10510578/enable-or-disable-iphone-push-notifications-inside-the-app) – Sahil Kapoor Oct 24 '16 at 09:26
  • https://developer.apple.com/reference/uikit/uiapplication/1623078-registerforremotenotifications – Adrian Oct 24 '16 at 09:29
  • According to my coworker, there will be no sever side coding, we will directly send apple server to send push notification to user, and the Language I am using is swift 3.0 – Jeongyeon Kim Oct 24 '16 at 09:55

1 Answers1

0

You can not control push notification setting from your app.

But you can manage BOOL flag in NSUserDefault.

As per setting your BOOL value will change, so in push notification delegate methods you can use directly apply return keyword to do not process for notification.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Hasya
  • 9,792
  • 4
  • 31
  • 46