Open unlock screen when displaying notification content extension - ios

In my iOS/iPadOS app I have notification content extension, which presents extended content in WKWebView. However, when started on lock screen, WKWebView does not load data properly. Therefore, I would like to ask user to unlock the device before displaying content. This is how Apple Mail does that - when selecting (long-pressing) notification banner on lock screen, it presents unlock screen (Passcode screen) before displaying content.
Question:
Do you know, how to do that? Is there any API to present unlock screen programmatically?

Related

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.

Monitor content displayed on iPhone's screen

I want to monitor the iPhone's screen in background, whenever the content displayed on the phone window was changed, the app will send out a notification.
For example, if I open Stack Overflow in Safari, when the page is loading or some Flash on the page is animating, I will receive the notification. But I don't know how to detect the event.

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

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....

How to identify if a user has locked the screen in an iOS 5 app

Our iOS app has its own passcode screen which is displayed to the user each time the application loads.
An additional requirement is that the passcode screen should be displayed if the user locks the screen. Initially I have used the applicationWillResignActive method within the app delegate to set the passcode view as a modal. I'm setting it on resign rather than applicationDidBecomeActive so that when iOS makes our app visible again you don't see a quick switch between views.
This works fine for when the user locks the screen but resignActive is also called when an SMS alert is recieved, which means that even if the user dismisses the notification they are asked to enter their passcode again.
Is there a way to work out if the screen has been locked, so I can respond specifically to that event?

Resources