How many actions can be added to an iOS push notification? - ios

What is the maximum number of actions that can be associated with a push notification and still show up on the lock screen? For example, in this picture, there are two actions. Is it possible to put more than that?

NO
banner、lock screen、notification center up to 2 actions
notification alert up to 4 actions
See:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/NotificationCenter.html

Related

What is the maximum number of UNNotificationActions?

What is the maximum number of UNNotificationActions a user can see and interact with when force pressing on a notification?
It's pretty clear:
A notification can display up to four actions onscreen at once, and in
some cases may display only two of those actions.
From Apple's Documentation

IOS locked screen notification

Is it possible to get three options when you swipe to the left on the lock screen as yes no and cancel in iPhone when the screen is locked..
For example as shown in API for swiping to the left on lock screen - iOS 8
Seems that the lock screen can have max 2 button:
In iOS 8 and later, the lock screen, notification banners, and
notification entries in Notification Center can display one or two
custom actions.
If the alert is displayed modally you can use more:
Modal alerts can display up to four. When the user
selects a custom action, iOS notifies your app so that you can perform
the task associated with that action.
But there is no way to fore this.
Read the full spec in Registering Your Actionable Notification Types

iOS8 APNs,cancel a notification from notification center

I need to cancel a notification from the notification center on iOS8.
You need at least 10 reputation publish pictures, but you can look at the two pictures in the following URL to see what I mean: http://www.cocoachina.com/bbs/read.php?tid-307533.html. Image one has two notifications, but in image two 未接来电(4) has been 未接来电(5).
I know the cancelAllLocalNotifications API, but how can I cancel a single notification in iOS8 new api?

Questions about Local notifications in iOS

I'm working on a project on iOS 7, 8 that use a lot of notifications (Remote, Local). I have some questions about Local Notification.
I'm using Local Notification to schedule an alarm or a count-down. As I know, the use of NSTimer is not really a good choice since it has only up to 10' in background & if the app process is killed it doesn't work anymore. Local Notification is managed by iOS but I have to accept its alert when the app is not in foreground. There's nothing like silent local notification (local notification without alert, sound or badge and app still knows about it although it's in background). Am I right ?
Let's assume that there're some simple local notifications in Notification Center, scheduled by our app. Normally when I touch on a notification to see it in my app, the others remain present until we interact with them. In some cases that I haven't figured out, all other notifications are removed from the Notification Center. Does anyone encounter this & understand why ?
I find the interactive notification feature in iOS very limited. I want to change the title of a defined UIMutableUserNotificationAction button & add an image for it, like I can do with UIButton. So the question is : Is it possible to customize the UI of an action button ?
Thanks for your help !
Unfortunately there is no correspondence in silent notification using local notifications.
The number of the visible notification in the notification center is a user decision, the user in Settings can decide to set a different number or decide to do not show them in notification center as well. As for the first point no. The third point is not clear, you can set the image you want for a remote just put in the payload the right name, local notifications use the app icon.
There is no silent notification for Local Notification. The user has to click to the notification to open your App.
I suppose that the associated application has deleted those notifications programmatically. Else, those notifications must stay in the notification center.
You cannot add image to action buttons but just the titles.
I tried more than two weeks to do the same. I had to show notification after 2 hrs even if the use doesn't click the notification. But the repetition facility is well handled in objective C. I could have created multiple local notification but it will also violates the total number of 64 notifications. Apple needs to improved the same.

Actionable Notification- 3rd action/button not working

Is there a way to add third button in Interactive Notification,
I followed this: https://nrj.io/simple-interactive-notifications-in-ios-8
and was able to make 2 button for accept and reject and when I add
for 3rd button similar way, it doesn't not show up.
From Apple's documentation:
In iOS 8 and later, user notifications can have additional custom
actions. Two actions can be displayed on the lock screen, in a banner,
and in Notification Center. In modal alerts, notifications can display
up to four actions when the user taps the Options button.
On the lock screen and in notification center, only the first two actions will be shown. If you include additional actions (up to 4) they will be shown in modal alerts.
Note: This does not apply to the actionable notifications apple recently introduced for WatchKit which allows up to 4 that will always been shown on the Apple Watch.

Resources