Skip to content

iOS Integration Documentation

Resource Downloads and Description

Common Resources (required)

You must import all resources from the access_core folder located inside the ios_platform_sdk into your project. These are basic and . Payment Sequence Diagram

Module Resource Description

Domestic SDK Modules

  • libplatform-account-sdk.a —— Account Module - Core component of the SDK,Account Module
  • libplatform-block-account.a —— Domestic Login Module,Domestic Login Module
Objective-C
libplatform-pay-sdk.a —— Payment module
libplatform-applelogin.a —— Apple login module
libplatform-wechatlogin.a —— WeChat login module
libplatform-qqlogin.a —— QQ login module
libplatform-crashsight.a —— CrashSight module
libplatform-bugly.a —— Bugly crash reporting module
libplatform-qqshare.a —— QQ sharing module
libplatform-wechatshare.a —— WeChat sharing module
libplatform-appsflyer.a —— AppsFlyer module
libplatform-analysys.a —— Fangzhou module

Overseas SDK Modules

libplatform-account-sdk.a —— Account module (Core SDK module, ) Domestic Login libplatform-global-account.a —— Overseas login module () Domestic Login

Objective-C
libplatform-alhelpservice.a —— Customer support module
libplatform-analysys.a —— Fangzhou module
libplatform-applelogin.a —— Apple login module
libplatform-appsflyer.a —— AppsFlyer module
libplatform-cloudlogproducer.a —— Network reporting module
libplatform-crashsight.a —— CrashSight module
libplatform-facebooklogin.a —— Facebook login module
libplatform-facebookshare.a —— Facebook sharing module
libplatform-firebase.a —— Firebase module
libplatform-googlelogin.a —— Google login module
libplatform-openinstall.a —— OpenInstall module
libplatform-pay-sdk.a —— Apple Pay module

Module Import and Configuration Instructions ()

  • Before importing the modules, make sure to set accesssdk+channelId in your project under Info -> URL Types -> URL Schemes, otherwise initialization will fail!
  • You need to obtain the channelId from the operations team.

Import Configuration

Note:

If you are integrating both the QQ login module and the QQ share module, you only need to import one of their corresponding libs folders.The same applies to WeChat login & share modules and Facebook login & share modules.

In the Info.plist, set the permission for View controller-based status bar appearance to YES.

info

SDK Integration Environment Setup

Import the system frameworks.

Please add the following system Frameworks in your game project

Objective-C
StoreKit.framework
WebKit.framework
Network.framework
SystemConfiguration.framework
AppTrackingTransparency.framework
AdSupport.framework
CoreTelephony.framework
iAd.framework
AdServices.framework
libz.tbd
libc++.tbd
libresolv.tbd

Note:

If you are integrating the domestic login module libplatform-block-account.a, you must also import the third-party libraries it depends on.

:::

Import Common Resources into the Project

How to import common resources:

Drag the common resource folder into the project panel. In the popup dialog, follow the selection in Figure 1-1. (Recommended: check “Copy items if needed”)

Import Configuration File

  • Filename: access.config
  • How to import the config file: Same as for importing common resources.
  • The resources should be obtained from the operations team

Project Parameter Configuration

  • In the Info.plist file, add the following configuration (used to request permission to access the IDFA): Description (typical): "GameName would like to access your device's identifier (IDFA) for advertising tracking." Example:
  • Click the project target, go to the Build Settings tab, search for Other Linker Flags, double-click it, then click the + (plus) sign, and add -ObjC. If it has already been added, you need not add it again. The result should look like Figure 1-2
  • In Info.plist, add:Privacy - Photo Library Additions Usage Description,Type: String,Value: Will access your photo library
  • In Info.plist, add:Privacy - Photo Library Usage Description,Type: String,Value: Will save screenshots to your photo album
  • To support HTTP network access, configure the following in Info.plist: Add a new key: App Transport Security Settings Type: Dictionary Inside it, add: Allow Arbitrary Loads Type: Boolean Value: Yes

AccessCore SDK Basic Functionality

After configuring the integration environment, importing the SDK libraries and configuration files, you can begin integrating the SDK features.

Note:

SDK interfaces are shared between domestic and overseas modules. If marked as "(Overseas)," the function can only be used in the overseas version and has no effect in the domestic version.

SDK Initialization

Import the SDK header file:

Objective-C
#import <platform_core_sdk/platform_core_sdk.h>

In AppDelegate.h, inherit from AccessCoreAppDelegate, as shown below:

  • SDK Initialization Requirements The delegate must implement the following protocols as needed: HLSystemDelegate HLPaymentDelegate HLAccountDelegate HLShareCallback Callback interfaces should be integrated according to your needs. Specific implementation methods will be described later.
Objective-C
@interface SDKDelegate : AccessCoreAppDelegate<HLSystemDelegate, HLPaymentDelegate, HLAccountDelegate, HLShareCallback>
@interface AppDelegate ()
@end

@implementation SDKDelegate 
@synthesize window;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 
   self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = [UIColor whiteColor]; self.window.rootViewController = [[DemoController alloc]init]; [self.window makeKeyAndVisible];
      
   [AccessCoreSdk shareAccessCoreSdkManage].systemDelegate = self; [AccessCoreSdk shareAccessCoreSdkManage].paymentDelegate = self; [AccessCoreSdk shareAccessCoreSdkManage].accountDelegate = self; [AccessCoreSdk shareAccessCoreSdkManage].shareDelegate = self;
   
    return [super application:application didFinishLaunchingWithOptions:launchOptions]; 
}

Delegate Callback Methods

Objective-C
@protocol HLSystemDelegate <NSObject>

/** 
 * Initialization succeeded 
 */
- (void)initSuccess:(AccessInitResult *)initResult;

/** 
 * Initialization failed 
 */
- (void)initFailed;

@end

@protocol HLPaymentDelegate <NSObject>

/** 
 * Payment succeeded 
 */
- (void)paySuccess;

/** 
 * Payment failed
 * @param error Error information 
 */
- (void)payError:(NSError *)error;

@optional
/** 
 * Retrieved product information
 * @param info Product information 
 */
- (void)payGoodsList:(NSArray<AccessGoodsInfo *>*)info;

/** 
 * Failed to retrieve product information 
 */
- (void)payGpodsListFail;

@end

@protocol HLAccountDelegate <NSObject>

/**
 * Login succeeded
 * @param accountInfo Login success information
 */
- (void)loginSuccess:(AccessLoginInfo *)accountInfo;

/**
 * Successfully switched to a sub-account
 * @param refreshAccountInfo Login success information
 */
- (void)refreshUser:(AccessLoginInfo *)refreshAccountInfo;

/**
 * Login failed
 */
- (void)loginFailure;

/**
 * Logout
 */
- (void)logout;

@end

@protocol HLShareCallback <NSObject>

/**
 * Share succeeded
 */
- (void)shareSucceeded:(BOOL)result;

/**
 * Share failed
 */
- (void)shareFailed:(BOOL)result;
  • AccessInitResult Properties
Objective-C
@property (nonatomic, strong) NSString *channel; // Channel
@property (nonatomic, assign) int gameId; // Game ID
@property (nonatomic, assign) int channelId; // Channel ID
  • AccessLoginInfo Properties
Objective-C
@property (nonatomic, assign) long long uid; // User ID
@property (nonatomic, strong) NSString *accessToken; // User authorization token
@property (nonatomic, strong) NSString *channel; // Channel
@property (nonatomic, strong) NSString *channelUid DEPRECATED_MSG_ATTRIBUTE("This property is deprecated~"); // Channel user ID
@property (nonatomic, strong) NSString *serverArea; // Region

@property (nonatomic, strong) NSMutableDictionary *extendInfo; // Extended parameters

Lifecycle Method Implementation

To implement the SDK Lifecycle Method, you must override the method and call the superclass implementation:

Objective-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

- (void)applicationWillResignActive:(UIApplication *)application { 
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 
    [super applicationWillResignActive:application]; 
}

- (void)applicationDidEnterBackground:(UIApplication *)application { 
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 
    [super applicationDidEnterBackground:application]; 
}

- (void)applicationWillEnterForeground:(UIApplication *)application { 
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 
    [super applicationWillEnterForeground:application]; 
}

- (void)applicationDidBecomeActive:(UIApplication *)application { 
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    [super applicationDidBecomeActive:application]; 
}

- (void)applicationWillTerminate:(UIApplication *)application { 
    [super applicationWillTerminate:application];  
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { 
    return [super application:app openURL:url options:options]; 
};

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { 
    [super application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; 
}

-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { 
    [super application:application didReceiveLocalNotification:notification]; 
}

- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { 
    [super application:application didRegisterUserNotificationSettings:notificationSettings]; 
}

- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler{
    [super application:application handleActionWithIdentifier:identifier forRemoteNotification:userInfo completionHandler:^{ 
    }]; 
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 
    [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; 
}

- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err { 
    [super application:app didFailToRegisterForRemoteNotificationsWithError:err]; 
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { 
    [super application:application didReceiveRemoteNotification:userInfo]; 
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { 
    [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; 
}

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{ 
    [super application:application supportedInterfaceOrientationsForWindow:window]; 
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler{ 
    return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; 
}


### SDK Login Interface
```Objective-C
/** 
* Login
*/
- (void)login;
[[AccessCoreSdk shareAccessCoreSdkManage] login]; // This interface will trigger the login callback. Note: The login interface cannot be called twice without logging out to avoid multiple callbacks in the game.

SDK Logout Interface

Objective-C
/**
* Logout
*/
- (void)logout;
[[AccessCoreSdk shareAccessCoreSdkManage] logout];
Note: After successful logout, a logout callback will be triggered. (Not valid for the overseas SDK.)

SDK Reporting Interface

Objective-C
/**
* Report user information to the SDK
* @param type The type of data being reported
* @param info The user information, cannot be empty
*/
- (void)report:(EventType)type data:(AccessPlayerInfo *)info;
- (void)setUserExtDataType:(EventType)type data:(AccessPlayerInfo *)userExtData DEPRECATED_MSG_ATTRIBUTE("Please use -report:info:");

/**
* Custom data reporting
* @param action The event name, cannot be empty or null
* @param gameinfo The extended information to be reported
*/
- (void)gameDataReport:(NSString *)action withGameInfo:(NSMutableDictionary *)gameinfo DEPRECATED_MSG_ATTRIBUTE("Please use AccessPlayerInfo Class for custom reporting.");
Objective-C
AccessPlayerInfo *model = [AccessPlayerInfo new];
model.zone_id = @"12312";  // Zone ID
model.zone_name = @"Zone Test";  // Zone Name
model.server_id = @"11212";  // Server ID
model.server_name = @"Server Name Test";  // Server Name
model.role_id = @"229";  // Role ID
model.role_name = @"Test Group";  // Role Name
model.role_level = @"10";  // Role Level
model.party_name = @"Party 10";  // Party Name
model.vip = @"100";  // VIP Level
model.balance = @"200";  // Balance
model.extene_action = @"test_action";
[model addExtra:@"intKey" intValue:55];
[model addExtra:@"longLongKey" doubleValue:66786658787676];
[model addExtra:@"stringKey" NSStringValue:@"Hello111"];
[model addExtra:@"test1" NSStringValue:@"11"];
[model addExtra:@"test2" NSStringValue:@"22"];
[model addExtra:@"test3" NSStringValue:@"33"];
[model addExtra:@"gameResourceUrl" NSStringValue:@"tcp@github.com@9988"];
[model addExtra:@"gameLoginServerUrl" NSStringValue:@"http@platforrrrm.hoolai.com/test/index@9900"];
[model addExtra:@"gameServerUrl" NSStringValue:@"https@191.45.90.89@8087"];
[model addExtra:@"userLogo" NSStringValue:@"https%3A%2F%2Fimg2.baidu.com%2Fit%2Fu%3D3172931140%2C714963860%26fm%3D253%26fmt%3Dauto%26app%3D138%26f%3DJPEG%3Fw%3D500%26h%3D500"];
[model addExtra:@"action11" NSStringValue:@"222"];
[model addExtra:@"44" intValue:55];
[[AccessCoreSdk shareAccessCoreSdkManage] report:<EventType> data:model];
  • AccessPlayerInfo Class Parameters and Methods:
Objective-C
@property (nonatomic, strong) NSString *server_name; // Server Name
@property (nonatomic, strong) NSString *zone_id; // Zone ID
@property (nonatomic, strong) NSString *zone_name; // Zone Name
@property (nonatomic, strong) NSString *server_id; // Server ID
@property (nonatomic, strong) NSString *role_id; // Role ID
@property (nonatomic, strong) NSString *role_name; // Role Name
@property (nonatomic, strong) NSString *role_level; // Role Level
@property (nonatomic, strong) NSString *party_name; // Party Name
@property (nonatomic, strong) NSString *vip; // VIP Level
@property (nonatomic, strong) NSString *balance; // Balance
@property (nonatomic, strong) NSString *phylum; // Category/Step
@property (nonatomic, strong) NSString *classfield; // Behavior Result
@property (nonatomic, strong) NSString *extene_action; // Action Name

@property (nonatomic, strong, readonly) NSString *extra DEPRECATED_MSG_ATTRIBUTE("Please use addExtra: for custom reporting."); // This property stores extended information in the format of a string like:@"key:value,key:value,..."


/** 
 * Custom data reporting 
 * @param key Event name, must not be nil or empty 
 * @param val Reported value (int)
 */
- (void)addExtra:(NSString *)key intValue:(int)val;

/** 
 * Custom data reporting 
 * @param key Event name, must not be nil or empty 
 * @param val Reported value (double)
 */
- (void)addExtra:(NSString *)key doubleValue:(double)val;

/** 
 * Custom data reporting 
 * @param key Event name, must not be nil or empty 
 * @param val Reported value (NSString)
 */
- (void)addExtra:(NSString *)key NSStringValue:(NSString *)val;

>- Please use AccessPlayerInfo with addExtra: for custom data reporting. Code examples below:
```Objective-C
AccessPlayerInfo *model = [AccessPlayerInfo new];
[model addExtra:@"intKey" intValue:55];
[model addExtra:@"longLongKey" doubleValue:66786658787676];
[model addExtra:@"stringKey" NSStringValue:@"Hello111"];
model.extene_action = @"test_open_app";
[[AccessCoreSdk shareAccessCoreSdkManage] report:ACCESS_CUSTOMER_ACTION data:model];

Payment Interface

Objective-C
/**
 * Get product information
 */
- (void)queryGoodsInfo;

/**
 * Start a payment
 */
- (void)pay:(AccessBeginPayInfo *)goodsModel;

>Note: The callback for the queryGoodsInfo method is handled via the HLPaymentDelegate.
Objective-C
@optional 
/**
 *  Retrieve product list information
 * @param info Product information 
 */
- (void)payGoodsList:(NSArray <AccessGoodsInfo *>*)info;

/** 
 * Failed to retrieve product information 
 */
- (void)payGpodsListFail;
  • AccessGoodsInfo Properties
Objective-C
@property (nonatomic, strong) NSString *region; // Region
@property (nonatomic, strong) NSString *currency; // Currency
@property (nonatomic, strong) NSString *symbol; // Currency symbol
@property (nonatomic, strong) NSString *itemId; // Product ID
@property (nonatomic, strong) NSString *itemName; // Product name
@property (nonatomic, strong) NSString *itemCount; // Quantity
@property (nonatomic, strong) NSString *itemPrice; // Price
@property (nonatomic, strong) NSString *showTag; // Display tag (formatted price)
  • The pay: method should be passed an instance of AccessBeginPayInfo, which includes the following properties:
Objective-C
@property (nonatomic, assign) int price; // Price
@property (nonatomic, strong) NSString *finalPrice DEPRECATED_MSG_ATTRIBUTE("This property is deprecated~"); // Payment price
@property (nonatomic, strong) NSString *productIdentifier; // Product ID
@property (nonatomic, strong) NSString *currencyLocale; // Currency region/locale
@property (nonatomic, strong) NSString *payChannel DEPRECATED_MSG_ATTRIBUTE("This property is deprecated."); // Payment channel
@property (nonatomic, strong) NSString *gameInfo; // Game-related information
@property (nonatomic, strong) NSString *notifyUrl; // Callback URL

CDK Interface

Objective-C
/**
 * Access the CDK interface
 * @param activityType Type of activity
 * @param activityDataType Instance of AccessActivityDataInfo, containing the required CDK code
 */
- (void)accessParticipate:(ACTIVITY_TYPE)activityType ActivityDataType:(AccessActivityDataInfo*)activityDataType;
  • Parameters Required for CDK ACTIVITY_TYPE Enumeration
Objective-C
typedef enum _ACTIVITY_TYPE {
    ACCESS_NO_ACTIVITY = 0, // No activity
    ACCESS_CD_KEY,          // CDK type
} ACTIVITY_TYPE;
  • AccessActivityDataInfo Attributes:
Objective-C
@interface AccessActivityDataInfo : NSObject
@property (nonatomic, strong) NSString *code;
@end

Sharing Interface

Objective-C
/**
 * Note: Only one sharing mode can be selected at a time.
 * Text and image cannot be shared together (except for the Dongqiudi share type).
 * Create an AccessShareInfo object and assign values to its corresponding properties.
 *
 * @param type The sharing platform type (THREE_SHARE_TYPE)
 * @param object The content to be shared
 */
- (void)shareType:(THREE_SHARE_TYPE)type shareObject:(AccessShareInfo *)object;
  • AccessShareInfo Properties Note: The Dongqiudi sharing method does not have any related delegate callbacks.
Objective-C
typedef enum _THREE_SHARE_TYPE {
ACCESS_SCENESESSION = 0, // WeChat Friends
ACCESS_SCENETIMELINE, // WeChat Moments
ACCESS_SCENEQQTOSESSION, // QQ Friends
ACCESS_SCENEQQTOQZONE, // QQ Zone
ACCESS_DONGQIUDI, // Dongqiudi
ACCESS_FACEBOOK_LINK, // Facebook Link Sharing (Overseas)
ACCESS_FACEBOOK_IMAGE, // Facebook Image Sharing (Overseas)
ACCESS_FACEBOOK_VIDEO, // Facebook Video Sharing (Overseas)
ACCESS_APPLE_SHARE // Apple Share (Overseas)
} THREE_SHARE_TYPE;
Objective-C
@interface AccessDongQiuDiShare : NSObject
@property (nonatomic, strong) NSString *circleID; // Circle ID
@property (nonatomic, strong) NSString *title; // Title
@property (nonatomic, strong) NSString *content; // Content to be shared
@property (nonatomic, strong) NSString *scheme; // App scheme for redirection
@property (nonatomic, strong) NSArray<NSString *> *assetIDs; // Paths to images or videos (from gallery)
@end

@interface AccessShareInfo : NSObject
@property (nonatomic, strong) NSString *title; // Title
@property (nonatomic, strong) NSString *imagePath; // Path to image or video
// Note: 
// - For Facebook photo sharing, the image size must be less than 12MB.
// - For Facebook video sharing, the video size must be less than 50MB.
@property (nonatomic, strong) NSString *linkPath;  // Link to be shared

@property (nonatomic, strong) AccessDongQiuDiShare *shareDongQiuDi; // Dongqiudi Sharing
@end

Open Account Management Center (Overseas)

Objective-C
/*
 * Opens the account management center (for overseas users)
 */
- (void)openAccountCenter;

Open Customer Service Center (Overseas)

Objective-C
/*
 * Opens the customer service center (for overseas users)
 */
- (void)openService;

Required Modules for Domestic Version

Apple Pay Module

Import the libplatform-pay folder.

Configure the relevant Apple Pay login permissions. Set Apple login options in the project as shown:

CrashSight Module

Import the access_crashsight folder.

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)
  • Add the following dependent libraries: SystemConfiguration.framework
  • Security.framework
  • libz.dylib or libz.tdb
  • libc++.dylib or libc++.tdb (optional, only if needed to prevent errors)

Integration Result Testing
a. Enable Debug Mode. Initialize CrashSight and provide the appropriate configuration parameters.
b. Network Reporting. Check the test device logs to verify if the following logs appear: "begin to upload <CSAnalyticsLogic" or "cmd: 641"
c. Crash Capture. Check the test device logs to verify if the following log appears: "Handle the crash scene in callback"
d. Exception Reporting. Check the test device logs to verify if the following logs appear: "begin to upload <CSCrashLogic" or "cmd: 631"

Apple Sign-In Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)
  • Configure the relevant Apple login permissions. Set Apple login options in the project as shown:

System Dependency Libraries to Add

  • AuthenticationServices.framework

QQ Login Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

System Dependency Libraries to Add

  • CoreGraphics.framework
  • CoreTelephony.framework
  • Foundation.framework
  • libc++.tbd
  • libiconv.tbd
  • libsqlite3.tbd
  • Security.framework
  • SystemConfiguration.framework
  • WebKit.framework

Add LSApplicationQueriesSchemes in Info.plist Add the corresponding whitelist to your Info.plist file:

xml
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>tim</string>
    <string>mqq</string>
    <string>mqqapi</string>
    <string>mqqbrowser</string>
    <string>mttbrowser</string>
    <string>mqqOpensdkSSoLogin</string>
    <string>mqqopensdkapiV2</string>
    <string>mqqopensdkapiV4</string>
    <string>mqzone</string>
    <string>mqzoneopensdk</string>
    <string>mqzoneopensdkapi</string>
    <string>mqzoneopensdkapi19</string>
    <string>mqzoneopensdkapiV2</string>
    <string>mqqapiwallet</string>
    <string>mqqopensdkfriend</string>
    <string>mqqopensdkavatar</string>
    <string>mqqopensdkminiapp</string>
    <string>mqqopensdkdataline</string>
    <string>mqqgamebindinggroup</string>
    <string>mqqopensdkgrouptribeshare</string>
    <string>tencentapi.qq.reqContent</string>
    <string>tencentapi.qzone.reqContent</string>
    <string>mqqthirdappgroup</string>
    <string>mqqopensdklaunchminiapp</string>
    <string>mqqopensdkproxylogin</string>
    <string>mqqopensdknopasteboard</string>
</array>

WeChat Login Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Add LSApplicationQueriesSchemes in Info.plist Add the corresponding whitelist to your Info.plist file for WeChat:

  • wechat
  • weixinULAPI
  • weixin
xml
<key>LSApplicationQueriesSchemes</key> 
<array> 
    <string>wechat</string> 
    <string>weixinULAPI</string> 
    <string>weixin</string> 
</array>

Optional Modules for Domestic Integration:

Bugly Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Add dependencies

  • SystemConfiguration.framework
  • Security.framework
  • libz.dylib or libz.tbd
  • libc++.dylib or libc++.tbd

Dongqiudi Share

Example Code

Objective-C
[[AccessCoreSdk shareAccessCoreSdkManage] shareType:ACCESS_DONGQIUDI shareObject:[self dongqiudiShare]];
Objective-C
- (AccessShareInfo *)dongqiudiShare {
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    // UIImage *image = [UIImage imageNamed:@"res2.jpg"];
    NSURL *videoURL = [NSURL fileURLWithPath:[NSBundle.mainBundle pathForResource:@"res3" ofType:@"MP4"]];
    
    __block AccessShareInfo *sharemodel = [AccessShareInfo new];
    __block PHObjectPlaceholder *imagePlaceholder;
    __block PHObjectPlaceholder *videoPlaceholder;
    NSMutableArray<NSString *> *identifiers = [NSMutableArray array];
    
    [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
        // imagePlaceholder = [PHAssetCreationRequest creationRequestForAssetFromImage:image].placeholderForCreatedAsset;
        videoPlaceholder = [PHAssetCreationRequest creationRequestForAssetFromVideoAtFileURL:videoURL].placeholderForCreatedAsset;
    } completionHandler:^(BOOL success, NSError * _Nullable error) {
        NSLog(@"save result = %@, error = %@", @(success), error);
        if (!success) {
            return;
        }
        // if (imagePlaceholder) {
        //     [identifiers addObject:imagePlaceholder.localIdentifier];
        // }
        if (videoPlaceholder) {
            [identifiers addObject:videoPlaceholder.localIdentifier];
        }
        NSLog(@"identifiers = %@", identifiers);
        
        AccessDongQiuDiShare *dongqiudi = [AccessDongQiuDiShare new];
        dongqiudi.circleID = @"123";
        dongqiudi.title = @"Test Share Title";
        dongqiudi.content = @"This is the content of the share";
        dongqiudi.scheme = @"demo";
        dongqiudi.assetIDs = identifiers;
        
        sharemodel.shareDongQiuDi = dongqiudi;
        dispatch_semaphore_signal(semaphore);
    }];
    
    dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
    return sharemodel;
}

WeChat Share Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Add LSApplicationQueriesSchemes in Info.plist Add the corresponding whitelist to your Info.plist file for WeChat:

  • wechat
  • weixinULAPI
  • weixin
xml
<key>LSApplicationQueriesSchemes</key> 
<array> 
    <string>wechat</string> 
    <string>weixinULAPI</string> 
    <string>weixin</string> 
</array>

Example Code

Objective-C
// WeChat Friends
[[AccessCoreSdk shareAccessCoreSdkManage] shareType:ACCESS_SCENESESSION shareObject:[self startShareType]];
// WeChat Moments
[[AccessCoreSdk shareAccessCoreSdkManage] shareType:ACCESS_SCENETIMELINE shareObject:[self startShareType]];
Objective-C
- (AccessShareInfo *)startShareType{ 
    UIImage *iamge = [UIImage imageNamed:@"res2.jpg"]; 
    NSString *path_sandox = NSHomeDirectory(); 
    NSString *imagePath = [path_sandox stringByAppendingString:@"/Documents/test.png"]; [UIImagePNGRepresentation(iamge) writeToFile:imagePath atomically:YES]; 
    AccessShareInfo *sharemodel = [AccessShareInfo new]; 
    if (self.shareText.text.length){ 
        sharemodel.title = self.shareText.text; 
    }else{ 
        sharemodel.imagePath = imagePath; 
        } 
        return sharemodel; 
}

QQ Share Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

System Dependency Libraries to Add

  • CoreGraphics.framework
  • CoreTelephony.framework
  • Foundation.framework
  • libc++.tbd
  • libiconv.tbd
  • libsqlite3.tbd
  • Security.framework
  • SystemConfiguration.framework
  • WebKit.framework

Add LSApplicationQueriesSchemes in Info.plist Add the corresponding whitelist to your Info.plist file:

xml
<key>LSApplicationQueriesSchemes</key> 
<array> 
<string>tim</string> 
<string>mqq</string> 
<string>mqqapi</string> 
<string>mqqbrowser</string> 
<string>mttbrowser</string> 
<string>mqqOpensdkSSoLogin</string> 
<string>mqqopensdkapiV2</string> 
<string>mqqopensdkapiV4</string> 
<string>mqzone</string> 
<string>mqzoneopensdk</string> 
<string>mqzoneopensdkapi</string> 
<string>mqzoneopensdkapi19</string> 
<string>mqzoneopensdkapiV2</string> 
<string>mqqapiwallet</string> 
<string>mqqopensdkfriend</string> 
<string>mqqopensdkavatar</string> 
<string>mqqopensdkminiapp</string> 
<string>mqqopensdkdataline</string> 
<string>mqqgamebindinggroup</string> 
<string>mqqopensdkgrouptribeshare</string> 
<string>tencentapi.qq.reqContent</string> 
<string>tencentapi.qzone.reqContent</string> 
<string>mqqthirdappgroup</string> 
<string>mqqopensdklaunchminiapp</string> 
<string>mqqopensdkproxylogin</string>
<string>mqqopensdknopasteboard</string> 
</array>

Example Code

Objective-C
// QQ Friends
[[AccessCoreSdk shareAccessCoreSdkManage] shareType:ACCESS_SCENEQQTOSESSION shareObject:[self startShareType]];
// QQ Zone
[[AccessCoreSdk shareAccessCoreSdkManage] shareType:ACCESS_SCENEQQTOQZONE shareObject:[self startShareType]];
Objective-C
- (AccessShareInfo *)startShareType{ 
    UIImage *iamge = [UIImage imageNamed:@"res2.jpg"]; 
    NSString *path_sandox = NSHomeDirectory(); 
    NSString *imagePath = [path_sandox stringByAppendingString:@"/Documents/test.png"];
    [UIImagePNGRepresentation(iamge) writeToFile:imagePath atomically:YES]; 
    AccessShareInfo *sharemodel = [AccessShareInfo new]; 
    if (self.shareText.text.length){ 
        sharemodel.title = self.shareText.text; 
    }else{ 
        sharemodel.imagePath = imagePath; 
    } 
    return sharemodel; 
}

Appsflyerr Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Import System Dependency Libraries

  • Add AdSupport.framework
  • iAd.framework

Obtain the OneLink subdomain from the marketing team

  • In Xcode, click on your project
  • Click on the project target (see screenshots below)
  • Switch to the "Capabilities" tab
  • Enable "Associated Domains"
  • Add the subdomain provided by your marketing team
  • The format is applinks:xxxxxxxxx.onelink.me

Fangzhou Reporting Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Example Usage SDK Reporting Interface

Objective-C
- (void)report:(EventType)type data:(AccessPlayerInfo *)info;
- (void)setUserExtDataType:(EventType)type data:(AccessPlayerInfo *)userExtData DEPRECATED_MSG_ATTRIBUTE("Please use -report:info:");

Network Detection Module

Import all files from the ios-platform-cloudlogproducer folder

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Build Phases - Link Binary With Libraries Change the Status from Required to Optional

The functionality is consistent with the reporting interface. For specific rules, please refer to: Client Data Reporting

Headline Reporting Module Import all files from ios-platform-ttsdk

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)
  • Create a new Copy Files Phase under Build -> New Copy Files Phase -> Destination. After creation, configure the settings according to the image, and add the dragged framework packages to the Name directory:

Required Modules for Overseas Version

Apple Pay Module

Import the libplatform-pay folder.

Configure the relevant Apple Pay login permissions. Set Apple login options in the project as shown:

CrashSight Module

Import the access_crashsight folder.

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Add dependencies

  • SystemConfiguration.framework
  • Security.framework
  • libz.dylib or libz.tdb
  • libc++.dylib or libc++.tdb (optional, only if needed to prevent errors)

Integration Result Testing
a. Enable Debug Mode. Initialize CrashSight and provide the appropriate configuration parameters.
b. Network Reporting. Check the test device logs to verify if the following logs appear: "begin to upload <CSAnalyticsLogic" or "cmd: 641"
c. Crash Capture. Check the test device logs to verify if the following log appears: "Handle the crash scene in callback"
d. Exception Reporting. Check the test device logs to verify if the following logs appear: "begin to upload <CSCrashLogic" or "cmd: 631"

Apple Sign-In Module

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Configure the relevant Apple login permissions. Set Apple login options in the project as shown:

System Dependency Libraries to Add

  • AuthenticationServices.framework

Google Sign-In Module

Import the Corresponding Modules for ios-platform-googlelogin Folder Include the modules and dependencies from the libs folder. The GoogleSignIn.bundle needs to be added with the main tag.

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Create a new Copy Files Phase under Build -> New Copy Files Phase -> Destination. After creation, configure the settings according to the image, and add the dragged framework packages to the Name directory:

Add the URLSchemes in the info.plist. The CLIENT_ID is in the format: com.googleusercontentxxxxxxxx-xxxxxxx. You can get the specific parameter from your operations team.

xml
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array> <string>YOUR_DOT_REVERSED_IOS_CLIENT_ID</string>
        </array>
    </dict>
</array>

Facebook Login Module

Import the corresponding modules from the ios-platform-facebooklogin folder and the dependent libraries in the libs folder.. Note: If the project already includes libplatform-facebookshare.a for the sharing module, you only need to reference one of the dependency libraries from either ios-platform-facebooklogin/libs or ios-platform-facebookshare/libs to avoid conflicts.

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Import System Dependency Libraries

  • Accelerate.framework

Create a new Copy Files Phase under Build -> New Copy Files Phase -> Destination. After creation, configure the settings according to the image, and add the dragged framework packages to the Name directory:

Create a SwiftFile Bridging-Header and place it in the project.

Add the Relevant Whitelist to info.plist

xml
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fbapi</string>
  <string>fb-messenger-api</string>
  <string>fbauth2</string>
  <string>fbshareextension</string>
</array>

Optional Modules for Overseas Integration:

Facebook Share Module

Import the corresponding modules from the ios-platform-facebookshare folder and the dependent libraries in the libs folder. Note: If the project already includes libplatform-facebookshare.a for the sharing module, you only need to reference one of the dependency libraries from either the ios-platform-facebookshare/libs or ios-platform-facebooklogin/libs folder to avoid conflicts.

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Import System Dependency Libraries

  • Accelerate.framework

Create a new Copy Files Phase under Build -> New Copy Files Phase -> Destination. After creation, configure the settings according to the image, and add the dragged framework packages to the Name directory:

Create a SwiftFile Bridging-Header and place it in the project.

Add the Relevant Whitelist to info.plist

xml
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fbapi</string>
  <string>fb-messenger-api</string>
  <string>fbauth2</string>
  <string>fbshareextension</string>
</array>

Network Detection Module

Import files from the ios-platform-cloudlogproducer folder

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Build Phases - Link Binary With Libraries Change the Status from Required to Optional

The functionality is consistent with the reporting interface. For specific rules, please refer to: Client Data Reporting

Appsflyerr Module

Import files from the ios-platform-appsflyer folder

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Import System Dependency Libraries

  • AdSupport.framework
  • iAd.framework

Obtain the OneLink subdomain from the marketing team

  1. In Xcode, click on your project
  2. Click on the project target (see screenshots below)
  3. Switch to the "Capabilities" tab
  4. Enable "Associated Domains"
  5. Add the subdomain provided by the marketing team
  6. The format is applinks:xxxxxxxxx.onelink.me

Fangzhou Reporting Module

  • Import files from the ios-platform-analysys folder

Integration Method:

  • Drag the current folder into your Xcode project. (Be sure to check the option “Copy items if needed”.)

Example Usage SDK Reporting Interface

Objective-C
- (void)report:(EventType)type data:(AccessPlayerInfo *)info;
- (void)setUserExtDataType:(EventType)type data:(AccessPlayerInfo *)userExtData DEPRECATED_MSG_ATTRIBUTE("Please use -report:info:");

Customer Service Module

  • Import files from the ios-platform-alhelpservice folder

Set up the necessary SDK permissions. In the project's info.plist, add the following permission: Privacy - Photo Library Usage Description: This permission is needed to access your photo library in order to upload images for customer service feedback.

Note: The AIHelpSupportSDK.bundle resource in ios-platform-alhelpservice/libs should be placed under the main tag in the Xcode project.

Example usage:

Objective-C
[[AccessCoreSdk shareAccessCoreSdkManage] openService];

Firebase Module

Import files from the ios-platform-firebase folder

Xcode configuration: In info.plist, set FirebaseAppDelegateProxyEnabled to no

Enable Background Modes in your Xcode project settings

Import the GoogleService-info.plist file, which you will need to obtain from the marketing team

OpenInstall Module

Import files from the ios-platform-openinstall folder

In the Info.plist file, configure the appKey key-value pair: com.openinstall.APP_KEY xxxxxx

  • Open the app with a standard Scheme (iOS <9) or Universal Links (iOS ≥9). When the app is already installed, it can be launched from various browsers (including built-in browsers from popular social apps like WeChat, QQ, Sina Weibo, DingTalk, etc.) and dynamic parameters can be passed.
  • Integrating Universal Links (iOS 9 and above)
  • Go to the Apple Developer website and enable the Associated Domains service for your current App ID
  • In Xcode, configure openinstall to use the Associated Domain generated for your application: applinks:xxxx.openinstall.io
  • Integrating Scheme (for iOS 9 and below)
  • In Xcode, select your Target -> Info -> URL Types, and configure openinstall with the Scheme generated for your application as shown in the image
  • Parameter Validation
Objective-C
> - (void)loginSuccess:(AccessLoginInfo *)success;
> The extendInfo field from the AccessLoginInfo object should be used to retrieve additional information.

SDK Common Error Resolution

Error 1: dyld: Library not loaded: /System/Library/Frameworks/Network.framework/Network Referenced from: /var/containers/Bundle/Application/BC0FE029-D796-4FF6-A2142C5D0EBA6434/ios-platform-sdk.app/ios-platform-sdk Reason: image not found Message from debugger: Terminated due to signal 6

Solution: Set Status settings to Optional

Error 2: "Authorization request failed, unknown reason" when triggering Apple login can be solved as follows:

  • Please check whether the Sign in with Apple capability has been added.
  • In most cases, the issue is caused by a mismatch between the referenced file and the corresponding entitlements file. You can delete the current entitlements file and re-add the capability to generate a new one.
  • Also, make sure that Sign in with Apple is added under the Release configuration as well.

Hoolai Access SDK