Commit c556726ebe4267492accac4fcfd6df284731d258
1 parent
ab7dcdea38
Exists in
master
and in
1 other branch
line、wechat显示与否文档修改
Showing 5 changed files with 22 additions and 340 deletions Inline Diff
- IOSDocument.md
- ios/GameSDKDemo/GameSDKDemo.xcodeproj/project.xcworkspace/xcuserdata/yanglele.xcuserdatad/UserInterfaceState.xcuserstate
- ios/GameSDKDemo/GameSDKDemo.xcodeproj/xcuserdata/yanglele.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
- ios/GameSDKDemo/letsgameDemo/Images.xcassets/AppIcon.appiconset/Contents.json
- ios/GameSDKDemo/letsgameDemo/LSGMainViewController.m
IOSDocument.md
1 | # Gump IOS SDK使用文档 | 1 | # Gump IOS SDK使用文档 |
2 | 2 | ||
3 | 3 | ||
4 | 接入手册 | 4 | 接入手册 |
5 | V 3.4.12 | 5 | V 3.4.12 |
6 | 2017年1月12日 | 6 | 2017年1月18日 |
7 | 7 | ||
8 | ## 概述 | 8 | ## 概述 |
9 | #### 本SDK提供gump账号,fb账号,vk账号,Google帐号四种账号登录,iap支付和第三方支付两种支付功能,其中gump账号登录和fb账号登录功能为必须接入,支付可根据需要选择性接入。 | 9 | #### 本SDK提供gump账号,fb账号,vk账号,Google帐号四种账号登录,iap支付和第三方支付两种支付功能,其中gump账号登录和fb账号登录功能为必须接入,支付可根据需要选择性接入。 |
10 | 10 | ||
11 | ## 接入步骤 | 11 | ## 接入步骤 |
12 | ### 1、添加Framework和资源文件 | 12 | ### 1、添加Framework和资源文件 |
13 | + 以下为必须添加的framework以及资源bundle: | 13 | + 以下为必须添加的framework以及资源bundle: |
14 | MobileCoreServices.framework、SystemConfiguration.framework、libz.dylib、CFNetwork.framework、GameSDK.framework、StoreKit.framework、GameSDKResources.bundle | 14 | MobileCoreServices.framework、SystemConfiguration.framework、libz.dylib、CFNetwork.framework、GameSDK.framework、StoreKit.framework、GameSDKResources.bundle |
15 | + 以下为可选,若接入vk登录则需要添加以下framework和bundle,其中VKSdk.framework和VKSDKResources.bundle请自行从vk.com下载,使用1.3版本 | 15 | + 以下为可选,若接入vk登录则需要添加以下framework和bundle,其中VKSdk.framework和VKSDKResources.bundle请自行从vk.com下载,使用1.3版本 |
16 | VKSdk.framework、VKBridge.framework、VKSDKResources.bundle | 16 | VKSdk.framework、VKBridge.framework、VKSDKResources.bundle |
17 | + 以下可选,若接入微信登陆则需要添加如下的framework: | 17 | + 以下可选,若接入微信登陆则需要添加如下的framework: |
18 | libsqlite3.0.dylib, libc++.dylib, Security.framework, CoreTelephony.framework, CFNetwork.framework | 18 | libsqlite3.0.dylib, libc++.dylib, Security.framework, CoreTelephony.framework, CFNetwork.framework |
19 | 19 | ||
20 | 20 | ||
21 | ### 2、引入头文件,设置build setting | 21 | ### 2、引入头文件,设置build setting |
22 | 需要使用头文件有LetsGameAPI.h和VKBridge.h,其中VKBridge.h为接入vk时使用,不接入vk可忽略。 | 22 | 需要使用头文件有LetsGameAPI.h和VKBridge.h,其中VKBridge.h为接入vk时使用,不接入vk可忽略。 |
23 | 因sdk内使用了category,需要设置other linker flag为 -ObjC | 23 | 因sdk内使用了category,需要设置other linker flag为 -ObjC |
24 | 24 | ||
25 | 25 | ||
26 | ### 3、增加必要配置 | 26 | ### 3、增加必要配置 |
27 | 1)在application delegate中, 在application:openURL:sourceApplication:annotation:添加返回: | 27 | 1)在application delegate中, 在application:openURL:sourceApplication:annotation:添加返回: |
28 | 28 | ||
29 | return [[LetsGameAPI instance] handleOpenURL:url sourceApplication:sourceApplication]; | 29 | return [[LetsGameAPI instance] handleOpenURL:url sourceApplication:sourceApplication]; |
30 | 30 | ||
31 | 31 | ||
32 | 2)配置URL-schema(vk专用,不接入vk可忽略) | 32 | 2)配置URL-schema(vk专用,不接入vk可忽略) |
33 | Xcode 5: Open your application settings then select the Info tab. In the URL Types section click the plus sign. Enter vk+APP_ID (e.g. vk1234567) to the Identifier and URL Schemes fields. | 33 | Xcode 5: Open your application settings then select the Info tab. In the URL Types section click the plus sign. Enter vk+APP_ID (e.g. vk1234567) to the Identifier and URL Schemes fields. |
34 |  | 34 |  |
35 | Xcode 4: Open your Info.plist then add a new row URL Types. Set the URL identifier to vk+APP_ID | 35 | Xcode 4: Open your Info.plist then add a new row URL Types. Set the URL identifier to vk+APP_ID |
36 |  | 36 |  |
37 | 3)配置UIL-schema(weChat专用,不接入可以忽略) | 37 | 3)配置URL-schema(weChat专用,不接入可以忽略) |
38 | 选中“TARGETS”一栏,在“info”标签栏的“URL type“添加“URL scheme”为你所注册的应用程序id | 38 | 选中“TARGETS”一栏,在“info”标签栏的“URL type“添加“URL scheme”为你所注册的应用程序id |
39 | 选中“TARGETS”一栏,在“info”标签栏的“LSApplicationQueriesSchemes“添加weixin和wechat | 39 | 选中“TARGETS”一栏,在“info”标签栏的“LSApplicationQueriesSchemes“添加weixin和wechat |
40 | 40 | ||
41 | ### 4、在工程里添加SDK登录代码 | 41 | ### 4、在工程里添加SDK登录代码 |
42 | 42 | ||
43 | [LetsGameAPI instance].appId = @"100"; // 设置appId | 43 | [LetsGameAPI instance].appId = @"100"; // 设置appId |
44 | [LetsGameAPI instance].appKey = @"100"; // 设置appKey | 44 | [LetsGameAPI instance].appKey = @"100"; // 设置appKey |
45 | 45 | ||
46 | //启用vk的代码,需要填入vk appId,若不接入vk,可以忽略 | 46 | //启用vk的代码,需要填入vk appId,若不接入vk,可以忽略 |
47 | //VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; | 47 | //VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; |
48 | //[LetsGameAPI instance].vkBridge = vkBridge; | 48 | //[LetsGameAPI instance].vkBridge = vkBridge; |
49 | 49 | ||
50 | //隐藏fb登录 | 50 | //隐藏fb登录 |
51 | [LetsGameAPI disableFB:YES]; | 51 | [LetsGameAPI disableFB:YES]; |
52 | //隐藏Google登录 | 52 | //隐藏Google登录 |
53 | [LetsGameAPI disableGoogle:YES]; | 53 | [LetsGameAPI disableGoogle:YES]; |
54 | //隐藏gumptech的logo | 54 | //隐藏gumptech的logo |
55 | [LetsGameAPI hiddenLogo:YES]; | 55 | [LetsGameAPI hiddenLogo:YES]; |
56 | //隐藏line登录 | ||
57 | [LetsGameAPI disableLine:YES]; | ||
58 | //隐藏wechat登录 | ||
59 | [LetsGameAPI disableWeChat:YES]; | ||
56 | 60 | ||
57 | [[LetsGameAPI instance] showLoginView]; // 弹出登录页面 | 61 | [[LetsGameAPI instance] showLoginView]; // 弹出登录页面 |
58 | 62 | ||
59 | // 登录成功回调 | 63 | // 登录成功回调 |
60 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { | 64 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { |
61 | NSLog(@"%@", [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %d", userId, sessionKey, type]); | 65 | NSLog(@"%@", [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %d", userId, sessionKey, type]); |
62 | }; | 66 | }; |
63 | 67 | ||
64 | // 登录失败回调 | 68 | // 登录失败回调 |
65 | [LetsGameAPI instance].dismissBlock = ^() { | 69 | [LetsGameAPI instance].dismissBlock = ^() { |
66 | NSLog(@"dismiss without login"); | 70 | NSLog(@"dismiss without login"); |
67 | }; | 71 | }; |
68 | 72 | ||
69 | ### 5、登录注销 | 73 | ### 5、登录注销 |
70 | 注销接口只要设置过appId和appKey之后就不需要设置了,注销完成之后会回到登录界面。FB登录回到登录页面,Gump登录或者游客登录回到登录框。 | 74 | 注销接口只要设置过appId和appKey之后就不需要设置了,注销完成之后会回到登录界面。FB登录回到登录页面,Gump登录或者游客登录回到登录框。 |
71 | 75 | ||
72 | [LetsGameAPI instance].appId = @"100";//设置appId | 76 | [LetsGameAPI instance].appId = @"100";//设置appId |
73 | [LetsGameAPI instance].appKey = @"100";//设置appkey | 77 | [LetsGameAPI instance].appKey = @"100";//设置appkey |
74 | [[LetsGameAPI instance] logout]; //注销 | 78 | [[LetsGameAPI instance] logout]; //注销 |
75 | 79 | ||
76 | 80 | ||
77 | ### 6、第三方支付 | 81 | ### 6、第三方支付 |
78 | [LetsGameAPI instance].appId = @"10022"; | 82 | [LetsGameAPI instance].appId = @"10022"; |
79 | [LetsGameAPI instance].appKey = @"f899139df5e1059396431415e770c6dd"; | 83 | [LetsGameAPI instance].appKey = @"f899139df5e1059396431415e770c6dd"; |
80 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 84 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
81 | [payInfo setValue:@"5001" forKey:@"serverId"];//服务器id,必传参数 | 85 | [payInfo setValue:@"5001" forKey:@"serverId"];//服务器id,必传参数 |
82 | [payInfo setValue:@"10010" forKey:@"roleId"];//用户角色id | 86 | [payInfo setValue:@"10010" forKey:@"roleId"];//用户角色id |
83 | [payInfo setValue:@"1000" forKey:@"channelId"];//渠道id | 87 | [payInfo setValue:@"1000" forKey:@"channelId"];//渠道id |
84 | [payInfo setValue:@"10" forKey:@"amount"];//金额 | 88 | [payInfo setValue:@"10" forKey:@"amount"];//金额 |
85 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"];//外部订单信息 | 89 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"];//外部订单信息 |
86 | [payInfo setValue:@"元宝" forKey:@"product"];//物品信息 | 90 | [payInfo setValue:@"元宝" forKey:@"product"];//物品信息 |
87 | [payInfo setValue:self.sessionKey forKey:@"sessionKey"];//登录成功的sessionKey | 91 | [payInfo setValue:self.sessionKey forKey:@"sessionKey"];//登录成功的sessionKey |
88 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ | 92 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ |
89 | //第三方支付完成时的回调(包括支付成功和支付失败,除了支付过程中取消的),取消的不会有回调 | 93 | //第三方支付完成时的回调(包括支付成功和支付失败,除了支付过程中取消的),取消的不会有回调 |
90 | NSLog(@"第三方支付完成"); | 94 | NSLog(@"第三方支付完成"); |
91 | }]]; | 95 | }]]; |
92 | 96 | ||
93 | ### 7、IAP支付 | 97 | ### 7、IAP支付 |
94 | 若要使用apple IAP支付,需要在AppDelegate的application: didFinishLaunchingWithOptions:方法内注册iap observer,使用如下方法 | 98 | 若要使用apple IAP支付,需要在AppDelegate的application: didFinishLaunchingWithOptions:方法内注册iap observer,使用如下方法 |
95 | 99 | ||
96 | [[LetsGameAPI instance] registeIapObserver]; | 100 | [[LetsGameAPI instance] registeIapObserver]; |
97 | 具体调用iap支付的方法如下: | 101 | 具体调用iap支付的方法如下: |
98 | 102 | ||
99 | [LetsGameAPI instance].appId = @"10022"; | 103 | [LetsGameAPI instance].appId = @"10022"; |
100 | [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab"; | 104 | [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab"; |
101 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 105 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
102 | [payInfo setValue:@"5001" forKey:@"serverId"];//当前用户所在的服务器Id | 106 | [payInfo setValue:@"5001" forKey:@"serverId"];//当前用户所在的服务器Id |
103 | [payInfo setValue:@"10010" forKey:@"roleId"];//当前用户的角色id | 107 | [payInfo setValue:@"10010" forKey:@"roleId"];//当前用户的角色id |
104 | [payInfo setValue:@"1000" forKey:@"channelId"];//渠道id,用于统计 | 108 | [payInfo setValue:@"1000" forKey:@"channelId"];//渠道id,用于统计 |
105 | [payInfo setValue:@"10" forKey:@"amount"];//对应支付项的支付金额,实际支付金额以itunes配置为准 | 109 | [payInfo setValue:@"10" forKey:@"amount"];//对应支付项的支付金额,实际支付金额以itunes配置为准 |
106 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"];//扩展信息,可以游戏自定义,建议传自有订单号 | 110 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"];//扩展信息,可以游戏自定义,建议传自有订单号 |
107 | [payInfo setValue:@"test.product.1" forKey:@"product"];//itunes 后台配置的对应支付项的productId | 111 | [payInfo setValue:@"test.product.1" forKey:@"product"];//itunes 后台配置的对应支付项的productId |
108 | [[LetsGameAPI instance] iap:payInfo forUser:@"" succCallback:^(NSString *orderId) { | 112 | [[LetsGameAPI instance] iap:payInfo forUser:@"" succCallback:^(NSString *orderId) { |
109 | //此处的回调表明支付已经完成,但此时支付不一定成功,需要服务端验证支付结果 | 113 | //此处的回调表明支付已经完成,但此时支付不一定成功,需要服务端验证支付结果 |
110 | //orderId为gump生成的订单号,此订单号可以在gump server查询此笔支付是否成功 | 114 | //orderId为gump生成的订单号,此订单号可以在gump server查询此笔支付是否成功 |
111 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); | 115 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); |
112 | } failCallback:^(NSString *orderId) { | 116 | } failCallback:^(NSString *orderId) { |
113 | //支付失败 | 117 | //支付失败 |
114 | NSLog(@"IAP file orderId of Gumptech:%@",orderId); | 118 | NSLog(@"IAP file orderId of Gumptech:%@",orderId); |
115 | }]; | 119 | }]; |
116 | ### 8、token的获取 | 120 | ### 8、token的获取 |
117 | FB登录之后会产生token并自动登录,需要如果需要token的话,需要自己调用接口获取。 | 121 | FB登录之后会产生token并自动登录,需要如果需要token的话,需要自己调用接口获取。 |
118 | 122 | ||
119 | //tokenString:token字符串 | 123 | //tokenString:token字符串 |
120 | //refreshTime:refreshTime token最后刷新的时间,即获取的token的时间 | 124 | //refreshTime:refreshTime token最后刷新的时间,即获取的token的时间 |
121 | //expirationTime:expirationTime token最后的有效时间 | 125 | //expirationTime:expirationTime token最后的有效时间 |
122 | [[LetsGameAPI instance] obtainAccessTokenSuccess:^(NSString *tokenString, NSString *refreshTime, NSString *expirationTime) { | 126 | [[LetsGameAPI instance] obtainAccessTokenSuccess:^(NSString *tokenString, NSString *refreshTime, NSString *expirationTime) { |
123 | NSLog(@"tokenString %@, refreshTime %@, expirationTime %@", tokenString, refreshTime, expirationTime); | 127 | NSLog(@"tokenString %@, refreshTime %@, expirationTime %@", tokenString, refreshTime, expirationTime); |
124 | } failure:^(NSString *errorString) { | 128 | } failure:^(NSString *errorString) { |
125 | NSLog(@"get token faile"); | 129 | NSLog(@"get token faile"); |
126 | }]; | 130 | }]; |
127 | 131 | ||
128 | 132 | ||
129 | ### 9、第三方支付版本 | 133 | ### 9、第三方支付版本 |
130 | 第三方支付,分成两个版本:没有gump币和有gump币,不设置时默认为带gump币版本,如果使用不带gump币的版本如下设置: | 134 | 第三方支付,分成两个版本:没有gump币和有gump币,不设置时默认为带gump币版本,如果使用不带gump币的版本如下设置: |
131 | 135 | ||
132 | 需要在 application:didFinishLaunchingWithOptions方法中添加: | 136 | 需要在 application:didFinishLaunchingWithOptions方法中添加: |
133 | 137 | ||
134 | [[LetsGameAPI instance] decideWebPayVersion:1] | 138 | [[LetsGameAPI instance] decideWebPayVersion:1] |
135 | 139 | ||
136 | 140 | ||
137 | ### 10、关于侵权还是侵权的接口显示 | 141 | ### 10、关于侵权还是侵权的接口显示 |
138 | 运营在后台配置此包名和版本在什么时候显示侵权内容还是不侵权内容,此接口调用需要在游戏才开始加载的时候调用,返回值是YES的时候显示侵权内容,在NO的时候显示不侵权内容。 | 142 | 运营在后台配置此包名和版本在什么时候显示侵权内容还是不侵权内容,此接口调用需要在游戏才开始加载的时候调用,返回值是YES的时候显示侵权内容,在NO的时候显示不侵权内容。 |
139 | 143 | ||
140 | 注意:关于运营配置的游戏的版本号,我们默认取的是Bulid版本号的值,请注意。 | 144 | 注意:关于运营配置的游戏的版本号,我们默认取的是Bulid版本号的值,请注意。 |
141 | 145 | ||
142 | [[LetsGameAPI instance] gameObtainSafeSetInfoWithAppId:@"10056" ChannelId:@"1000" handleCallBack:^(BOOL resultStatus) { | 146 | [[LetsGameAPI instance] gameObtainSafeSetInfoWithAppId:@"10056" ChannelId:@"1000" handleCallBack:^(BOOL resultStatus) { |
143 | if (resultStatus) { | 147 | if (resultStatus) { |
144 | NSLog(@"YES 侵权"); | 148 | NSLog(@"YES 侵权"); |
145 | }else{ | 149 | }else{ |
146 | NSLog(@"NO 不侵权"); | 150 | NSLog(@"NO 不侵权"); |
147 | } | 151 | } |
148 | }]; | 152 | }]; |
149 | ### 11、横竖屏设置 | 153 | ### 11、横竖屏设置 |
150 | 154 | ||
151 | 首先设置SDK默认是横屏,在General->Deployment Info->Device Orientain下,只选择Landscape Left 和 Landscape Right,SDK的界面默认是横屏。 | 155 | 首先设置SDK默认是横屏,在General->Deployment Info->Device Orientain下,只选择Landscape Left 和 Landscape Right,SDK的界面默认是横屏。 |
152 | 其次如果想使用竖屏的模式,需要在General->Deployment Info->Device Orientain下,只选择Portrait模式,并且需要在AppDelegate中的方法: | 156 | 其次如果想使用竖屏的模式,需要在General->Deployment Info->Device Orientain下,只选择Portrait模式,并且需要在AppDelegate中的方法: |
153 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;靠前的位置添加代码设置: | 157 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;靠前的位置添加代码设置: |
154 | 158 | ||
155 | [LetsGameAPI DeviceOrientationIsHorizontal:NO]; | 159 | [LetsGameAPI DeviceOrientationIsHorizontal:NO]; |
156 | 160 | ||
157 | 161 | ||
158 | 162 | ||
159 | 163 | ||
160 | 164 | ||
161 | ### 12、微信登陆 | 165 | ### 12、微信登陆 |
162 | 166 | ||
163 | 首先在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;方法中向微信注册应用 | 167 | 首先在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;方法中向微信注册应用 |
164 | //微信登陆 | 168 | //微信登陆 |
165 | [[LetsGameAPI instance] registerAppWeChatWithAppId:@"appId" appKey:@"appKey" Success:^{ | 169 | [[LetsGameAPI instance] registerAppWeChatWithAppId:@"appId" appKey:@"appKey" Success:^{ |
166 | NSLog(@"注册成功"); | 170 | NSLog(@"注册成功"); |
167 | } failure:^{ | 171 | } failure:^{ |
168 | NSLog(@"注册失败"); | 172 | NSLog(@"注册失败"); |
169 | }]; | 173 | }]; |
170 | 174 |
ios/GameSDKDemo/GameSDKDemo.xcodeproj/project.xcworkspace/xcuserdata/yanglele.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ios/GameSDKDemo/GameSDKDemo.xcodeproj/xcuserdata/yanglele.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <Bucket | 2 | <Bucket |
3 | type = "1" | 3 | type = "1" |
4 | version = "2.0"> | 4 | version = "2.0"> |
5 | <Breakpoints> | ||
6 | <BreakpointProxy | ||
7 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
8 | <BreakpointContent | ||
9 | shouldBeEnabled = "Yes" | ||
10 | ignoreCount = "0" | ||
11 | continueAfterRunningActions = "No" | ||
12 | filePath = "../../../iosgamesdk/GameSDK/letsgame/service/httpService/LSGUserService.m" | ||
13 | timestampString = "537441826.965482" | ||
14 | startingColumnNumber = "9223372036854775807" | ||
15 | endingColumnNumber = "9223372036854775807" | ||
16 | startingLineNumber = "594" | ||
17 | endingLineNumber = "594" | ||
18 | landmarkName = "-appObtainWeCharAppIDWithAppId:appKey:result:" | ||
19 | landmarkType = "7"> | ||
20 | </BreakpointContent> | ||
21 | </BreakpointProxy> | ||
22 | <BreakpointProxy | ||
23 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
24 | <BreakpointContent | ||
25 | shouldBeEnabled = "Yes" | ||
26 | ignoreCount = "0" | ||
27 | continueAfterRunningActions = "No" | ||
28 | filePath = "../../../iosgamesdk/GameSDK/letsgame/LetsGameAPI.m" | ||
29 | timestampString = "537764957.2615269" | ||
30 | startingColumnNumber = "9223372036854775807" | ||
31 | endingColumnNumber = "9223372036854775807" | ||
32 | startingLineNumber = "287" | ||
33 | endingLineNumber = "287" | ||
34 | landmarkName = "-registerAppWeChatWithAppId:appKey:Success:failure:" | ||
35 | landmarkType = "7"> | ||
36 | <Locations> | ||
37 | <Location | ||
38 | shouldBeEnabled = "Yes" | ||
39 | ignoreCount = "0" | ||
40 | continueAfterRunningActions = "No" | ||
41 | symbolName = "-[LetsGameAPI registerAppWeChatWithAppId:appKey:Success:failure:]" | ||
42 | moduleName = "GameSDKDemo" | ||
43 | usesParentBreakpointCondition = "Yes" | ||
44 | urlString = "file:///Users/yanglele/workproject/project/GumpSDK/iosgamesdk/GameSDK/letsgame/LetsGameAPI.m" | ||
45 | timestampString = "537763058.957817" | ||
46 | startingColumnNumber = "9223372036854775807" | ||
47 | endingColumnNumber = "9223372036854775807" | ||
48 | startingLineNumber = "287" | ||
49 | endingLineNumber = "287" | ||
50 | offsetFromSymbolStart = "161"> | ||
51 | </Location> | ||
52 | <Location | ||
53 | shouldBeEnabled = "Yes" | ||
54 | ignoreCount = "0" | ||
55 | continueAfterRunningActions = "No" | ||
56 | symbolName = "__65-[LetsGameAPI registerAppWeChatWithAppId:appKey:Success:failure:]_block_invoke" | ||
57 | moduleName = "GameSDKDemo" | ||
58 | usesParentBreakpointCondition = "Yes" | ||
59 | urlString = "file:///Users/yanglele/workproject/project/GumpSDK/iosgamesdk/GameSDK/letsgame/LetsGameAPI.m" | ||
60 | timestampString = "537763058.962042" | ||
61 | startingColumnNumber = "9223372036854775807" | ||
62 | endingColumnNumber = "9223372036854775807" | ||
63 | startingLineNumber = "287" | ||
64 | endingLineNumber = "287" | ||
65 | offsetFromSymbolStart = "19"> | ||
66 | </Location> | ||
67 | </Locations> | ||
68 | </BreakpointContent> | ||
69 | </BreakpointProxy> | ||
70 | <BreakpointProxy | ||
71 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
72 | <BreakpointContent | ||
73 | shouldBeEnabled = "Yes" | ||
74 | ignoreCount = "0" | ||
75 | continueAfterRunningActions = "No" | ||
76 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGWeChatViewController.m" | ||
77 | timestampString = "536126480.108287" | ||
78 | startingColumnNumber = "9223372036854775807" | ||
79 | endingColumnNumber = "9223372036854775807" | ||
80 | startingLineNumber = "51" | ||
81 | endingLineNumber = "51" | ||
82 | landmarkName = "-registerAppWeChatAppIDWithAppId:appKey:success:failure:" | ||
83 | landmarkType = "7"> | ||
84 | <Locations> | ||
85 | <Location | ||
86 | shouldBeEnabled = "Yes" | ||
87 | ignoreCount = "0" | ||
88 | continueAfterRunningActions = "No" | ||
89 | symbolName = "-[LSGWeChatViewController registerAppWeChatAppIDWithAppId:appKey:success:failure:]" | ||
90 | moduleName = "GameSDKDemo" | ||
91 | usesParentBreakpointCondition = "Yes" | ||
92 | urlString = "file:///Users/yanglele/workproject/project/GumpSDK/iosgamesdk/GameSDK/letsgame/registAndLogin/LSGWeChatViewController.m" | ||
93 | timestampString = "537763058.96706" | ||
94 | startingColumnNumber = "9223372036854775807" | ||
95 | endingColumnNumber = "9223372036854775807" | ||
96 | startingLineNumber = "51" | ||
97 | endingLineNumber = "51" | ||
98 | offsetFromSymbolStart = "201"> | ||
99 | </Location> | ||
100 | <Location | ||
101 | shouldBeEnabled = "Yes" | ||
102 | ignoreCount = "0" | ||
103 | continueAfterRunningActions = "No" | ||
104 | symbolName = "__82-[LSGWeChatViewController registerAppWeChatAppIDWithAppId:appKey:success:failure:]_block_invoke" | ||
105 | moduleName = "GameSDKDemo" | ||
106 | usesParentBreakpointCondition = "Yes" | ||
107 | urlString = "file:///Users/yanglele/workproject/project/GumpSDK/iosgamesdk/GameSDK/letsgame/registAndLogin/LSGWeChatViewController.m" | ||
108 | timestampString = "537763058.969188" | ||
109 | startingColumnNumber = "9223372036854775807" | ||
110 | endingColumnNumber = "9223372036854775807" | ||
111 | startingLineNumber = "52" | ||
112 | endingLineNumber = "52" | ||
113 | offsetFromSymbolStart = "44"> | ||
114 | </Location> | ||
115 | </Locations> | ||
116 | </BreakpointContent> | ||
117 | </BreakpointProxy> | ||
118 | <BreakpointProxy | ||
119 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
120 | <BreakpointContent | ||
121 | shouldBeEnabled = "Yes" | ||
122 | ignoreCount = "0" | ||
123 | continueAfterRunningActions = "No" | ||
124 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGWeChatViewController.m" | ||
125 | timestampString = "536126480.108348" | ||
126 | startingColumnNumber = "9223372036854775807" | ||
127 | endingColumnNumber = "9223372036854775807" | ||
128 | startingLineNumber = "34" | ||
129 | endingLineNumber = "34" | ||
130 | landmarkName = "+isWeChatInstall" | ||
131 | landmarkType = "7"> | ||
132 | </BreakpointContent> | ||
133 | </BreakpointProxy> | ||
134 | <BreakpointProxy | ||
135 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
136 | <BreakpointContent | ||
137 | shouldBeEnabled = "Yes" | ||
138 | ignoreCount = "0" | ||
139 | continueAfterRunningActions = "No" | ||
140 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGFBLoginViewController.m" | ||
141 | timestampString = "536127479.611329" | ||
142 | startingColumnNumber = "9223372036854775807" | ||
143 | endingColumnNumber = "9223372036854775807" | ||
144 | startingLineNumber = "68" | ||
145 | endingLineNumber = "68" | ||
146 | landmarkName = "-injectJSObject" | ||
147 | landmarkType = "7"> | ||
148 | </BreakpointContent> | ||
149 | </BreakpointProxy> | ||
150 | <BreakpointProxy | ||
151 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
152 | <BreakpointContent | ||
153 | shouldBeEnabled = "Yes" | ||
154 | ignoreCount = "0" | ||
155 | continueAfterRunningActions = "No" | ||
156 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGFBLoginViewController.m" | ||
157 | timestampString = "536127479.611763" | ||
158 | startingColumnNumber = "9223372036854775807" | ||
159 | endingColumnNumber = "9223372036854775807" | ||
160 | startingLineNumber = "31" | ||
161 | endingLineNumber = "31" | ||
162 | landmarkName = "-loadView" | ||
163 | landmarkType = "7"> | ||
164 | </BreakpointContent> | ||
165 | </BreakpointProxy> | ||
166 | <BreakpointProxy | ||
167 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
168 | <BreakpointContent | ||
169 | shouldBeEnabled = "Yes" | ||
170 | ignoreCount = "0" | ||
171 | continueAfterRunningActions = "No" | ||
172 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGFBLoginViewController.m" | ||
173 | timestampString = "536127479.61203" | ||
174 | startingColumnNumber = "9223372036854775807" | ||
175 | endingColumnNumber = "9223372036854775807" | ||
176 | startingLineNumber = "93" | ||
177 | endingLineNumber = "93" | ||
178 | landmarkName = "-webViewDidFinishLoad:" | ||
179 | landmarkType = "7"> | ||
180 | </BreakpointContent> | ||
181 | </BreakpointProxy> | ||
182 | <BreakpointProxy | ||
183 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
184 | <BreakpointContent | ||
185 | shouldBeEnabled = "Yes" | ||
186 | ignoreCount = "0" | ||
187 | continueAfterRunningActions = "No" | ||
188 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGFBLoginViewController.m" | ||
189 | timestampString = "536127479.61231" | ||
190 | startingColumnNumber = "9223372036854775807" | ||
191 | endingColumnNumber = "9223372036854775807" | ||
192 | startingLineNumber = "102" | ||
193 | endingLineNumber = "102" | ||
194 | landmarkName = "-webView:shouldStartLoadWithRequest:navigationType:" | ||
195 | landmarkType = "7"> | ||
196 | </BreakpointContent> | ||
197 | </BreakpointProxy> | ||
198 | <BreakpointProxy | ||
199 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
200 | <BreakpointContent | ||
201 | shouldBeEnabled = "Yes" | ||
202 | ignoreCount = "0" | ||
203 | continueAfterRunningActions = "No" | ||
204 | filePath = "../../../iosgamesdk/GameSDK/letsgame/service/httpService/LSGUserService.m" | ||
205 | timestampString = "537441826.9659441" | ||
206 | startingColumnNumber = "9223372036854775807" | ||
207 | endingColumnNumber = "9223372036854775807" | ||
208 | startingLineNumber = "49" | ||
209 | endingLineNumber = "49" | ||
210 | landmarkName = "-quickRegSuccess:failure:" | ||
211 | landmarkType = "7"> | ||
212 | </BreakpointContent> | ||
213 | </BreakpointProxy> | ||
214 | <BreakpointProxy | ||
215 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
216 | <BreakpointContent | ||
217 | shouldBeEnabled = "Yes" | ||
218 | ignoreCount = "0" | ||
219 | continueAfterRunningActions = "No" | ||
220 | filePath = "../../../iosgamesdk/GameSDK/letsgame/service/httpService/LSGUserService.m" | ||
221 | timestampString = "537441826.966015" | ||
222 | startingColumnNumber = "9223372036854775807" | ||
223 | endingColumnNumber = "9223372036854775807" | ||
224 | startingLineNumber = "47" | ||
225 | endingLineNumber = "47" | ||
226 | landmarkName = "-quickRegSuccess:failure:" | ||
227 | landmarkType = "7"> | ||
228 | </BreakpointContent> | ||
229 | </BreakpointProxy> | ||
230 | <BreakpointProxy | ||
231 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
232 | <BreakpointContent | ||
233 | shouldBeEnabled = "Yes" | ||
234 | ignoreCount = "0" | ||
235 | continueAfterRunningActions = "No" | ||
236 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGQuickLoginViewController.m" | ||
237 | timestampString = "537764957.262828" | ||
238 | startingColumnNumber = "9223372036854775807" | ||
239 | endingColumnNumber = "9223372036854775807" | ||
240 | startingLineNumber = "757" | ||
241 | endingLineNumber = "757" | ||
242 | landmarkName = "-tableView:cellForRowAtIndexPath:" | ||
243 | landmarkType = "7"> | ||
244 | </BreakpointContent> | ||
245 | </BreakpointProxy> | ||
246 | <BreakpointProxy | ||
247 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
248 | <BreakpointContent | ||
249 | shouldBeEnabled = "Yes" | ||
250 | ignoreCount = "0" | ||
251 | continueAfterRunningActions = "No" | ||
252 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGUserBaseViewController.m" | ||
253 | timestampString = "537442056.715101" | ||
254 | startingColumnNumber = "9223372036854775807" | ||
255 | endingColumnNumber = "9223372036854775807" | ||
256 | startingLineNumber = "554" | ||
257 | endingLineNumber = "554" | ||
258 | landmarkName = "-loginWithName:passwd:accountType:showLoadingIndicator:" | ||
259 | landmarkType = "7"> | ||
260 | <Locations> | ||
261 | <Location | ||
262 | shouldBeEnabled = "Yes" | ||
263 | ignoreCount = "0" | ||
264 | continueAfterRunningActions = "No" | ||
265 | symbolName = "-[LSGUserBaseViewController loginWithName:passwd:accountType:showLoadingIndicator:]" | ||
266 | moduleName = "GameSDKDemo" | ||
267 | usesParentBreakpointCondition = "Yes" | ||
268 | urlString = "file:///Users/yanglele/workproject/project/GumpSDK/iosgamesdk/GameSDK/letsgame/registAndLogin/LSGUserBaseViewController.m" | ||
269 | timestampString = "537763059.006657" | ||
270 | startingColumnNumber = "9223372036854775807" | ||
271 | endingColumnNumber = "9223372036854775807" | ||
272 | startingLineNumber = "554" | ||
273 | endingLineNumber = "554" | ||
274 | offsetFromSymbolStart = "267"> | ||
275 | </Location> | ||
276 | <Location | ||
277 | shouldBeEnabled = "Yes" | ||
278 | ignoreCount = "0" | ||
279 | continueAfterRunningActions = "No" | ||
280 | symbolName = "__83-[LSGUserBaseViewController loginWithName:passwd:accountType:showLoadingIndicator:]_block_invoke" | ||
281 | moduleName = "GameSDKDemo" | ||
282 | usesParentBreakpointCondition = "Yes" | ||
283 | urlString = "file:///Users/yanglele/workproject/project/GumpSDK/iosgamesdk/GameSDK/letsgame/registAndLogin/LSGUserBaseViewController.m" | ||
284 | timestampString = "537763059.008971" | ||
285 | startingColumnNumber = "9223372036854775807" | ||
286 | endingColumnNumber = "9223372036854775807" | ||
287 | startingLineNumber = "554" | ||
288 | endingLineNumber = "554" | ||
289 | offsetFromSymbolStart = "19"> | ||
290 | </Location> | ||
291 | </Locations> | ||
292 | </BreakpointContent> | ||
293 | </BreakpointProxy> | ||
294 | <BreakpointProxy | ||
295 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
296 | <BreakpointContent | ||
297 | shouldBeEnabled = "Yes" | ||
298 | ignoreCount = "0" | ||
299 | continueAfterRunningActions = "No" | ||
300 | filePath = "../../../iosgamesdk/GameSDK/letsgame/service/httpService/LSGUserService.m" | ||
301 | timestampString = "537441826.9662091" | ||
302 | startingColumnNumber = "9223372036854775807" | ||
303 | endingColumnNumber = "9223372036854775807" | ||
304 | startingLineNumber = "370" | ||
305 | endingLineNumber = "370" | ||
306 | landmarkName = "-loginWithName:passwd:accountType:success:failure:" | ||
307 | landmarkType = "7"> | ||
308 | </BreakpointContent> | ||
309 | </BreakpointProxy> | ||
310 | <BreakpointProxy | ||
311 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
312 | <BreakpointContent | ||
313 | shouldBeEnabled = "Yes" | ||
314 | ignoreCount = "0" | ||
315 | continueAfterRunningActions = "No" | ||
316 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGUserBaseViewController.m" | ||
317 | timestampString = "537442056.715198" | ||
318 | startingColumnNumber = "9223372036854775807" | ||
319 | endingColumnNumber = "9223372036854775807" | ||
320 | startingLineNumber = "570" | ||
321 | endingLineNumber = "570" | ||
322 | landmarkName = "-loginWithName:passwd:accountType:showLoadingIndicator:" | ||
323 | landmarkType = "7"> | ||
324 | </BreakpointContent> | ||
325 | </BreakpointProxy> | ||
326 | <BreakpointProxy | ||
327 | BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
328 | <BreakpointContent | ||
329 | shouldBeEnabled = "Yes" | ||
330 | ignoreCount = "0" | ||
331 | continueAfterRunningActions = "No" | ||
332 | filePath = "../../../iosgamesdk/GameSDK/letsgame/registAndLogin/LSGQuickLoginViewController.m" | ||
333 | timestampString = "537764957.263477" | ||
334 | startingColumnNumber = "9223372036854775807" | ||
335 | endingColumnNumber = "9223372036854775807" | ||
336 | startingLineNumber = "826" | ||
337 | endingLineNumber = "826" | ||
338 | landmarkName = "-layerViewButton" | ||
339 | landmarkType = "7"> | ||
340 | </BreakpointContent> | ||
341 | </BreakpointProxy> | ||
342 | </Breakpoints> | ||
343 | </Bucket> | 5 | </Bucket> |
344 | 6 |
ios/GameSDKDemo/letsgameDemo/Images.xcassets/AppIcon.appiconset/Contents.json
1 | { | 1 | { |
2 | "images" : [ | 2 | "images" : [ |
3 | { | 3 | { |
4 | "idiom" : "iphone", | 4 | "idiom" : "iphone", |
5 | "size" : "20x20", | ||
6 | "scale" : "2x" | ||
7 | }, | ||
8 | { | ||
9 | "idiom" : "iphone", | ||
10 | "size" : "20x20", | ||
11 | "scale" : "3x" | ||
12 | }, | ||
13 | { | ||
14 | "idiom" : "iphone", | ||
5 | "size" : "29x29", | 15 | "size" : "29x29", |
6 | "scale" : "2x" | 16 | "scale" : "2x" |
7 | }, | 17 | }, |
8 | { | 18 | { |
9 | "idiom" : "iphone", | 19 | "idiom" : "iphone", |
10 | "size" : "29x29", | 20 | "size" : "29x29", |
11 | "scale" : "3x" | 21 | "scale" : "3x" |
12 | }, | 22 | }, |
13 | { | 23 | { |
14 | "idiom" : "iphone", | 24 | "idiom" : "iphone", |
15 | "size" : "40x40", | 25 | "size" : "40x40", |
16 | "scale" : "2x" | 26 | "scale" : "2x" |
17 | }, | 27 | }, |
18 | { | 28 | { |
19 | "idiom" : "iphone", | 29 | "idiom" : "iphone", |
20 | "size" : "40x40", | 30 | "size" : "40x40", |
21 | "scale" : "3x" | 31 | "scale" : "3x" |
22 | }, | 32 | }, |
23 | { | 33 | { |
24 | "idiom" : "iphone", | 34 | "idiom" : "iphone", |
25 | "size" : "60x60", | 35 | "size" : "60x60", |
26 | "scale" : "2x" | 36 | "scale" : "2x" |
27 | }, | 37 | }, |
28 | { | 38 | { |
29 | "idiom" : "iphone", | 39 | "idiom" : "iphone", |
30 | "size" : "60x60", | 40 | "size" : "60x60", |
31 | "scale" : "3x" | 41 | "scale" : "3x" |
42 | }, | ||
43 | { | ||
44 | "idiom" : "ios-marketing", | ||
45 | "size" : "1024x1024", | ||
46 | "scale" : "1x" | ||
32 | } | 47 | } |
33 | ], | 48 | ], |
34 | "info" : { | 49 | "info" : { |
35 | "version" : 1, | 50 | "version" : 1, |
36 | "author" : "xcode" | 51 | "author" : "xcode" |
37 | } | 52 | } |
38 | } | 53 | } |
ios/GameSDKDemo/letsgameDemo/LSGMainViewController.m
1 | // | 1 | // |
2 | // LSGMainViewController.m | 2 | // LSGMainViewController.m |
3 | // letsgameDemo | 3 | // letsgameDemo |
4 | // | 4 | // |
5 | // Created by zhy on 14-5-24. | 5 | // Created by zhy on 14-5-24. |
6 | // | 6 | // |
7 | // | 7 | // |
8 | 8 | ||
9 | #import "LSGMainViewController.h" | 9 | #import "LSGMainViewController.h" |
10 | #import "LetsGameAPI.h" | 10 | #import "LetsGameAPI.h" |
11 | #import "VKBridge.h" | 11 | #import "VKBridge.h" |
12 | 12 | ||
13 | 13 | ||
14 | @interface LSGMainViewController () | 14 | @interface LSGMainViewController () |
15 | 15 | ||
16 | @property (nonatomic, strong) UILabel *resultLabel; | 16 | @property (nonatomic, strong) UILabel *resultLabel; |
17 | 17 | ||
18 | @property(nonatomic,strong) UIButton *vkActivityShareBtn; | 18 | @property(nonatomic,strong) UIButton *vkActivityShareBtn; |
19 | 19 | ||
20 | @property(nonatomic,copy) NSString *sessionKey; | 20 | @property(nonatomic,copy) NSString *sessionKey; |
21 | @end | 21 | @end |
22 | 22 | ||
23 | @implementation LSGMainViewController | 23 | @implementation LSGMainViewController |
24 | 24 | ||
25 | - (void)loadView { | 25 | - (void)loadView { |
26 | [super loadView]; | 26 | [super loadView]; |
27 | NSLog(@"i come in"); | 27 | NSLog(@"i come in"); |
28 | self.view.backgroundColor = [UIColor whiteColor]; | 28 | self.view.backgroundColor = [UIColor whiteColor]; |
29 | // self.view.backgroundColor = [UIColor blackColor]; | 29 | // self.view.backgroundColor = [UIColor blackColor]; |
30 | 30 | ||
31 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(110, 40, 100, 30)]; | 31 | UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(110, 40, 100, 30)]; |
32 | btn.backgroundColor = [UIColor orangeColor]; | 32 | btn.backgroundColor = [UIColor orangeColor]; |
33 | [btn setTitle:@"测试入口" forState:UIControlStateNormal]; | 33 | [btn setTitle:@"测试入口" forState:UIControlStateNormal]; |
34 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 34 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
35 | btn.titleLabel.font = [UIFont systemFontOfSize:15]; | 35 | btn.titleLabel.font = [UIFont systemFontOfSize:15]; |
36 | [btn addTarget:self action:@selector(onClickTest) forControlEvents:UIControlEventTouchUpInside]; | 36 | [btn addTarget:self action:@selector(onClickTest) forControlEvents:UIControlEventTouchUpInside]; |
37 | [self.view addSubview:btn]; | 37 | [self.view addSubview:btn]; |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | UIButton *bindtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 100, 100, 30)]; | 41 | UIButton *bindtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 100, 100, 30)]; |
42 | bindtn.backgroundColor = [UIColor orangeColor]; | 42 | bindtn.backgroundColor = [UIColor orangeColor]; |
43 | [bindtn setTitle:@"退出账号" forState:UIControlStateNormal]; | 43 | [bindtn setTitle:@"退出账号" forState:UIControlStateNormal]; |
44 | [bindtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 44 | [bindtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
45 | bindtn.titleLabel.font = [UIFont systemFontOfSize:15]; | 45 | bindtn.titleLabel.font = [UIFont systemFontOfSize:15]; |
46 | [bindtn addTarget:self action:@selector(onLogoutTest) forControlEvents:UIControlEventTouchUpInside]; | 46 | [bindtn addTarget:self action:@selector(onLogoutTest) forControlEvents:UIControlEventTouchUpInside]; |
47 | [self.view addSubview:bindtn]; | 47 | [self.view addSubview:bindtn]; |
48 | 48 | ||
49 | UIButton *payBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 160, 100, 30)]; | 49 | UIButton *payBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 160, 100, 30)]; |
50 | payBtn.backgroundColor = [UIColor orangeColor]; | 50 | payBtn.backgroundColor = [UIColor orangeColor]; |
51 | [payBtn setTitle:@"支付" forState:UIControlStateNormal]; | 51 | [payBtn setTitle:@"支付" forState:UIControlStateNormal]; |
52 | [payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 52 | [payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
53 | payBtn.titleLabel.font = [UIFont systemFontOfSize:15]; | 53 | payBtn.titleLabel.font = [UIFont systemFontOfSize:15]; |
54 | [payBtn addTarget:self action:@selector(onPayTest) forControlEvents:UIControlEventTouchUpInside]; | 54 | [payBtn addTarget:self action:@selector(onPayTest) forControlEvents:UIControlEventTouchUpInside]; |
55 | [self.view addSubview:payBtn]; | 55 | [self.view addSubview:payBtn]; |
56 | 56 | ||
57 | UIButton *iapBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 220, 100, 30)]; | 57 | UIButton *iapBtn = [[UIButton alloc] initWithFrame:CGRectMake(110, 220, 100, 30)]; |
58 | iapBtn.backgroundColor = [UIColor orangeColor]; | 58 | iapBtn.backgroundColor = [UIColor orangeColor]; |
59 | [iapBtn setTitle:@"IAP" forState:UIControlStateNormal]; | 59 | [iapBtn setTitle:@"IAP" forState:UIControlStateNormal]; |
60 | [iapBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | 60 | [iapBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; |
61 | iapBtn.titleLabel.font = [UIFont systemFontOfSize:15]; | 61 | iapBtn.titleLabel.font = [UIFont systemFontOfSize:15]; |
62 | [iapBtn addTarget:self action:@selector(onIapTest) forControlEvents:UIControlEventTouchUpInside]; | 62 | [iapBtn addTarget:self action:@selector(onIapTest) forControlEvents:UIControlEventTouchUpInside]; |
63 | [self.view addSubview:iapBtn]; | 63 | [self.view addSubview:iapBtn]; |
64 | 64 | ||
65 | } | 65 | } |
66 | 66 | ||
67 | - (UILabel *)resultLabel { | 67 | - (UILabel *)resultLabel { |
68 | if (!_resultLabel) { | 68 | if (!_resultLabel) { |
69 | _resultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.view.frame) - 90, self.view.frame.size.width, 60)]; | 69 | _resultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.view.frame) - 90, self.view.frame.size.width, 60)]; |
70 | _resultLabel.backgroundColor = [UIColor clearColor]; | 70 | _resultLabel.backgroundColor = [UIColor clearColor]; |
71 | _resultLabel.textAlignment = NSTextAlignmentCenter; | 71 | _resultLabel.textAlignment = NSTextAlignmentCenter; |
72 | _resultLabel.textColor = [UIColor redColor]; | 72 | _resultLabel.textColor = [UIColor redColor]; |
73 | _resultLabel.font = [UIFont systemFontOfSize:15]; | 73 | _resultLabel.font = [UIFont systemFontOfSize:15]; |
74 | _resultLabel.numberOfLines = 4; | 74 | _resultLabel.numberOfLines = 4; |
75 | _resultLabel.lineBreakMode = NSLineBreakByWordWrapping; | 75 | _resultLabel.lineBreakMode = NSLineBreakByWordWrapping; |
76 | [self.view addSubview:_resultLabel]; | 76 | [self.view addSubview:_resultLabel]; |
77 | } | 77 | } |
78 | 78 | ||
79 | return _resultLabel; | 79 | return _resultLabel; |
80 | } | 80 | } |
81 | 81 | ||
82 | 82 | ||
83 | - (void)onClickTest { | 83 | - (void)onClickTest { |
84 | 84 | ||
85 | [LetsGameAPI instance].appId = @"100";//@"100";//10047 | 85 | [LetsGameAPI instance].appId = @"100";//@"100";//10047 |
86 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//@"f899139df5e1059396431415e770c6dd";//eccd9f7dc92858b741132fda313130cf | 86 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//@"f899139df5e1059396431415e770c6dd";//eccd9f7dc92858b741132fda313130cf |
87 | [LetsGameAPI hiddenLogo:YES]; | 87 | [LetsGameAPI hiddenLogo:YES]; |
88 | // [LetsGameAPI disableFB:YES]; | 88 | // [LetsGameAPI disableFB:YES]; |
89 | // [LetsGameAPI disableGoogle:YES]; | 89 | // [LetsGameAPI disableGoogle:YES]; |
90 | // [LetsGameAPI disableLine:YES]; | 90 | // [LetsGameAPI disableLine:YES]; |
91 | [LetsGameAPI disableWeChat:YES]; | ||
91 | NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); | 92 | NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); |
92 | //启用vk登录 | 93 | //启用vk登录 |
93 | VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; | 94 | VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; |
94 | [LetsGameAPI instance].vkBridge = vkBridge; | 95 | [LetsGameAPI instance].vkBridge = vkBridge; |
95 | 96 | ||
96 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { | 97 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { |
97 | self.sessionKey = sessionKey; | 98 | self.sessionKey = sessionKey; |
98 | self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; | 99 | self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; |
99 | }; | 100 | }; |
100 | [LetsGameAPI instance].dismissBlock = ^() { | 101 | [LetsGameAPI instance].dismissBlock = ^() { |
101 | self.resultLabel.text = @"dismiss without login"; | 102 | self.resultLabel.text = @"dismiss without login"; |
102 | }; | 103 | }; |
103 | 104 | ||
104 | [[LetsGameAPI instance] showLoginView]; | 105 | [[LetsGameAPI instance] showLoginView]; |
105 | } | 106 | } |
106 | 107 | ||
107 | 108 | ||
108 | - (void)onLogoutTest { | 109 | - (void)onLogoutTest { |
109 | [LetsGameAPI instance].appId = @"10056"; | 110 | [LetsGameAPI instance].appId = @"10056"; |
110 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; | 111 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; |
111 | [[LetsGameAPI instance] logout]; | 112 | [[LetsGameAPI instance] logout]; |
112 | 113 | ||
113 | } | 114 | } |
114 | 115 | ||
115 | -(void)onPayTest{ | 116 | -(void)onPayTest{ |
116 | [LetsGameAPI instance].appId = @"10056";//10022 | 117 | [LetsGameAPI instance].appId = @"10056";//10022 |
117 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//93a27b0bd99bac3e68a440b48aa421ab | 118 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//93a27b0bd99bac3e68a440b48aa421ab |
118 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 119 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
119 | [payInfo setValue:@"100" forKey:@"serverId"]; | 120 | [payInfo setValue:@"100" forKey:@"serverId"]; |
120 | [payInfo setValue:@"10010" forKey:@"roleId"]; | 121 | [payInfo setValue:@"10010" forKey:@"roleId"]; |
121 | [payInfo setValue:@"1000" forKey:@"channelId"]; | 122 | [payInfo setValue:@"1000" forKey:@"channelId"]; |
122 | [payInfo setValue:@"10" forKey:@"amount"]; | 123 | [payInfo setValue:@"10" forKey:@"amount"]; |
123 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; | 124 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; |
124 | [payInfo setValue:@"test" forKey:@"product"]; | 125 | [payInfo setValue:@"test" forKey:@"product"]; |
125 | [payInfo setValue:@"76c17cc68ff9f7f40bd3d096ccc5600a" forKey:@"sessionKey"]; //self.sessionKey | 126 | [payInfo setValue:@"76c17cc68ff9f7f40bd3d096ccc5600a" forKey:@"sessionKey"]; //self.sessionKey |
126 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ | 127 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ |
127 | NSLog(@"第三方支付完成"); | 128 | NSLog(@"第三方支付完成"); |
128 | }]; | 129 | }]; |
129 | } | 130 | } |
130 | 131 | ||
131 | -(void)onIapTest{ | 132 | -(void)onIapTest{ |
132 | [LetsGameAPI instance].appId = @"10056"; | 133 | [LetsGameAPI instance].appId = @"10056"; |
133 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; | 134 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; |
134 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 135 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
135 | [payInfo setValue:@"5001" forKey:@"serverId"]; | 136 | [payInfo setValue:@"5001" forKey:@"serverId"]; |
136 | [payInfo setValue:@"10010" forKey:@"roleId"]; | 137 | [payInfo setValue:@"10010" forKey:@"roleId"]; |
137 | [payInfo setValue:@"1000" forKey:@"channelId"]; | 138 | [payInfo setValue:@"1000" forKey:@"channelId"]; |
138 | [payInfo setValue:@"10" forKey:@"amount"]; | 139 | [payInfo setValue:@"10" forKey:@"amount"]; |
139 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; | 140 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; |
140 | [payInfo setValue:@"test.product.1" forKey:@"product"]; | 141 | [payInfo setValue:@"test.product.1" forKey:@"product"]; |
141 | [[LetsGameAPI instance] iap:payInfo forUser:@"" succCallback:^(NSString *orderId) { | 142 | [[LetsGameAPI instance] iap:payInfo forUser:@"" succCallback:^(NSString *orderId) { |
142 | //注意测试仅仅是通知客户端成功,但是还需要向服务器请求验证是否成功,以服务端验证为准 | 143 | //注意测试仅仅是通知客户端成功,但是还需要向服务器请求验证是否成功,以服务端验证为准 |
143 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); | 144 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); |
144 | } failCallback:^(NSString *orderId) { | 145 | } failCallback:^(NSString *orderId) { |
145 | NSLog(@"IAP file orderId of Gumptech:%@",orderId); | 146 | NSLog(@"IAP file orderId of Gumptech:%@",orderId); |
146 | }]; | 147 | }]; |
147 | } | 148 | } |
148 | 149 | ||
149 | 150 | ||
150 | - (BOOL)shouldAutorotate { | 151 | - (BOOL)shouldAutorotate { |
151 | return YES; | 152 | return YES; |
152 | } | 153 | } |
153 | 154 | ||
154 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ | 155 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ |
155 | return UIInterfaceOrientationMaskAll; | 156 | return UIInterfaceOrientationMaskAll; |
156 | } | 157 | } |
157 | 158 | ||
158 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | 159 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
159 | return YES; | 160 | return YES; |
160 | } | 161 | } |
161 | 162 | ||
162 | @end | 163 | @end |
163 | 164 |