iOS 11 new notification center removes all delivered notifications after user make any action with one of them - notifications

I have an issue on iOS 11. All delivered notification automatically removing from notification tray after I select any action for one of them. This happens before my code start handling action. In iOS 10 everything is ok, all delivered notifications stay in delivered and disappear only notification where I proceed some action.
My app schedule reminders with custom action, 2 buttons Activate and Stop. User can receive many of them in one day, but its very important to keep already delivered notifications, because most of them is uniq and make different actions.
If it is iOS 11 new notification center behavior or known issue, where I can read about this? Thanks a lot for help.
Minimum deployment target in my app is iOS10 and I use new UNNotificationRequest for scheduling local notifications.

Related

Not receiving local scheduled notifications on iOS

My CRNA (Expo) app schedules local notifications for event reminders. The notifications are scheduled and received perfectly on Android, but not iOS.
I've created a reduced test case: https://github.com/nandastone/crna-expo-local-notification-test
Tapping the "Send Immediate Notification" button calls Notifications.presentLocalNotificationAsync() which IS then received by the callback.
Tapping the "Send Delayed Notification" button schedules a notification in 5 seconds with Notifications.scheduleLocalNotificationAsync() which IS NOT received by the callback.
I'm aware that notifications are not displayed by iOS if the app is in the foreground (https://forums.expo.io/t/psa-reminder-notifications-in-ios-foregrounded-apps/641), but I'm not receiving notifications at all in the Notifications.addListener() callback. Closing the app after scheduling a notification also has no effect.
I'm fairly certain the Permissions.REMOTE_NOTIFICATIONS check is not required for local notifications (it certainly isn't on Android), but I've included it to be sure.
Please help!
In my reduced test case I was missing an event listener for receiving notifications (Notification.addListener()).
The issue in my real app, however, was the limit of 64 local notifications on iOS. The app was scheduling more than 64 notifications at once, and they were not all firing.

Saving all push notifications data got for an app when app is in terminate or inactive state

I'm new to iOS development and currently i'm working on push notifications.I have a requirement where I will get push notifications for different functionalities in an app. When app is in terminate or inactive state all notifications will display in system notifications panel. When I tapped on particular notification remaining notifications data is lost. Is there any thing like we can store all push notifications data and when launching we can execute one by one.
No, not on iOS.
Apps like facebook do this by keeping the state of the push notification on there server. Thus allowing a client to fetch the alerts and show their read state.

Show on Lock Screen push notification settings?

To get push notifications settings for an app I use:
[UIApplication sharedApplication].currentUserNotificationSettings
and then I check for the types of UIUserNotificationSettings. There are only 4 types None, Badge, Sound, Alert. If I use an app with settings like this:
I get that Sound, Badge, Alert is disabled and None is enabled. Why is None enabled if I still have “Show on Lock Screen” switch to ON? I am confused, is the “Show on Lock Screen” treated somehow different? From my understanding the app should still be able to receive push messages. Is there any way to find out “Show on Lock Screen” switch value for push notifications?
The API gives you access to the alert style when unlocked.
Given the fact that you still have the option Allow Notifications turned on, your app will still receive push notifications. So, by putting a breakpoint in code you'll see it being executed when you receive a push notification.
The currentUserNotificationSettings will tell you which type of alert style will be used for displaying when the phone is unlocked: None is a viable option and, along with Badge App Icon disabled your app can receive Push Notifications without showing any type of Banner, Alert, or Badge.
Show on Lock Screen can be seen as a way for the user to customize which notifications are and aren't presented, and in which way, in its phone. I don't think there's an API that will tell you whether or not that option is enabled.
I've just tested Messages.app with the exact same configuration you presented and by sending messages to myself there was no Badge, no Banner, no Alert but if I quickly lock the screen the phone wakes up with a notification in the Lock Screen.

Updating notification badge after dissmissing notification from Notification Center

My app uses Local Notifications. There are situations when more than one notification is scheduled and at some point displayed. When notifications are displayed badge number is updated automatically. When user clicks on one of the notifications I manually decrease badge number and cancel the notification.
The problem starts when user manually dismisses notification from Notification Center. The badge number is not updated. There are situations when there are no notifications displayed in Notification Center and badge shows a number. User is not able to clear the badge.
Setting the badge number to 0 (instead of decreasing it) after clicking on one of the notifications is not an option because it causes all notifications to disappear from Notification Center.
Is there a good way to resolve this issue?
Is there a good way to resolve this issue?
No.
Your app isn't notified when a user dismisses the local notification. Only push notifications can set the badge number when your app isn't running.
The badge is intended to represent the internal state of some data in your app that you control. There is no way to make it always match the number of items in the user's notification center. This is also why you get no notification if the user cancels your local notification.

iOS 4 resume from background

It is possible to get a notification or something when the user opens the application, but the application was in the background (so it wasn't closed)?
Your App Delegate will have its function applicationWillEnterForeground called before coming back.
Also, the OS will have queued a series of potential notifications for significant OS changes if it were freeze dried when those events were fired, ie: UIApplicationSignificantTimeChangeNotification and UIDeviceBatteryLevelDidChangeNotification