I am developing an app which accepts push notifications. I want to disable the push notifications for that app only by just toggling UISwitch in the app settings. So is it possible that I can enable or disable the push notifications from the app itself?
Yes, it is possible. Please take a look on registerForRemoteNotifications and unregisterForRemoteNotifications methods (link)
Related
I have integrated firebase for push notifications in flutter. If the app is in foreground I have displayed a dialog with notification details. I am receiving notifications properly in android. Also when I run the ios application from XCode notifications are working fine. However in release ipa notifications are not received in foreground but working well in app background state. I have enabled push notifications and background fetch as well. Any solution for this? Has anybody faced such issue?
Push notifications not showing notifications strip in foreground mode.
Please check in the delegate method that you are receiving or not.
Please follow this link
May be it will help you
https://medium.com/#viveky259259/flutter-firebase-notifications-7954a3ad8111
Is it possible to configure other app notification from my app in
iOS?
I want to Off or ON notification of other app from my app.
Is there any way to do it?
No, there isn't. An app can't change any of the settings for a different app.
Apple doesn't support you to access settings of other applications. So you can't change it.
Is it possible to see old notifications in my iOS device, if I set the app notification settings from OFF state to ON state?
Say for instance, I have set my App notification settings as "OFF" yesterday where the APP admin has sent custom notification message. Today I noticed that the App Settings are in OFF state. So I changed the settings to ON. Will I get that custom notification now?
No it's not possible,Once you de-authorise any app to send Push Notifications then your device isn't able to receive the notification from that particular app,So you can't find the old notifications.
I am using silent push notification in iOS app but not work properly in background while it work fine in foreground. I am unable to find out the what is the problem behind it.
Please help me
You should enable background mode for your app.
As per iOS developer Library.
To support silent remote notifications, add the remote-notification value to the UIBackgroundModes array in your Info.plist file.
Also I believe that silent notifications work in background state. But that is only for UIApplicationStateBackground but after some time the app goes into suspended state and silent notifications wont work here. Needless to say it wont work when app is in terminated state
Supported states for silent push notifications would be
UIApplicationStateActive,UIApplicationStateInactive, UIApplicationStateBackground. But this is something I have heard from a friend who has actually worked on it.
Hope it helps you. Good Luck
My app uses push notifications. If the user says no to push notifications when they install the app, but then a few days later decides they want push notifications, how do I program that option in the app in a settings? Do I just call registerForRemoteNotificationTypes (actually AppDelegate does this every time the app is stated) ?
You can't. The user has to go into settings on the device and allow notifications there.
You can see if notifications are enabled with the enabledRemoteNotificationTypes property of UIApplication and prompt the user to go to settings, but this would be incredibly spammy. You'd be better off having some text in a settings screen.