Resume notification playback controls? - android-mediaplayer

So I want to be able to resume notifications in my app like Spotify. So Spotify you can start playback then go to phone settings and turn off notifications for Spotify. The notification is gone, then re-enable the notifications. The notification is back.
Is there a callback or a category for these zombie notifications?
Right now I use .setCategory(CATEGORY_SERVICE) in my notification builder but that doesn't work.

If you use CATEGORY_TRANSPORT the notification will come back after being turned off

Related

Disable local notifications on button press in Expo / react-native

I have an Expo app (which has been ejected but there is very little native code being used). I am using expo-notifications to schedule local notifications for the user. I am only doing this for background/killed state notifications. There are no foreground notifications.
I'd like to know if it's possible to turn them on or off when a button is pressed without losing all the notification data in React-native/Expo?
I want to add a toggle in the settings screen to turn notifications on or off and I can't figure out how to do this. I can of course cancel all scheduled notifications with cancelAllScheduledNotificationsAsync, but then if they toggle notifications back on all the existing ones would be lost.
I'm hoping to avoid having to store a bunch of data in AsyncStorage for this.
I'm working on handling this all in push notifications (which will solve a lot of headaches) but that's still a way out from being ready.

How to add media play/pause button into push notification bar?

I successfully created an apple push notification. I am receiving audio URL via push notification. I want to add media play/pause button into notification bar (custom notification bar), which functionality is that upon getting audio notification the user is able to play/pause receiving audio without opening an app.
Is it possible in iOS? I've searched through many web documents, but found nothing. So, can anyone help me out with this concept?

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.

ios5 notifications alert style

Is there any way to set the alert style for notifications via programming in ios5?
My app uses notifications that have actions and I do not want to put those notifications as banners. The flow of the app is dependent on the push notifications that arrive.
So I was finding a way by which I could set the alert style of the notifications to "Alerts" rather than "Banners". Any way to do that?
No, your app cannot control this. It is up to the user to decide how he wants your notifications to display. But why does it bother you? Clicking on the action button (aka "View") or clicking the notification itself in Center is similar in behavior regarding your app's code.

Is there a notification on iOS if a UIAlertView is shown?

Wondering if there is a notification available if a UIAlertView pops up?
Background: my app asks the user for a PIN after a period of inactivity but I would like to prevent it if an alert is on screen.
I don't want to go through my code and find all alerts and disable the PIN checker, instead a notification would be awesome. Any hope with NSNotification?
Just found the answer. It is hidden in here:
Can I get message when I show UIAlertView
If you listen to the "UIWindowDidBecomeVisibleNotification" notification, it will also fire for your own alerts, not only for system alerts.
For your own alerts, the application does not resign activiation however.