1.接入龙图iOSSDK的游戏及应用的iOS客户端开发者。
2.使用此文档内接口,需要先接入龙图iOSSDK(详情查看龙图iOSSDK文档)。
3.接入龙图iOSSDK后,需要配置依游SDK需要的依赖库。
注:本文为依游 iOS终端SDK接入教程,只涉及SDK的使用方法,默认读者已经熟悉Xcode开发工具的基本使用方法,以及具有一定的编程知识基础等。注意:在接入EUSDK前,跟EUSDK对接方确定给定的参数是否属于测试渠道的参数。
<key>EUSDK</key><dict><key>Channel</key><string>"填入渠道提供的参数"</string><key>ChannelName</key><string>ceshi</string><key>EUAppId</key><string>"填入渠道提供的参数"</string><key>EUAppKey</key><string>"填入渠道提供的参数"</string><key>EUServerUrl</key><string>https://api.eusdk.com</string><key>Plugins</key><array><dict><key>CName</key><string>ceshi</string></dict></array></dict>以上参数以我司提供的参数文档为准,没有提供的参数保持不变如果是需要上架appstore的正版游戏,请联系EUSDK以上参数格式可以参考demo
提供的测试渠道参数格式如下:
1、EU_APPID: xxxx
2、EU_APPKEY: xxxxxxxxxxx
3、EU_Channel: xxxxxxx
4、服务端appSecret: xxxxxx(服务端用,可忽略)
将提供参数替换info.plist对应的值
注:不需要去修改ChannelName, CName
下载对应demo
需要引入的系统库
库名称 SDK 备注
libc++.tbd
libz.tbd
libsqlite3.tbd
CoreTelephony.framework
SystemConfiguration.framework
Security.framework
libLT_EUSDK.a
EUSDKCore.framework
*EUSDK需要在Framework选择 embed&sign
EUSDK 要加入在 Embed Framework
在Target->Build Settings -> Other Linker Flags中添加-ObjC, 字母o和c大写。
由于CP方的游戏资源不能对外公开,iOS版的正式渠道游戏接入,一般由EUSDK提供打包工具(已对接好的指定渠道SDK资源包),由CP方接入EUSDK后,测试渠道调试正常,直接用打包工具出。
打包工具和文档地址:https://www.yuque.com/ys_sdk/eusdkv2/nes935
NSPhotoLibraryUsageDescription
App需要您的同意才能访问相册
NSPhotoLibraryAddUsageDescription
此 App 需要您的同意才能读取媒体资料库
NSCameraUsageDescription
App需要您的同意才能使用照相机
如果需要打开推送功能,配置Xcode
选择target->Capabilities
1,打开Background Modes,勾选Remote notifications
2,打开Push Notifications
接入龙图BaseSDK初始化即可
EUSDK 默认实现了UIApplicationDelegate的所有方法,请在您的应用内AppDelegate各个UIApplicationDelegate方法里调用龙图SDK的生命周期方法,
如果需要打开推送功能(可选),请在您的应用内AppDelegate各个UNUserNotificationCenterDelegate方法里调用龙图SDK的UNUserNotificationCenterDelegate方法
具体可以参考demo.
接口说明
需结合龙图SDK文档综合接入
OC 版本接口
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[[LTGameOCSDK shareInstance] LTSDKApplication:application didFinishLaunchingWithOptions:launchOptions];return YES;}- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{[[LTGameOCSDK shareInstance] LTSDKApplication:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];}- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{[[LTGameOCSDK shareInstance] LTSDKApplication:application didFailToRegisterForRemoteNotificationsWithError:error];}- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {[[LTGameOCSDK shareInstance] LTSDKApplication:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];}- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {[[LTGameOCSDK shareInstance] userNotificationCenter:center willPresentNotification:notification withCompletionHandler:completionHandler];}- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {[[LTGameOCSDK shareInstance] userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];}- (void)applicationWillResignActive:(UIApplication *)application {[[LTGameOCSDK shareInstance] LTSDKApplicationWillResignActive:application];}- (void)applicationDidEnterBackground:(UIApplication *)application {[[LTGameOCSDK shareInstance] LTSDKApplicationDidEnterBackground:application];}- (void)applicationWillEnterForeground:(UIApplication *)application {[[LTGameOCSDK shareInstance] LTSDKApplicationWillEnterForeground:application];}- (void)applicationDidBecomeActive:(UIApplication *)application {[[LTGameOCSDK shareInstance] LTSDKApplicationDidBecomeActive:application];}- (void)applicationWillTerminate:(UIApplication *)application {[[LTGameOCSDK shareInstance] LTSDKApplicationWillTerminate:application];}- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{return [[LTGameOCSDK shareInstance] LTSDKApplication:application handleOpenURL:url];}- (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {return [[LTGameOCSDK shareInstance] LTSDKApplication:application openURL:url options:options];}- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {return [[LTGameOCSDK shareInstance] LTSDKApplication:application openURL:url sourceApplication:sourceApplication annotation:annotation];}- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {return [[LTGameOCSDK shareInstance] LTSDKApplication:application supportedInterfaceOrientationsForWindow:window];}
C++版本接口
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {LTGameSDK::GetInstance().ApplicationDidFinishLaunchingWithOptions(application, launchOptions);return YES;}- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{LTGameSDK::GetInstance().DidRegisterForRemoteNotificationsWithDeviceToken(application, deviceToken);}- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{LTGameSDK::GetInstance().DidFailToRegisterForRemoteNotificationsWithError(application, error);}- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {LTGameSDK::GetInstance().DidReceiveRemoteNotificationAndFetchCompletionHandler(application, userInfo, completionHandler);}- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {LTGameSDK::GetInstance().UserNotificationCenterWillPresentNotificationWithCompletionHandler(center, notification, completionHandler);}- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {LTGameSDK::GetInstance().UserNotificationCenterDidReceiveNotificationResponseWithCompletionHandler(center, response, completionHandler);}- (void)applicationWillResignActive:(UIApplication *)application {LTGameSDK::GetInstance().ApplicationWillResignActive(application);}- (void)applicationDidEnterBackground:(UIApplication *)application {LTGameSDK::GetInstance().ApplicationDidEnterBackground(application);}- (void)applicationWillEnterForeground:(UIApplication *)application {LTGameSDK::GetInstance().ApplicationWillEnterForeground(application);}- (void)applicationDidBecomeActive:(UIApplication *)application {LTGameSDK::GetInstance().ApplicationDidBecomeActive(application);}- (void)applicationWillTerminate:(UIApplication *)application {LTGameSDK::GetInstance().ApplicationWillTerminate(application);}- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{return LTGameSDK::GetInstance().HandleOpenURL(url);}- (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {return LTGameSDK::GetInstance().HandleOpenURL(app,url,[options valueForKey:@"UIApplicationOpenURLOptionsSourceApplicationKey"],[options valueForKey:@"UIApplicationOpenURLOptionsAnnotationKey"]);}- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {return LTGameSDK::GetInstance().HandleOpenURL(application, url, sourceApplication, annotation);}- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {return LTGameSDK::GetInstance().ApplicationSupportedInterfaceOrientationsForWindow(application, window);}
EUSDK会根据您要对接的渠道,提供能否显示闪屏功能,请根据API返回值自行判断处理渠道是否支持闪屏,该接口在初始化之后调用。
接口说明
c++接口//展示闪屏,返回NO表示渠道不支持bool showSplash();oc接口//展示闪屏,返回NO表示渠道不支持- (BOOL)LTSDKShowSplash;
接口说明
c++接口//隐藏闪屏,,返回NO表示渠道不支持bool dismissSplash();oc接口//隐藏闪屏,,返回NO表示渠道不支持- (BOOL)LTSDKDismissSplash;

上海中清龙图软件有限公司