3. FID Authentication
3.1 FTSDKAuthDelegate
Before using Authentication functions, please make sure you have implemented FTSDKAuthDelegate
Asign delegate instance:
3.2 Sign In & Sign Up
After implement FTSDKAuthDelegate
, you can start call Sign In
or Sign Up
To show Sign In & Sign Up
dialog, call:
Multiple authentication methods provided by FID:
Change Product Name when login with Google & Facebook
When you use login with Google/Facebook, you will see "XXX" want to use facebook.com to....
If you want to change the text "XXX", please go to Build Setting, search "product name" then change the value to anything that you want.
And remember to add config to your Info.plist
Setup login with Facebook
You will need Facebook App ID and Facebook Client ID Token (We will give you)
Add new configs to your Info.plist
FacebookAppID
FacebookClientToken
FacebookUrlSchemeSuffix (optional)
Go to your Target -> Info and add new URL Types:
fbxxx (xxx is FacebookAppID)
Setup login with Google
You will need GoogleService-Info.plist file (We well give you)
Drag file to your project, remember check Copy If Need option and choose Target
Go to your Target -> Info and add new URL Types:
com.googleusercontent.apps.xxx-yyy (You can find it in GoogleService-Info.plist file)
Setup login with Apple
By default, when we give you certificate and profile, it will include InApp-Purchage and SignIn with Apple capability
You need add some Capability to enable functions:
In-App Purchase
Sign in with Apple
Setup Dynamiclink for KOLs
You will need setup some Associated Domain and deeplink, we will give you
3.3 Forgot Password
When user use Phone Number and Password, if forgot, they can change password by SMS OTP, just click ForgotPassword
on Sign In & Sign Up
dialog
3.4 Link Account
If a user is using a third-party login such as Apple, Google, Facebook, or PlayNow, we suggest linking their account with a phone number.
Before call link account, you need implement FTSDKLinkAccountDelegate
first:
Asign delegate instance:
Start link account:
3.5 Sign Out
Call Sign Out
with callback:
3.6 Refresh Token
FID employs JWT for authorization, whereby the accessToken
has a shorter lifespan than the refreshToken
.
Additionally, FID automatically calls for a refresh token each time the user accesses the app/game and automatically retries when the accessToken
has expired.
However, when utilizing FID's accessToken
, it is crucial to take into account its lifespan.
It is advisable to attempt a refresh token call before requesting APIs with FID's accessToken
to ensure that it has not expired.
3.7 Get User Information
Following a successful login, you can obtain user information at any point by simply making a call to:
3.8 Change User Password
Following a successful login, you can allow user change their password by simply making a call to:
3.9 Auto Login
By default, FID will request auto login everytime user open app, but if you want to disable auto login, you can use setting when config SDK:
Then, you can manual check SDK is authorized with:
Last updated