Touch ID Passcode Integration in iOS - ios

I'm working on iOS app in which I need to integrate touch id and passcode, i googled and found many tutorials for touch id, I followed this and done successfully. Every thing fine but on popup which is saying Enter Password
as shown in following pic i have few queries.
Is it possible to use apple default passcode view as shown in lock screen?
If Yes, then will apple allow to upload app onto appstore?
Looking for help.
Thanks

to hide password option try this..
var LocalAuthentication = LAContext()
LocalAuthentication.localizedFallbackTitle = "" // Add this line
tutorial which you have mentioned is using only Biometrics authentication with deviceOwnerAuthenticationWithBiometrics which Indicates that the device owner authenticated using Touch ID refer this .
If you want to authenticate with any of one (Touch id or passcode) , use deviceOwnerAuthentication instead.
replace
[context .evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics ..
with
[context .evaluatePolicy(LAPolicy.deviceOwnerAuthentication ..

We can't use Apple's default lockscreen view inside our apps, However you can use this library on github.

Related

Stop the UnityAds Cookie permission seeking

I've just added UnityAds to my app and whilst testing production I noticed instead of an ad, it popped up a request to place cookies on the users device.
The SDK integration was fine but is an absolute deal breaker for me. Is there any way to turn on a setting where it doesn't do this? I turned off the seek personalised ads request in the iOS app, I don't want my users interrupted like this. I'd like to reject all on their behalf before they see it.
Yes, you can do that. Use my following code to pass the consent flag to Unity Ads SDK. And make the Unity Ads SDK not request cookie permissions for your users by setting this flag to false
MetaData gdprMetaData = new MetaData("gdpr");
gdprMetaData.Set("consent", "false");
Advertisement.SetMetaData(gdprMetaData);
// then Setup Unity ads
For people who is using Ironsource Mediation and have Unity Ads in waterfall but having the same problem.
IronSource.Agent.setConsent(false);
Warrning: but if you do that, all ads will not be personalized. The best way I recommend to you is:
On first opening, You need to show ATT (Application Tracking Transparency) popup. Then if the user clicks Allow then you set the consent to true if the user clicks Don't allow (Require apps not to track) then you set the consent false.
by the way:
If you don't want to show ATT in the first time. You need to set consent as false until ATT shows
*** Edit *** Ok found it in Swift, posting the code for posterity - Magoo
let meta = UADSMetaData()
meta.setRaw("gdpr.consent", value: false)
meta.commit()

Xamarin forms how to log in with Apple account

I'm trying to publish my first xamarin forms app on IOS. I barred the issue of login with the Apple account.
I have 4 questions, please.
1- If I implement Sign in with Apple only for IOS 13+ will it be accepted? :(
2- I'm trying to use Xamarin Essentials to log in to IOS 13+ as shown in this article:
Xamarin Essentials
// Use Native Apple Sign In API's
r = await AppleSignInAuthenticator.AuthenticateAsync();
But I only get back the idToken. AccessToken, name and mail return null. Am I missing something?
3 - And finally I tried to use the plugin.firebaseAuth version 4.0.0-pre01:
Link plugin
// For iOS
var credential = CrossFirebaseAuth.Current.OAuthProvider.GetCredential("apple.com", idToken, rawNonce: rawNonce);
var result = await CrossFirebaseAuth.Current.Instance.SignInWithCredentialAsync(credential);
// For Android
var provider = new OAuthProvider("apple.com");
var result = await CrossFirebaseAuth.Current.Instance.SignInWithProviderAsync(provider);
It provides an example using prism to deal with this, but when I install the plugin in this version the application is no more than a splash screen and closes, without showing an error in the output. What am I doing wrong? :(
The first link seems promising for iOS less than 13 and Android using Asp.NET. However in the application I use only the Firebase ClouFirestone and Firebase Hosting for the Administrative Panel. Is it possible for me to sign in Apple without the services of a different backend?
I am very grateful for any light on the path I must follow
1- If I implement Sign in with Apple only for IOS 13+ will it be accepted?
It depends, if they don't find any other issues or violation, it will get accepted.
2- I'm trying to use Xamarin Essentials to log in to IOS 13+ as shown in this article: But I only get back the idToken.
Apple will only provide you the requested details on the first authentication. After that first authentication, you will only get the User Id so be sure to store the details that first time in case you need them.
This feature needs to be tested on a physical device running iOS 13. The simulator is not reliable, it doesn’t always work properly.
Should follow the design guidelines when implementing Apple Sign In. You can find it here: https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/

iOS Facebook Account kit - Persist user token when app is opened 2nd time after successful login

My doubt is after successful login using Facebook account kit for the first time, I am reopening the app for the 2nd time. When I open how can I detect and use the existing user Access Token?
I tried by fetching Accountkit.currentAccessToken in appdelegate as a condition to show login page or welcome page. But currentAccessToken returns me null.
I have also enabled "Enable Client Access Token Flow" in app settings.
Kindly help to understand if my approach is right.
self.accountKit = AKFAccountKit (responseType: AKFResponseType.accessToken)
if(self.accountKit.currentAccessToken != nil)
{
//SHOW WELCOME PAGE
}else{
//SHOW LOGIN PAGE
}
I am facing the same issue in Android (not in iOS) but I think the problem is same, since in the document says it so.
this is my code for configuring the login using Email (kotlin, use let to change the val).
val configurationBuilder = AccountKitConfiguration.AccountKitConfigurationBuilder(
LoginType.EMAIL,
AccountKitActivity.ResponseType.CODE)
notice that the response type is AccountKitActivity.ResponseType.CODE
In the document says:
If you began the login session with AccountKitActivity.ResponseType.TOKEN, a logout option is available to remove the stored AccessToken from the device.
So the problem is on the Response type that I use, need to be changed into AccountKitActivity.ResponseType.TOKEN in order to make the token stored on devices.
I have seen some issues with Xcode8 / iOS 10 Simulators and keychain save/retrieval. See https://forums.developer.apple.com/thread/60617
AccountKit stores the accessToken securely in the keychain but there is an intermittent bug on Xcode8 / iOS 10 Simulators that makes read/write from keychain fail.
Can you test if this is also happening on a Device?
Apparently the problem goes away if you add the Shared Keychain Entitlement to your App, but this is still a bug on Apple.

In custom iOS keyboard detect the app

How to detect in which app my custom keyboard used and show different button?
E.g. in Twitter I would add # to string I post into input field and in Reddit /r/
It is possible through following code. As you'll get bundle identifier of the app where you're using your custom keyboard.
Swift
let hostBundleID = self.parentViewController!.valueForKey("_hostBundleID")
let currentHostBundleID = String(hostBundleID)
print(currentHostBundleID);
From bundle identifier you can find app name easily.
Edit: See above. Things have changed.
This is not possible. An extension runs sandboxed and is only fed information from the API and cannot access anything else. The keyboard can only receive text context changes and activate/deactivate calls. Being able to detect an app lies outside of the extension sandbox and therefore is impossible.

"Login cancelled by player" callback in facebook api for Unity IOS (only if you have facebook app in device)

I am using unity facebook api 4.3.6 for ios. Its working perfectly fine if I don't have #facebookapp in my device. Once I download it and try login, it takes me to #facebookapp and redirect again to my game with callback
FB Login callback : {"is_logged_in":false, "user_id":"", "access_token":""}
Login cancelled by player
This happens only if I have facebook app downloaded! I think its some how cache issue but not sure exactly what is it. Any luck?
I believe this is not connected with Unity.
Here is few reasons I faced
You need to ask read and write permissions separately. Wait until you get read permissions than send request for write permission.
Make sure your app is allowed to login ( if you have FB app installed on your device )
Make sure you have your app bundle identifier added to developer.facebook.com
Here is what helped me fixed that problem with Unity Facebook-Android.
setting the sandbox mode ON:
Go to https://developers.facebook.com/apps
Select the respective app from the drop down.
Go to 'Status & Review' from the table in the left side of the page.
Do you want to make this app and all its live features available to the general public? - Select switch to set YES/NO value.
if the ON/OFF button is disable, please go back to Settings and enter a valid email address.
I understood why when the device is installed a facebook app, my app can't login facebook.
First : software OpenSSL create keyhass wrong. I have downloaded OpenSSL from here : http://code.google.com/p/openssl-for-windows/downloads/list , and it creates keyhash wrong.
I have used other OpenSSL sofware, you can download it here : https://www.dropbox.com/sh/t6tt44dc2nm6vza/6mp1W74GiZ , it is create keshash right.
Second: In class FacebookAndroidUtil.cs , line 62, you add System.Environment.GetEnvironmentVariable("HOMEDRIVE") before System.Environment.GetEnvironmentVariable("HOMEPATH"). Facebook SDK requires a file debug.keystore in : C:\Users\UserName.android\debug.keystore.
If the Unity Editor, Edit Setting Facebook has yet to create android debug hash key. Then use the Eclipse Software, create and run onr any project. Eclipse will generate a debug.keystore. If it is't create in folfer : C:\Users\UserName.android\debug.keystore , then find it, coppy and paste into C:\Users\UserName.android\debug.keystore
Third: publish your app in Facebook, so be sure it is:"This app is public and available to all users".

Resources