Is there any reason why my local notification is displayed in notification centre but not POPED up? Is there any setting to make it popup?
A local notification will be displaid as all other notifications, there is nothing you as a Developer can do about it.
The default settings for notification is to display them as a banner at the top of the screen, not like a alert view as in previous version of iOS.
Only the user can set the display style in the settings app notification section.
Related
I am working on an App which I want the Playload notification to remain presented in the banner until the user clicks on it.
I have two cases:
App in background, after opening the app (not through the notification) the notification disappears.
App in foreground, the notification will be presented on the banner (I used: UNUserNotificationCenterDelegate for that) but after few seconds it disappears.
is there a way to manage the notification duration, I want it to be presented until the user clicks on it.
This is known as a Banner Style. It can be set to either Temporary or Persistent with persistent banners requiring user interaction to disappear. You can not manipulate the duration of your notifications being displayed on screen. The banner style for the application can only be changed by the user in the notification settings for your application:
the app in background mode. when detect Ibeacon(https://developer.apple.com/ibeacon/) in background mode open popup.
I can display local-notification to the user when detect Ibeacon detect.
Is Apple allows to open popup in background-mode Swift?
lang - Swift
It is not possible as you need a ViewController or a NavigationController to show the AlertController from.
Also, it is not possible to show a ViewController from a background mode.
By now, your only option is to show LocalNotification or PushNotification and trigger the APP when the users clicks on it.
Check also this other ANSWER
Is there a way to set up how users see the push notifications alert box? My notifications are appearing without the view / cancel buttons, but i'm receiving others from different apps with those buttons. Is that a setting i should set before sending the push notification?
Thanks!
There are two things going on in your question.
First, you will see no buttons at all when you receive Apple Push Notification alerts and your screen is locked. All Apps will have just the Title and the Message of the Alert, without the buttons. If your phone is unlocked, you will see the buttons.
Second, altering the Payload, you can customize the "View" button text (or remove it) Apple Push Documentation with the "action-loc-key" key. If you set it to null, only "OK" will be presented. If you specify a value, it must be a localized string in your Application and the "View" will be replaced with that value.
Check out the docs -- as you can send the name of the "open app" button in the push notification payload. Here's apples take on it
I am working with push notifications. When I get a notification it comes with 2 button, view and close. If I click on view it opens the app and when I click the close button it does nothing but a badge number appears on the app icon. Then when I open my app again that badge number should disappear but it doesn't. How can I remove that badge number if user clicks on app icon? Thanx
put the following code somewhere in your applicationDidFinishLaunching or applicationDidBecomeActive.
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
What you could do is omit the badge key from your remote notification so that any badge number currently shown is removed. If you want a badge to show up if the user taps View, you can set a badge number using [UIApplication sharedApplication].applicationIconBadgeNumber.
But I'm not sure why you'd want to do this.
Here's the deal:
I have a navigation-based project with a menu screen as the root view. When I tap a button on the menu screen, the navigation controller pops a KalViewController onto the stack (kal calendar).
The calendar appears, and for about a 6 second period the calendar is downloading JSON data from the internet to populate the calendar with events. However, if the user taps Back (to go back to the main menu) during this time, the app crashes or the calendar continues to load the data even when I am on the main screen. (evidenced by the network activity indicator continuing to spin)
1-- I was wondering if there is any way, when I tap the Back button, to cancel that download process so that my objects will release properly? (maybe using threads??)
OR
2-- Somehow prevent the user from tapping the back button while the data is still downloading. (Similar to how a UIAlertView prevents a user from clicking anything on the screen except for 'OK' to dismiss the alert message)
PLEASE help! Thank you very much in advance!