Coder Social home page Coder Social logo

fdsdkforios's Introduction

互冠聚合SDK iOS客户端文档

License MIT  Support 

演示项目

查看并运行 FDSDKDemo/FDSDKDemo.xcodeproj

使用

  1. 下载 FDSDKDemo 文件夹内的所有内容。

  2. 将 Frameworks 内的FDSDK.framework和SDK添加(拖放)到你的工程目录中。
  3. 在对应项目Targets下找到General,在Embedded Binaries链接 frameworks:
  4. 导入 <FDSDK/FDSDK.h>
  5. 初始化SDK。并更改对应的参数
  6. 配置对应渠道SDK设置

初始化SDK

各渠道支持真机模拟器情况
渠道列表 支持真机 支持模拟器 未支持原因
升游 支持 支持
乐嗨嗨 支持 支持
玄藏 支持 支持
游龙 支持 支持
94玩 支持 支持
PP助手 支持 支持
互冠 支持 支持
爱思 支持 支持
XY 支持 支持
麟游 支持 支持
银狐 支持 支持
乐玩 支持 支持
果盘 支持 不支持 合并库过大
乐游 支持 不支持
应天 支持 不支持
久久 支持 不支持
FDSDKParameters参数说明
参数名 参数类型 说明
appId NSString 聚合SDK游戏标识
appKey NSString 聚合SDK游戏Key
logData BOOL 渠道SDK并集参数。是否打印日志
debug BOOL 渠道SDK并集参数。是否为测试模式
fdPlatformType NS_ENUM 设置当前编译链接渠道
SYSDK FDSYSDKInitModel参数说明
参数名 参数类型 说明
name NSString 升游游戏名
shortName NSString 升游游戏名缩写
direction NSString 游戏屏幕方向
LHHSDK FDLHHSDKInitModel参数说明
参数名 参数类型 说明
pid NSString 乐嗨嗨SDK pid
AppKey NSString 乐嗨嗨SDK AppKey
AppScheme NSString 乐嗨嗨SDK AppScheme
XZSDK FDXZSDKInitModel参数说明
参数名 参数类型 说明
AppID NSString 玄藏SDKAppId
AppKey NSString 玄藏SDKAppKey
AppScheme NSString 玄藏SDK AppScheme
YLSDK YLinfo.plist参数说明
参数名 参数类型 说明
pid NSString 游龙SDK pid
appKey NSString 游龙SDK appKey
DockSDK FDDockSDKInitModel参数说明
参数名 参数类型 说明
AppID NSString DockSDK(94玩)AppId
AppKey NSString DockSDK(94玩)AppKey
PPSDK FDPPSDKInitModel参数说明
参数名 参数类型 说明
AppID NSString PP助手AppId
AppKey NSString PP助手AppKey
QDSDK FDQdSDKInitModel参数说明
参数名 参数类型 说明
AppID NSString 乐玩SDK游戏标识
LoginKey NSString 乐玩SDK登陆key
ChanelID NSString 乐玩channelID
GameName NSString 游戏名称
GameID NSString 乐玩游戏id
YHSDK YHInfo.plist参数说明
参数名 参数类型 说明
appId NSString 银狐SDK游戏标识
appKey NSString 银狐SDK游戏密钥
channelID NSString 银狐channelID
RYappKey NSString 银狐SDK热云广告跟踪appkey
LYSDK FDLySDKInitModel参数说明
参数名 参数类型 说明
productId NSString LYSDK游戏标识
linnyouKey NSString LYSDK游戏密钥
XYSDK FDXySDKInitModel参数说明
参数名 参数类型 说明
appId NSString XYSDK游戏标识
appKey NSString XYSDK游戏密钥
appScheme NSString 支付回调标识
ASSDK FDAsSDKInitModel参数说明
参数名 参数类型 说明
appId int 爱思SDK游戏标识
appKey NSString 爱思SDK游戏密钥
HGSDK FDHGSDKInitModel参数说明
参数名 参数类型 说明
gameId NSString 互冠SDK游戏标识
secretKey NSString 互冠SDK游戏密钥
cpId NSString 互冠cpid
channelId NSString 互冠channelId
wxAppId NSString 微信AppId(可能为空)
LeYouSDK FDLeYouSDKInitModel参数说明
参数名 参数类型 说明
appID NSString 乐游appID
gameID NSString 乐游gameID
JiuJiuSDK FDJiuJiuSDKInitModel参数说明
参数名 参数类型 说明
appID NSString 久久appID
URLScheme NSString 久久URLScheme
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self.window makeKeyAndVisible];

    [[FDSDKParameters sharedHGSDKParameters] setAppId:@"23"];
    [[FDSDKParameters sharedHGSDKParameters] setAppKey:@"ea718a569b4a828e5481acc695rr2abb"];
    [[FDSDKParameters sharedHGSDKParameters] setLogData:NO];
    [[FDSDKParameters sharedHGSDKParameters] setDebug:NO];
    
    //设置升游sdk参数
    FDSYSDKInitModel *sySDKInitModel = [FDSYSDKInitModel new];
    [sySDKInitModel setName:@"烈哈哈天"];
    [sySDKInitModel setShortName:@"letrgt"];
    [sySDKInitModel setDirection:@"1"];
    [[FDSDKParameters sharedHGSDKParameters] setSySDKInitModel:sySDKInitModel];
    
    //设置乐嗨嗨sdk参数
    FDLHHSDKInitModel *lhhSDKInitModel = [FDLHHSDKInitModel new];
    [lhhSDKInitModel setPid:@"23456"];
    [lhhSDKInitModel setAppKey:@"91538b441ccc1d8a3dsfsddfdwdf"];
    [lhhSDKInitModel setAppScheme:@"FDLHH"];
    [[FDSDKParameters sharedHGSDKParameters] setLhhSDKInitModel:lhhSDKInitModel];
    
    //设置玄藏SDK参数
    FDXZSDKInitModel *xzSDKInitModel = [FDXZSDKInitModel new];
    [xzSDKInitModel setAppID:@"1043432"];
    [xzSDKInitModel setAppKey:@"acd0552604dfsegfvs7dc6wefds7"];
    [xzSDKInitModel setAppScheme:@"XZshengshizhuzai"];
    [[FDSDKParameters sharedHGSDKParameters] setXzSDKInitModel:xzSDKInitModel];
    
    //设置游龙SDK参数
    //请在YLinfo.plist中填写相关参数
        
    //设置94玩SDK参数
    FDDockSDKInitModel *dockSDKInitModel = [FDDockSDKInitModel new];
    [dockSDKInitModel setAppID:@"324"];
    [dockSDKInitModel setAppKey:@"fewsdf8e25a8b14ewfdsrg0a1609f2834e"];
    [[FDSDKParameters sharedHGSDKParameters] setDockSDKInitModel:dockSDKInitModel];
    
    //设置pp助手SDK参数
    FDPPSDKInitModel *ppSDKInitModel = [FDPPSDKInitModel new];
    [ppSDKInitModel setAppID:@"3043"];
    [ppSDKInitModel setAppKey:@"07ng4beec493edg718fa9a40142980ee"];
    [[FDSDKParameters sharedHGSDKParameters] setPpSDKInitModel:ppSDKInitModel];
        
    //设置乐玩SDK参数
    FDQdSDKInitModel *qdSDKInitModel = [FDQdSDKInitModel new];
    [qdSDKInitModel setGameID:@"1434"];
    [qdSDKInitModel setChanelID:@"52"];
    [qdSDKInitModel setLoginKey:@"d6rg4r7d"];
    [qdSDKInitModel setAppID:@"345653455"];
    [[FDSDKParameters sharedHGSDKParameters] setQdSDKInitModel:qdSDKInitModel];
    
    //设置银狐SDK参数
    //请在YHInfo.plist中填写相关参数

    //设置麟游SDK参数
    FDLySDKInitModel *lySDKInitModel = [FDLySDKInitModel new];
    [lySDKInitModel setProductId:@"diogern"];
    [lySDKInitModel setLinnyouKey:@"cdsfdsjlkfjds"];
    [[FDSDKParameters sharedHGSDKParameters] setLySDKInitModel:lySDKInitModel];
    
    // 设置爱思SDK参数
    FDAsSDKInitModel *asSDKInitModel = [FDAsSDKInitModel new];
    [asSDKInitModel setAppId:634];
    [asSDKInitModel setAppKey:@"11234bb4332dn6576565654"];
    [[FDSDKParameters sharedHGSDKParameters] setAsSDKInitModel:asSDKInitModel];
    
    // 设置XYSDK参数
    FDXySDKInitModel *xySDKInitModel = [FDXySDKInitModel new];
    [xySDKInitModel setAppScheme:@"com.XX.XXX.pay"];
    [xySDKInitModel setAppId:@"123421"];
    [xySDKInitModel setAppKey:@"Drkdgsdkfgndslkjfnfawejrfglsdjls"];
    [[FDSDKParameters sharedHGSDKParameters] setXySDKInitModel:xySDKInitModel];
    

    // 设置互冠SDK参数
    FDHgSDKInitModel *hgSDKInitModel = [FDHgSDKInitModel new];
    [hgSDKInitModel setGameId:@"56"];
    [hgSDKInitModel setSecretKey:@"4gslkdslknvi42k34ln523l3k2j423k"];
    [hgSDKInitModel setChannelId:@"5"];
    [hgSDKInitModel setCpId:@"2344"];
    [hgSDKInitModel setWxAppId:@"wx439c5855ea4dghd3"];
    [[FDSDKParameters sharedHGSDKParameters] setHgSDKInitModel:hgSDKInitModel];
    
    // 设置果盘SDK参数
    FDGpSDKInitModel *gpSDKInitModel = [FDGpSDKInitModel new];
    [gpSDKInitModel setAppId:@"101101"];
    [gpSDKInitModel setSecretKey:@"GuopanSDK8^(Llad"];
    [[FDSDKParameters sharedHGSDKParameters] setGpSDKInitModel:gpSDKInitModel];
    
    // 设置乐游SDK参数
    FDLeYouSDKInitModel *leYouSDKInitModel = [FDLeYouSDKInitModel new];
    [leYouSDKInitModel setAppID:@"1643"];
    [leYouSDKInitModel setGameID:@"1643"];
    [[FDSDKParameters sharedHGSDKParameters] setLeYouSDKInitModel:leYouSDKInitModel];
    
    // 设置久久SDK参数
    FDJiuJiuSDKInitModel *jiuJiuSDKInitModel = [FDJiuJiuSDKInitModel new];
    jiuJiuSDKInitModel.appid = @"cqryios";
    jiuJiuSDKInitModel.URLScheme = @"Tracelesscom.com.syzr.hg.FDJiuJiuSDKDemo";
    [[FDSDKParameters sharedHGSDKParameters] setJiuJiuSDKInitModel:jiuJiuSDKInitModel];

	// 设置应天SDK参数
    //请在mchannelinfos.plist中填写相关参数

    //选取需要初始化的sdk(银狐sdk只需要执行该代码)
    [[FDSDKParameters sharedHGSDKParameters] setFdPlatformType:FDQDPlatform];
    
    //初始化SDK
    [[FDSDK sharedInstance] fdInitWithSDKParameters:[FDSDKParameters sharedHGSDKParameters]];
    
    [[FDSDK sharedInstance] fdApplication:application didFinishLaunchingWithOptions:launchOptions];
    
    return YES;
}
第三方支付回调处理
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
    [[FDSDK sharedInstance] fdPayResult:application openURL:url options:nil];
    return YES;
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options{

    [[FDSDK sharedInstance] fdPayResult:app openURL:url options:options];
    return YES;
}


- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    [[FDSDK sharedInstance] fdPayResult:application openURL:url sourceApplication:sourceApplication];
    return YES;
}
UIApplicationDelegate响应事件
- (void)fdApplicationDidBecomeActive:(UIApplication *)application;
- (void)fdWillEnterForeground:(UIApplication *)application;

- (void)fdApplication:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;

- (void)fdApplication:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;

- (void)fdApplication:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
- (void)fdApplication:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification;
- (void)fdApplicationWillResignActive:(UIApplication *)application;
- (void)fdApplicationDidEnterBackground:(UIApplication *)application;
- (void)fdApplicationWillTerminate:(UIApplication *)application;
- (void)fdApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;

注意:需要在项目实现UIApplicationDelegate的类中调用上述接口。
如下:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[FDSDK sharedInstance] fdApplication:application didFinishLaunchingWithOptions:launchOptions];
    return YES;
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    [[FDSDK sharedInstance] fdPayResult:application openURL:url options:nil];
    return YES;
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
    [[FDSDK sharedInstance] fdPayResult:app openURL:url options:options];
    [[FDSDK sharedInstance] fdShareResult:app openURL:url options:options];
    return YES;
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    [[FDSDK sharedInstance] fdPayResult:application openURL:url sourceApplication:sourceApplication annotation:annotation];
    return YES;
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    [[FDSDK sharedInstance] fdApplication:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
    [[FDSDK sharedInstance] fdApplication:application didReceiveRemoteNotification:userInfo];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
    [[FDSDK sharedInstance] fdApplication:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
    [[FDSDK sharedInstance] fdApplication:application didReceiveLocalNotification:notification];
}
- (void)applicationWillResignActive:(UIApplication *)application {
    [[FDSDK sharedInstance] fdApplicationWillResignActive:application];
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
    [[FDSDK sharedInstance] fdApplicationDidEnterBackground:application];
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
    [[FDSDK sharedInstance] fdWillEnterForeground:application];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
    [[FDSDK sharedInstance] fdApplicationDidBecomeActive:application];
}
- (void)applicationWillTerminate:(UIApplication *)application {
    [[FDSDK sharedInstance] fdApplicationWillTerminate:application];
}

登陆方法

FDUserModel参数说明
参数名 参数类型 说明
userId NSString 聚合SDK用户标识
token NSString 聚合SDK用户登陆令牌
sdkUserId NSString 渠道SDK用户标识(可能为空)
sdkUserName NSString 渠道SDK用户名(可能为空)
extension NSString 拓展参数(可能为空)
- (void)loginButtonClick
{
    [[FDSDK sharedInstance] fdLogin:self.view complete:^(FDUserModel *userModel) {
        
    }];
}

更新商品信息

productsId 参数说明
参数名 参数类型 说明
productsId NSArry 商品信息列表
[[FDSDK sharedInstance] fdUpdateProducts:@[@"com.rxgs.600",@"com.rxgs.3000",@"com.rxgs.6800",@"com.rxgs.12800",@"com.rxgs.32800",@"com.rxgs.64800"]];

初始化服务器

productsId 参数说明
参数名 参数类型 说明
serverId NSString 区服
[[FDSDK sharedInstance] fdInitServer:@"1"];

用户中心

- (void)centerButtonClick
{
    [[FDSDK sharedInstance] fdCenter];
}

支付方法

FDPayParamsModel参数说明

参数名 参数类型 说明
orderId NSString 订单编号
price int 订单金额(大于等于1的整数)
productId NSString 商品标识
productName NSString 商品名称
productDesc NSString 商品描述
roleId NSString 角色标识
roleName NSString 角色名称
roleLevel NSString 角色等级
serverId NSString 区服标识
serverName NSString 区服名称
extension NSString 拓展参数(不能包含中文字符)
- (void)payButtonClick
{
    FDPayParamsModel *payParamsModel = [FDPayParamsModel new];
    [payParamsModel setPrice:6];
    [payParamsModel setServerId:@"1"];
    [payParamsModel setServerName:@"蜀山传奇"];
    [payParamsModel setRoleId:@"1"];
    [payParamsModel setRoleName:@"GG20思密达"];
    [payParamsModel setRoleLevel:@"20"];
    [payParamsModel setOrderId:[self getOrderStringByTime]];
    [payParamsModel setProductId:@"com.qjtl.6"];
    [payParamsModel setProductName:@"元宝"];
    [payParamsModel setProductDesc:@"花费6人民币购买600元宝"];
    [payParamsModel setExtension:@"拓展参数,不能包含中文字符"];
    [[FDSDK sharedInstance] fdPay:payParamsModel complete:^(FDPayResultCode payResultCode) {
        if (payResultCode == FDPayResultCodeSucceed)
        {
            NSLog(@"支付成功");
        }
    }];
}

用户注销

- (void)logoutButtonClick
{
    [[FDSDK sharedInstance] fdLogout];
}

用户注销回调方法

[[FDSDK sharedInstance] setFdLogoutBlock:^{
    NSLog(@"注销回调");
}];

上报玩家信息方法

FDRoleModel参数说明

参数名 参数类型 说明
roleName NSString 角色名称
roleLever int 角色等级
serverName NSString 角色所在区服
roleMoney int 角色剩余游戏币
roleId NSString 角色Id
serverId NSString 区服id
payLevel NSString 充值等级
extar NSString 扩展信息(可不传)
    FDRoleModel *roleModel = [FDRoleModel new];
    [roleModel setRoleName:@"GG20思密达"];
    [roleModel setRoleLever:999];
    [roleModel setRoleMoney:10000];
    [roleModel setServerName:@"蜀山传奇"];
    [roleModel setRoleId:@"1"];
    [roleModel setServerId:@"1"];
    [roleModel setPayLevel:@"v15"];
    [roleModel setExtar:@"扩展信息"];
    [[FDSDK sharedInstance] updateRoleInfo: roleModel];

配置渠道SDK

1、选择项目,新建Target。并且删除新建项目的所有模板文件。只保留项目的info.plist文件
2、选择新建的Target。选择Build Phases。引用公共项目的代码和资源

3、选择新建的Target。选择Build Settings 搜索Other Linker,在Other Linker Falgs加入-ObjC

以上三部为公共配置。每新增一个渠道SDK都是如此。不同之处在后面列出来

##升游SDK所需要配置
###51wan渠道
1、渠道所需要的sdk如下

2、链接库如下

  1. libz.tbd
  2. WanAppStoreSDK.framework
  3. libc++.tbd
  4. libHN688SDK_51Wan.a
  5. libsqlite3.tbd
  6. WebKit.framwork
  7. JavaScriptCore.framework
  8. Foundation.framework
  9. CoreGraphics.framework
  10. UIKit.framework
  11. CoreMotion.framework
  12. Security.framework
  13. CoreTelephony.framework
  14. CFNetwork.framework
  15. SystemConfiguration.framework
  16. SPluginPlatform.framework
  17. SYSDK.framework
  18. HN669SDKCore.framework
  19. FDSDK.framework
  20. SCorePluginPlatform.framework
  21. Score.framework


3、资源文件如下

  1. WanAppStoreSDKBundle.bundle
  2. SResources.bundle


4.info.plist配置 选择项目下的info.plist

Xcode7以上需要手动打开网络请求:

添加应用白名单

添加配置信息

5.Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:

6.在工程的Build Settings中找info,设置URL Types,添加自定义URL Scheme。URL Scheme在回调结果使用,用来支持完成支付返回App。(需在这里配置为App的Bundle ID,才能在App支付后完成跳转)

注意

升游SDK 在应用加载完成的代理方法中,初始化window之前调用下面的2个接口:

项目中需要接入demo里面AppDelegate文件内展示的所有方法。

游戏开始时只需要调用一次上报角色等级接口(否则充值失败)

###XY渠道
1、渠道所需要的sdk如下

2、链接库如下

  1. libz.tbd
  2. libc++.tbd
  3. libsqlite3.tbd
  4. WebKit.framwork
  5. JavaScriptCore.framework
  6. Foundation.framework
  7. CoreGraphics.framework
  8. UIKit.framework
  9. CoreMotion.framework
  10. Security.framework
  11. CoreTelephony.framework
  12. CFNetwork.framework
  13. SystemConfiguration.framework
  14. HN669SDKCore.framework
  15. AlipaySDK.framework
  16. XYSDK.framework.
  17. SPluginPlatform.framework
  18. SYSDK.framework
  19. libHN699SDK_XYSDK.a
  20. SCorePluginPlatform.framework
  21. HeePay.framework
  22. Score.framework
  23. FDSDK.framework


3、资源文件如下

  1. AlipaySDK.bundle
  2. XYSDKResources.bundle
  3. heepayImage.bundle
  4. SResources.bundle


4.info.plist配置 选择项目下的info.plist

Xcode7以上需要手动打开网络请求:

添加应用白名单

添加配置信息

5.Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:

6.在工程的Build Settings中找info,设置URL Types,添加自定义URL Scheme。URL Scheme在回调结果使用,用来支持完成支付返回App。(需在这里配置为App的Bundle ID,才能在App支付后完成跳转)

注意

升游SDK 在应用加载完成的代理方法中,初始化window之前调用下面的2个接口:

项目中需要接入demo里面AppDelegate文件内展示的所有方法。

游戏开始时只需要调用一次上报角色等级接口(否则充值失败)

##乐嗨嗨SDK所需要配置
1、链接库如下

  1. ZQSDK.framework


2、资源文件如下

  1. Image.bundle
  2. AlipaySDK.bundle


3.Embed Binaries 里面添加sdk框架库,如下图:

4.添加URL Scheme
选择Info ->URL Types 点击添加(与初始化中appScheme参数保持一致)

5.info.plist配置 选择项目下的info.plist

Xcode7以上需要手动打开网络请求:

添加第三方应用的白名单设置(如图): 在工程里面点击主 .plist 文件,右键"Open As" -> "Source Code" 在打开的源码中添加:

    <key>LSApplicationQueriesSchemes</key>
	<array>
		<string>alipay</string>
		<string>weixin</string>
		<string>ZQHYSYT</string>
	</array>


另外,需要加上访问相册的白名单:

6.Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:

7.在target->Capabilities中打开Keychain Sharing

会得到XXX.entitlements文件,打开文件设置为$(AppIdentifierPrefix)com.lhh,如下图所示



##玄藏SDK所需要配置
1、链接库如下

  1. libz.1.tbd
  2. libsdc++.6.0.9.tbd
  3. Security.framework
  4. libc++.tbd
  5. libz.tbd
  6. CoreMotion.framework
  7. CoreTelephony.framework
  8. AudioToolbox.framework
  9. StoreKit.framework
  10. WebKit.framework
  11. FDSDK.framework
  12. YLPlatformSDK.framework


2、资源文件如下

  1. YLPlatformSDK.bundle
  2. SIPKeyboardBundleForiPhone.bundle


3.info.plist配置 选择项目下的info.plist

Xcode7以上需要手动打开网络请求:

添加访问相机与相册的白名单:

添加微信白名单 LSApplicationQueriesSchemes

4.在URL Types中添加对应的URL Schemes(格式:XZ+游戏拼音全称,与初始化sdk的APPScheme保持相同)

5.Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:


##游龙SDK所需要配置
1、链接库如下

  1. libz.1.tbd
  2. libsdc++.6.0.9.tbd
  3. Security.framework
  4. libc++.tbd
  5. libz.tbd
  6. CoreMotion.framework
  7. CoreTelephony.framework
  8. AudioToolbox.framework
  9. StoreKit.framework
  10. WebKit.framework
  11. FDSDK.framework
  12. YLPlatformSDK.framework


2、资源文件如下

  1. YLPlatformSDK.bundle


3.info.plist配置 选择项目下的info.plist

Xcode7以上需要手动打开网络请求:

添加访问相机与相册的白名单:

4.在URL Types中添加对应的URL Schemes(格式:YL+游戏拼音全称)

5.Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:


##94玩SDK所需要配置
1、链接库如下

  1. libc.tbd
  2. libz.tbd
  3. CoreMotion.framework
  4. Foundation.framework
  5. UIKit.framework
  6. SystemConfiguration.framework


2、资源文件如下

  1. DockSDK.framework
  2. Alipay.bundle
  3. SDKBundle.bundle


3.Embed Frameworks 里面添加sdk框架库,如下图:

4.创建一个copy files

5.info.plist配置 选择项目下的info.plist

Xcode7以上需要手动打开网络请求:

添加微信支付宝的白名单设置(如图): 在工程里面点击主 .plist 文件,右键"Open As" -> "Source Code" 在打开的源码中添加:

    <key>LSApplicationQueriesSchemes</key>
	<array>
		<string>jingdong</string>
		<string>alipay</string>
		<string>alipays</string>
		<string>alipayshare</string>
		<string>wechat</string>
		<string>weixin</string>
	</array>


另外,需要加上访问相册的白名单:


6.Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:



##PP助手SDK所需要配置
1、链接库如下

  1. libc++.tbd
  2. libz.tbd
  3. CoreGraphics.framework
  4. Foundation.framework
  5. libMobileGestalt.framework
  6. AdSupport.framework
  7. Security.framework
  8. SystemConfiguration.framework
  9. CFNetwork.framework
  10. MobileCoreServices.framework
  11. CoreText.framework
  12. UIKit.framework


2、资源文件如下
1.PPAppPlatformKit.bundle


3、info.plist配置 选择项目下的info.plist

Xcode7以上需要手动打开网络请求:

4.设置URL Schemes
因为PP助手充值系统集成了支付宝快捷支付充值方式,该充值方式需要跳转 App,所以需要增加 以下配置,否则充值过程中跳出游戏之后无法返回.值设置为 teiron+ PP助手appid


5、Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:

6.由于银联只支持竖屏,如果游戏只支持横屏,需要将工程的 info.plist 文件中 supported interface orientations( 和 supported interface orientations(iPad))设置成支持 4 个方向,而游戏的横屏在代码中控制即可。

7.添加启动图片
启动图尺寸及命名规则如下所示,直接按照下面的尺寸和命名作图添加到项目中即可

将对应工程的Launch Screen勾选去掉

选择对应的target->General->App Icons and Launch Images配置如下

注意

关于充值:购买物品价格小于现有PP币的时候,直接提示购买,成功后会回调码payResultCode=FDPayResultCodeSucceedk;购买物品价格大于现有PP币的时候,这时候会回调码payResultCode=FDPayResultCodeUnknown,然后发起购买,这时候购买成功了,客户端不会再有任何的回调,服务端会收到通知,要向的服务端查询订单情况。
打包方式:不要用 xcode 的 archive 出包,要用 itunes 导出 ipa 的方式出包:xcode 连接设备,运行 build,得到 xxx.app - 搜索 xxx.app,把它拖到 itunes - 再从 itunes 拖出来

##乐玩SDK所需要配置
1、链接库如下

  1. libz.tbd
  2. libsqlite3.tbd
  3. Foundation.framework
  4. UIKit.framework
  5. CoreGraphics.framework
  6. Security.framework
  7. SystemConfiguration.framework
  8. AdSupport.framework


2、资源文件如下
1.qdSdkRes.bundle


3、info.plist配置 选择乐玩项目下的info.plist

Xcode7以上需要手动打开网络请求:

4、Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:

##银狐SDK所需要配置
1、链接库如下

  1. MobileCoreServices.framework
  2. UIKit.framework
  3. AudioToolbox.framework
  4. AVFoundation.framework
  5. OpenAL.framework
  6. QuartzCore.framework
  7. libz.tbd
  8. OpenGLES.framework
  9. CoreGraphics.framework
  10. Foundation.framework
  11. CoreMotion.framework
  12. Security.framework
  13. libsqlite3
  14. SystemConfiguration.framework
  15. AdSupport.framework
  16. CoreTelephony.framework
  17. MediaPlayer.framework
  18. GameController.framework


2、资源文件如下
1.YinHu.bundle
2.YHInfo.plist


3、info.plist配置 选择银狐项目下的info.plist

在工程的info.plist添加(如果游戏内已经添加了该字段则不需要额外添加,如果没有则必须添加)

Xcode7以上需要手动打开网络请求:

iOS10后,苹果规定工程中需添加用户相关权限:

4、Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:

##麟游SDK所需要配置
1、链接库如下

  1. libc++.tbd
  2. libz.tbd
  3. libsqlite3.tbd
  4. CFNetwork.framework
  5. CoreMotion.framework
  6. CoreText.framework
  7. StoreKit.framework
  8. AdSupport.framework
  9. SystemConfiguration.framework
  10. QuartzCore.framework
  11. Security.framework
  12. CoreTelephony.framework


2、资源文件如下
1.LYGame.bundle


3、info.plist配置 选择麟游项目下的info.plist

Xcode7以上需要手动打开网络请求:

iOS10后,苹果规定工程中需添加用户相关权限:

4、Keychain Sharing设置
如果使用Xcode8 进行SDK接入,请在Capabilities 中将Keychain Sharing 设置为 ON:

5、Enable Bitcode设置 选择Build Settings 搜索Enable Bitcode,将Enable Bitcode设置为NO:

##爱思SDK所需要配置
1、链接库如下

  1. libc++.tbd
  2. libz.tbd
  3. libsqlite3.tbd
  4. AdSupport.framework
  5. AudioToolbox.framework
  6. AVFoundation.framework
  7. CoreGraphics.framework
  8. CoreTelephony.framework
  9. Security.framework
  10. MobileCoreServices.framework
  11. CoreMotion.framework
  12. FDSDK.framework
  13. AsSdkFMWK.framework


2、资源文件如下

  1. AlipaySDK.bundle
  2. AsImage.bundle


3、info.plist配置 选择爱思项目下的info.plist右键选择Open As -> Source Code 在最下面添加如下代码

<key>NSAppTransportSecurity</key>
	<dict>
	    <key>NSAllowsArbitraryLoads</key>
	    <true/>
	</dict>
<key>NSCameraUsageDescription</key>
<string>需要使用相册</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>需要读取媒体资料库</string>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>i4Tool4008227229</string>
    <string>mqqapiwallet</string>
    <string>weixin</string>
    <string>alipay</string>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>As2</string>
        </array>
    </dict>
</array>


注意

CFBundleURLSchemes 为As + 渠道appid

##XYSDK所需要配置

  1. 链接库如下
  2. libz.tbd
  3. libsqlite3.tbd
  4. AdSupport.framework
  5. AVFoundation.framework
  6. CoreGraphics.framework
  7. CoreTelephony.framework
  8. Security.framework
  9. MobileCoreServices.framework
  10. FDSDK.framework
  11. XYPlatform.framework


2、资源文件如下

  1. XYPlatformResources.bundle


3、info.plist配置 选择XY项目下的info.plist右键选择Open As -> Source Code 在最下面添加如下代码

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>alipay</string>
    <string>aliminipayauth2222</string>
    <string>wechat</string>
    <string>weixin</string>
    <string>xyzsapp</string>
    <string>alipayauth</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>com.hg.sdk.alipay</string>
        </array>
    </dict>
</array>


注意

CFBundleURLSchemes 为自定义。最好为游戏bundle id 以alipay结尾 如com.xxx.xxx.alipay

<<<<<<< HEAD

##果盘SDK所需要配置

  1. 链接库如下
  2. FDSDK.framework 需要也加到Embed Framework 下
  3. libsqlite3.tbd
  4. AdSupport.framework
  5. AVFoundation.framework
  6. AlipaySDK.framework
  7. CoreTelephony.framework
  8. Security.framework
  9. GuoPanGroup.framework
  10. libz.tbd
  11. HeePay.framework
  12. IOKit.framework
  13. IOMobileFramebuffer.framework
  14. IOSurface.framework
  15. libcrypto.a
  16. libGPGameSDK.a
  17. libprotobuf_64.a
  18. libssl.a
  19. JavaScriptCore.framework
  20. CoreLocation.framework
  21. AssetsLibrary.framework
  22. CoreMotion.framework
  23. AVFoundation.framework
  24. SystemConfiguration.framework
  25. CFNetwork.framework
  26. CoreMotion.framework


2、资源文件如下

  1. AlipaySDK.bundle
  2. GPGameResource.bundle
  3. heepayImage.bundle
  4. ipaynow.bundle
  5. walletResources.bundle


3、info.plist配置 选择GP项目下的info.plist右键选择Open As -> Source Code 在最下面添加如下代码

<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleTypeRole</key>
		<string>Editor</string>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>com.huguan.FDGPSDKDemo</string>
		</array>
	</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
	<string>xxassistantsdkV2</string>
	<string>XXAppstore</string>
	<string>cydia</string>
	<string>xxassistant</string>
	<string>xxassistantsdk</string>
	<string>alipay</string>
	<string>weixin</string>
	<string>wechat</string>
</array>
<key>NSLocationAlwaysUsageDescription</key>
<string>需要使用地理位置信息</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>需要使用地理位置信息</string>
<key>NSMicrophoneUsageDescription</key>
<string>需要使用麦克风</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>需要读取媒体资料库</string>
<key>UIBackgroundModes</key>
<array>
	<string>audio</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>


注意

CFBundleURLSchemes 为自定义。最好为游戏bundle id

=======

##互冠SDK所需要配置 1、链接库如下
1 .FDSDK.framework
2. HGSDK.framework

其中也要加到Embed Framework
2、资源文件如下

  1. HGSDK.xcassets


3、info.plist配置 选择互冠项目下的info.plist右键选择Open As -> Source Code 在最下面添加如下代码

<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
	</dict>
	<key>NSCameraUsageDescription</key>
	<string>需要使用相机</string>
	<key>NSPhotoLibraryUsageDescription</key>
	<string>需要使用相册</string>


注意

互冠SDK 支付订单时的productId字段需要与apple后台支付参数productId对应上。

控制屏幕方向需要在项目的AppDelegate.m中实现下面方法

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return [[FDSDK sharedInstance] supportedInterface];
}

在Build Phases下加入Run Script如下代码

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

EXTRACTED_ARCHS=()

for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done

echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"

echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"

done

如果使用微信分享功能,请在URL Types中添加对应的URL Schemes


并且在AppDelegate.m中实现下面方法:

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options{

    [[FDSDK sharedInstance] fdShareResult:app openURL:url options:options];

    return YES;
}

##乐游SDK所需要配置
####1.添加乐游SDK资源
将sdk内的
LYSDK.bundle
LYSDK.framework
WXApi.h
WebchatAutSDK.h
WXApiObject.h
libWebChatSDK.a
AlipaySDK.bundle
AlipaySDK.framework
ChannelId.plist
拖入游戏项目,记得勾上“Copy items if needed”;(若已存在请忽略)

####2.添加链接库
由于加入支付宝和微信的支付SDK,所以需要添加如下静态库文件:
在Build Phases选项卡的Link Binary With Libraries中,增加以下依赖:(若已存在请忽略)

libc++.tbd
libz.tbd
libsqlite3.0.tbd
Security.framework
coreMotion.framework
CFNetwork.framework
Foundation.framework
UIKit.framework
CoreGraphics.framework
CoreText.framework
QuartzCore.framework
CoreTelephony.framework
SystemConfiguration.framework

链接库如下图:

####3. 项目Targets设置
Build Setting -> Header Search Paths 增加 LYSDK.framework/Headers
注意:Headers的路径以具体乐游SDK导入的路径为准

Build Setting -> Other Linker Flags 添加 -all_load

####4. info.plist配置(若已存在请忽略)
Http网络配置:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

以及乐游渠道号:(需在ChannelId.plist和info.plist两处配置)
<key>LYChannel</key>
<string>4470</string>

####5.添加微信、支付宝白名单
具体方法:
1.在项目的info.plist中添加一LSApplicationQueriesSchemes,类型为Array。
2.然后给它添加一个需要支持的项目,类型为字符串类型;请添加以下四个:

URL Types配置(为了支付完成之后能跳转回游戏)

具体方法:
TARGETS ----> info ----> URL TYPES 添加如下两个:
支付宝:identifier:alipay
URL Schemes:com.ios.moge.alipay

微信: identifier:weixin
URL Schemes:wxa3d58c25d7ec5c62

如下图:

##YingTianSDK所需要配置
####1.相关依赖库如下
红色框住部分为系统库

####2.在Build Settings 里搜索Enable Bitcode 将Yes改为No

####3.允许HTTP请求

####4.第三方平台参数配置的设置(只需要设置需要的参数,不需要的可以删除或者为空
在项目根目录下创建mchinfo.plist文件,键值内容如下图:

####5.APP跳转的时候需要配置URLSchame和白名单,所以在应用程序的info.plist文件中设置一下内容,如图所示:

配置白名单:

####6.渠道分包的设置:在项目根目录下创建mchannelinfos.plist文件,键值内容如下:

##JiuJiuSDK所需要配置
####1、添加系统依赖库和 Framework文件如下
####2、添加bundle文件如下
####3、修改 Other Linker Flags
VS81Sdk 内部使用了 Objective-C 的 Category,所以开发者需要在工程的 Targets -> Build Settings -> Linking –> Other Linker Flags 中添加–ObjC 选项,以 保证这些 Category 能够正常使用。
注意:区分-ObjC 的大小写,如果您没有添加–ObjC 编译选项,sdk 不能使用
####4、修改 ATS,支持 HTTPS 请求
####5、添加白名单
####6、添加 URL Types
####7、iOS10兼容,在Xcode8中添加一下设置

系统要求

该项目最低支持 iOS 8.0Xcode 7.0

许可证

HGSDK 使用 MIT 许可证,详情见 LICENSE 文件。

fdsdkforios's People

Contributors

zhangjinci avatar huguan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.