Add "Double-Click to Continue" option with FaceID - ios

In my app I use the Apple's FaceID to confirm some actions.
I want to insert an additional step before the FaceID request is presented.
This because the FaceID appears immediately and the user doesn't have the time to read what he's going to confirm.
I saw that Apple use the approach to "Double-Click the Home button" before asking for FaceID.
I've read the Apple's docs but I didn't find any informations about this kind of API. I attached a screenshot with an example of what Apple does in its native apps.
Do you know how to achieve the same thing?

I don't believe apps have the ability to access side button presses.
If you don't want Face ID to immediately appear and authenticate, perhaps add a UIButton in-app for the user to tap before the Face ID authentication appears.

Related

Why iOS display a permission alert only for FaceID?

When I implement FaceID, I set on Info.plist the FaceID Usage Description, hence, everytime an user tries to use FaceID for the first time, iOS displays a prompt asking about FaceID permission.
But, I'm not sure why if I use Touch ID, a similar alert saying "Do you want to allow XXX to use Touch ID" does not appear asking for user permission. What it appears is an alert like this:
Is this behavior normal? Or how can I show that alert with TouchID?
This is a deliberate UX choice on Apple's part. It's having to do with the passive nature of Face ID (simply continuing to look at the device) vs. the intentional action a user takes to place their finger on the Touch ID sensor on the device. Without an interstitial asking for deliberate permission to use the feature, a user may inadvertently (successfully) authenticate with Face ID despite potentially having no intent to do so.
The behavior you detailed in your question is clearly documented in Logging a User into Your App with Face ID or Touch ID (emphasis mine):
Set the Face ID Usage Description
In any project that uses biometrics, include the
NSFaceIDUsageDescription
key in your app’s Info.plist file. Without this key, the system
won’t allow your app to use Face ID. The value for this key is a
string that the system presents to the user the first time your app
attempts to use Face ID. The string should clearly explain why your
app needs access to this authentication mechanism. The system
doesn’t require a comparable usage description for Touch ID.

How do I set the icon shown to the user for my Spotify connected app?

We've setup a Spotify developer app on Spotify, and while we can edit the name and description, I can't find anywhere that lets me change the icon / logo we show. (You just get the generic "A in a box" they provide.)
Is there a way to change this? Comparing it to Facebook or other auth services that show the user that they are setting up a connection between our app, and that it's legitimate with our icon shown.
Sorry, answered my own question - it appears that Spotify doesn't show that icon to the user with their login anyway. So that's why you can't set it.
I believe it was settable in the past, because I see that my Playstation connection has a proper icon - but they must have removed that feature.

Is it possible to have a custom dialog message when asking for notification permissions?

I would like to customize the following part of the notification permission prompt:
Notifications may include alerts, sounds, and icon badges. These can be configured in Settings.
Is it possible to change this to my own text?
You are not able to customize this message. Read Here for more information.
The recommended way that most apps handle this is by first presenting their own dialog, then show the Apple system dialog.
So when it comes time to ask the user for notification permissions, first you trigger your own custom alert that says something like "Please allow your-app-name to send you notifications..." and maybe a brief description of why the user should allow this. With this alert, only add one action to the UIAlertController, I usually just have the action title set to "Ok" and use .default as the style. In the completion handler of this "Ok" UIAlertAction that is when you will trigger the Apple system dialogue which presents the generic UIAlertController with the option for the user to either accept or deny permissions for your app to send notifications.
So the flow is something like -> users reaches point in app where they have to decide if they want to accept or deny notifications permissions -> app presents UIAlertController that is essentially just an explanation of why the app wants/needs to send notifications -> once user taps "Ok" then trigger the generic system alert that actually makes the user choose to accept or deny notification permission.
There seems to be some psychological advantage to doing it this way. By sort of forcing the user to tap "ok" to notifications in the first dialogue, it primes them to tap "allow notifications" in the generic Apple dialogue displayed immediately after.
EDIT Dec 2020 -
Alternatively what I see a lot of apps doing now is offering an "Accept" action and a "Maybe later" action in their custom alert. If the user taps accept, then the app displays the Apple system alert which allows the user to actually Accept/Deny notifications. If the user taps "Maybe later" then the app does NOT display Apple's system dialogue. This way the user never taps DENY on the Apple system dialogue and therefore the app is still allowed to show it in the future without having to make the user manually change the app's notification preferences via the iOS settings app.
EDIT Mar 2021 - (see #blackjacx comment) Apple has rejected (at least 1) app(s) for using a "priming" dialogue before showing the system alert. So that approach seems like it is no longer allowed.
For anyone who is looking for an updated answer: This is now possible using Xcode 13 (not sure exactly what version introduced it but I was able to see it on Xcode 13.4.1 and not Xcode 13.1) by setting your custom text as the NSUserNotificationsUsageDescription key in info plist file. Unfortunately at the time of writing this, it looks like Apple released this feature with no documentation on it but I can confirm it works on devices with iOS 15.4 and above!
In XCode, you can now click your App name on the left to open it's settings, click on Info, then add a new key called "Privacy - User Notifications Usage Description" -> Then you can set the value to whatever you want that message to say.
No, this is system message, you can't change to custom.
No, I'm fairly certain that that part of the message is out of your control.
I do not believe you can change the iOS prompt, but should maybe make your own. See the guidelines that Apple has provided:
https://developer.apple.com/ios/human-interface-guidelines/interaction/requesting-permission/
Not the best resource because it does state that you can change the subtext (this is specifically for location, photos, etc.) but this, and others, have some good practices:
https://blog.clevertap.com/asking-for-ios-push-notification-permissions/
Basically, you should make your own prompt. Be sure to handle the cases where they have either said no, or turned it off in settings and redirect the user to settings, if so.
Displaying Custom Messaging Before the Alert Ideally, people already know why you’re requesting their permission based on context,
but if it’s essential to provide additional details, you can display a
custom message before the alert appears.
Make it clear that opening the system alert is the only action people
can take in your custom-messaging screen. People can interpret a
pre-alert message as a delaying tactic, so it’s critical to let them
quickly dismiss the message and view the system alert. If you display
a custom screen that precedes a privacy-related permission request, it
must offer only one action, which must display the system alert. Use a
word like "Continue" to title the action; don’t use "Allow" or other
terms that might make people think they’re granting their permission
or performing other actions within your custom screen.
Guidelines here :
https://developer.apple.com/design/human-interface-guidelines/ios/app-architecture/accessing-user-data/
Just to add clarity to Uche Nkadi 's answer, add a "Privacy - User Notifications Usage Description" key in your app's Custom iOS Target Properties. This will change the message on the notification permission alert.

Swift: Home Screen Passcode

Is it possible or is there a way to make an app that automatically do something when the user has entered the wrong passcode in the home screen.? The app should do something only if the passcode is wrong. The passcode I'm talking about are the ones that the user uses to unlock the screen. Only passcode since touchIds are not working on lower versions of iPhones.
If yes, can you give a link on a documentation or maybe even a simple code so I can understand. I'm still a newbie btw. Thanks
As the previous answer has already said, Apple doesn't allow you to do anything with the passcode. This is because the developer would be able to get the passcode of the user which would be a major security breach.
On a side note, this is possible on jailbroken iOS devices, however that probably misses your point and is against Apple's guidelines anyways.
No that is not possible. That is an Apple Restriction.
Third party apps cannot have any access information on the home screen passcode actions.

Is it possible to send the user to the system settings?

If I want to send a user to the facebook settings page under "system preferences" from within my app, what is the best possible way to do that, if it is indeed possible:
A case where this is useful would be if a user is trying to use an app's SSO capabilities to register for something using their facebook account. They click to register using facebook, but no facebook account is configured on the iPhone. It would be useful to then display a UIAlertView explaining that there is no facebook account configured, and then send the user to the settings page for facebook.
Is this possible? If so, how?
Short answer, Its not possible.
There is no way to launch device default "Settings" app from within your app. All you can do is give user some instructions of how to go about and change certain settings by themselves. You can do this as either a pop-up alert message or some sort of tutorial with screenshots built in your app.

Resources