IOS locked screen notification - ios

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

Related

Notification/Widget on lock screen with button in Swift

I have an app that contains stopwatch and when time is running and the app enters background I would like to have a notification on lock screen and in Notification Center (when you swipe down). The notification should contain actual time of the stopwatches and user should be able to stop/start the stopwatches.
I was trying to achieve this using UNNotificationContentExtension but as documentation says:
When an iOS device receives a notification containing an alert, the system displays the contents of the alert in two stages. Initially, it displays an abbreviated banner with the title, subtitle, and two to four lines of body text from the notification. If the user presses the abbreviated banner, iOS displays the full notification interface, including any notification-related actions. The system provides the interface for the abbreviated banner, but you can customize the full interface using a notification content app extension.
I found out that I am able to edit just full notification interface which means that when user gets notification and opens it I can show him whatever I want (I tried mediaPlayPauseButtonType to handle stopwatches). But when I check the lockscreen the notification stays default.
What are the possibilities to achieve Notification similar to Spotify - when you play song, you can pause the song and you can see the time etc. from the lockscreen?
Thanks!

iOS 10 local notifications: show notification content on lock screen

I've added local notification with Notification Content Extension.
It shows okay on home screen (with app in background).
The problem lies in displaying notification content on lock screen. When notification arrives on lock screen, it is only displayed with text and swiping left shows "Clear" button.
I need some way to show notification fully from lock screen (as on home screen).
For example I saw "View" button in some of the tutorials/articles, can I even create or control something like it?
So with notifications on iOS 10, Apple changed the way they appear on devices. When the screen is locked, you can see a View and Clear button or just clear button based on whether the device is enabled with 3D touch or not.
Swiping left on a message now offers View and Clear on non-3D Touch devices or just Clear on 3D Touch devices.
On 3D Touch devices, the long press on notification reveals the notification actions menu which can be customized using Category definition in the code.
Hope this answers your query.

Is there any way to change notification image

i want to show or change present image in notification with latest image icon, the image icon will be provided either in the notification data or saved previously in the app like this one and this one image
i want that if notification came on the IOS device then the image in the notification will show accordingly
this text from iOS Human Interface Guidelines
A banner is a small translucent view that appears onscreen and then disappears after a few seconds. Users can also see a version of the banner on the lock screen and in the Notifications view of Notification Center. In the banner, iOS displays your notification message and the small version of your app icon (to learn more about the small app icon, see App Icon). Users tap the banner to dismiss it and switch to the app that sent the notification.
I believe that you can't change it, but may be if you change some pictures in App icon source, you will achieve the necessary result, but I repeat, hardly everything will correctly work
for example
U can try to change Spotlight images or any else....

Button accesible from lock screen in iOS

I want to develop an iOS app that can have like a panic button when the screen is locked. This button can be enable or disabled within the app, but
I want to know if it is possible to add a very accessible button you can press in case of an emergency even when the screen is locked. When the button is pressed I want to execute some code in the app.
Is there a possible way of accomplishing this in iOS?
Or is there an alternative?, The only think that I required is that the button can be pressed like in maximum three seconds even if the screen is locked and the app closed.
No that is not possible in iOS. You cannot make changes outside of your app.
One suggestion i can give you is to make a extension for today view in notification center. And you can ask the users to touch the button in notification center to invoke your functionality.
Notification center can be accessed in lock screen also.

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