ios5 notifications alert style - notifications

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.

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.

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.

iOS : Disable Push Notifications drop down tray programatically

In my app design, I have a dropdown menu from the top as the user swipes down the top edge of the screen. This interferes with the Push notification tray. Is there any way to disable the default tray dropdown when my app is in the foreground?
Currently, there is no public API for manipulating the behavior of the notification center or how to prevent it.
I think it is a design decision to keep a consistent user experience at the price of developer freedom. I do not think it's not likely that an app will ever be able to block a notification's appearance, and only slightly less unlikely that an app would be able to prevent the notification center from appearing.
After all, it is what made iOS so successful. The consistency between the operating system and apps in general.

Can I show a UIAlertView as a banner (similar to push notifications) in iOS 5?

I am using a UIAlertView in my code in iOS5, but rather than the classic popup window with an "OK" button to exit, I'd prefer to have my alert show as a banner at the top of the screen that eventually fades away.
Is it possible to change the style of UIAlertView to resemble the iOS 5 push notification banner or does it have to be a popup window that must be dismissed manually? If not, is there any way to use the iOS5 banner notification rather than an alert notification? I don't need to send a push notification but just need to alert the user of something that happens on the server side using the app.
Not using the SDK. You'll have to design and implement that by yourself.
Have a look at:
http://cocoacontrols.com/platforms/ios/controls/mkinfopanel
http://cocoacontrols.com/platforms/ios/controls/jhnotificationmanager

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.