5. FID Instance & Configs
5.1 Check User Have Logged In With FID
[FTSDKSignIn instance].isLoginFID
5.2 Get User's Info Cached
// After successful login, you can get user information cached in local via:
FTSDKAppData *data = [[FTSDKAppDelegate instance] getAppData];
// User profile
FTSDKProfileData *profile = data.profile;
// User authentication
FTSDKAuthentication *auth = data.authentication;
// Player info
FTSDKPlayerInfo *player = data.playerInfo;j
5.3 Check User Account Linked
Link Account button only visible when user is not valid
if ([[FTSDKAppDelegate instance] getAppData].isValidUser) {
}
5.4 Check User Just Sign Up
True if user just successful signup in 5 seconds
if ([[FTSDKAppDelegate instance] getAppData].user.isJustSignUp) {
}
5.5 Embbed QA Float Button
FID provider a Float Button for Q&A functions, use this code to show it, remember FID avaiable before call
- (void)onFTSDKIsReady {
[FTSDK showQAButton];
}
5.6 Player Information
Depending on your discussion and FTech, the fields related to Server and Character can be name or ID
You should call this function after the player selects the Server and creates the Character
[[FTSDKPurchase instance] setPlayerInfoWithGameServer:"Server Name or ID" nickName:"Character Name or ID"];
5.7 Gift Code Handle
To enable users to receive a gift code when they scan a QR code, FID use Appsflyer Onelink feature to handle the process. To implement this functionality, please add the following code snippet:
// Implement FTSDKGiftCodeDelegate on your AppDelegate file
// Gift code delegate, add before `FTSDK.didFinishLaunching`
[FTSDKGiftCodeHandle instance].delegate = self;
// Setting analytics configs
[FTSDK didFinishLaunching:application with:launchOptions];
/// MARK: FTSDKGiftCodeDelegate
- (void)onReceiveGiftCodeWithGiftCode:(FTSDKGiftCode * _Nonnull)giftCode {
// You can save this giftcode to use later
NSString *code = giftCode.code; // Gift code: exp CODE00001
NSString *content = giftCode.content; // Message to show in dialog
}
Remember to add URL Types for deeplink, we will send you
5.8 Playnow Account Not Linked
If App/Game require link account for play now account before make an In App Purchase, you can use this function:
if ([[FTSDKSignIn instance] isPlaynowAccountNotLinked]) {
// If YES, call linkAccount
[[FTSDKSignIn instance] linkAccount];
}
Make sure you have checked user has logged in before use it
5.9 Tracking
FID support send event tracking with Firebase Analytic and Appsflyer, we have already setup all, you just need to call:
[[FTSDKTracking instance] logEvent:@"event_name"];
// Or with some params
[[FTSDKTracking instance] logEvent:@"event_name" params:@{@"key": @"value", @"key2": @"value2"}];
Remember to request ATT prompt for iOS 14+ tracking, you can use this code:
[[FTSDKTracking instance] requestTrackingAuthorization];
You can call this before call request notification permission or wait response from request notification permision callback before call, this will avoid bug ATT not show first time open app
Last updated