Commit 9fb44a9bfdfa37f3c925dcedc472450457a4d156
1 parent
135cc0db4b
Exists in
master
修改demo sdk版本
Showing 6 changed files with 4 additions and 5 deletions Inline Diff
- ios/GameSDK.framework/Versions/A/GameSDK
- ios/GameSDK.framework/Versions/A/Headers/LetsGameAPI.h
- ios/GameSDK.zip
- ios/GameSDKDemo/GameSDKDemo.xcodeproj/project.xcworkspace/xcuserdata/yanglele.xcuserdatad/UserInterfaceState.xcuserstate
- ios/GameSDKDemo/letsgameDemo/LSGAppDelegate.m
- ios/GameSDKDemo/letsgameDemo/LSGMainViewController.m
ios/GameSDK.framework/Versions/A/GameSDK
No preview for this file type
ios/GameSDK.framework/Versions/A/Headers/LetsGameAPI.h
1 | 1 | ||
2 | #import <Foundation/Foundation.h> | 2 | #import <Foundation/Foundation.h> |
3 | #import "LSGAccount.h" | 3 | #import "LSGAccount.h" |
4 | #import "VKBridgeProtocol.h" | 4 | #import "VKBridgeProtocol.h" |
5 | 5 | ||
6 | 6 | ||
7 | typedef void (^LSGLoginSuccBlock)(NSString *userId, NSString *sessionKey, LSGAccountType type); | 7 | typedef void (^LSGLoginSuccBlock)(NSString *userId, NSString *sessionKey, LSGAccountType type); |
8 | typedef void (^LSGDismissBlock)(void); | 8 | typedef void (^LSGDismissBlock)(void); |
9 | 9 | ||
10 | static BOOL isDisableFB = NO; | 10 | static BOOL isDisableFB = NO; |
11 | 11 | ||
12 | static BOOL isEnableVK = NO; | 12 | static BOOL isEnableVK = NO; |
13 | 13 | ||
14 | static BOOL isDisableGoogle = NO; | 14 | static BOOL isDisableGoogle = NO; |
15 | 15 | ||
16 | static BOOL hiddenLogo = NO; | 16 | static BOOL hiddenLogo = NO; |
17 | 17 | ||
18 | static NSString *version = @"3.4.5"; | 18 | static NSString *version = @"3.4.6"; |
19 | 19 | ||
20 | @interface LetsGameAPI : NSObject<UIApplicationDelegate> | 20 | @interface LetsGameAPI : NSObject<UIApplicationDelegate> |
21 | 21 | ||
22 | @property (nonatomic, strong) NSString *appId; | 22 | @property (nonatomic, strong) NSString *appId; |
23 | @property (nonatomic, strong) NSString *appKey; | 23 | @property (nonatomic, strong) NSString *appKey; |
24 | @property (nonatomic, copy) LSGLoginSuccBlock succBlock; | 24 | @property (nonatomic, copy) LSGLoginSuccBlock succBlock; |
25 | @property (nonatomic, copy) LSGDismissBlock dismissBlock; | 25 | @property (nonatomic, copy) LSGDismissBlock dismissBlock; |
26 | @property (nonatomic, assign) int isDebug; | 26 | @property (nonatomic, assign) int isDebug; |
27 | @property (nonatomic, assign) int decideWebPay; | 27 | @property (nonatomic, assign) int decideWebPay; |
28 | @property (nonatomic,retain) id<VKBridgeProtocol> vkBridge; | 28 | @property (nonatomic,retain) id<VKBridgeProtocol> vkBridge; |
29 | //@property(nonatomic,strong) NSString *version; | 29 | //@property(nonatomic,strong) NSString *version; |
30 | 30 | ||
31 | + (instancetype)instance; | 31 | + (instancetype)instance; |
32 | 32 | ||
33 | -(NSString*)version; | 33 | -(NSString*)version; |
34 | 34 | ||
35 | - (void)showLoginView; | 35 | - (void)showLoginView; |
36 | - (void)showLoginViewInView:(UIView *)view; | 36 | - (void)showLoginViewInView:(UIView *)view; |
37 | 37 | ||
38 | +(void)disableFB:(BOOL)isDisable; | 38 | +(void)disableFB:(BOOL)isDisable; |
39 | +(void)disableGoogle:(BOOL)isDisable; | 39 | +(void)disableGoogle:(BOOL)isDisable; |
40 | +(BOOL)isFBDisable; | 40 | +(BOOL)isFBDisable; |
41 | +(BOOL)isVKEnable; | 41 | +(BOOL)isVKEnable; |
42 | +(BOOL)isGoogleDisable; | 42 | +(BOOL)isGoogleDisable; |
43 | +(void)hiddenLogo:(BOOL)isHidden; | 43 | +(void)hiddenLogo:(BOOL)isHidden; |
44 | +(BOOL)isHiddenLogo; | 44 | +(BOOL)isHiddenLogo; |
45 | 45 | ||
46 | - (void)logout; | 46 | - (void)logout; |
47 | 47 | ||
48 | - (void)hide; | 48 | - (void)hide; |
49 | 49 | ||
50 | - (BOOL)handleOpenURL:(NSURL *)url | 50 | - (BOOL)handleOpenURL:(NSURL *)url |
51 | sourceApplication:(NSString *)sourceApplication; | 51 | sourceApplication:(NSString *)sourceApplication; |
52 | 52 | ||
53 | -(void)pay:(NSDictionary*) payInfo handleCallBack:(void (^)()) payAccomplistCallback; | 53 | -(void)pay:(NSDictionary*) payInfo handleCallBack:(void (^)()) payAccomplistCallback; |
54 | 54 | ||
55 | -(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid handleCallback:(void (^)(NSString* orderId)) callback; | 55 | -(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid handleCallback:(void (^)(NSString* orderId)) callback; |
56 | 56 | ||
57 | -(void)registeIapObserver; | 57 | -(void)registeIapObserver; |
58 | 58 | ||
59 | -(void)decideIsDebug:(int)isDebug; | 59 | -(void)decideIsDebug:(int)isDebug; |
60 | 60 | ||
61 | -(void)decideWebPayVersion:(int)decideWebPay; | 61 | -(void)decideWebPayVersion:(int)decideWebPay; |
62 | 62 | ||
63 | -(void)obtainAccessTokenSuccess:(void (^)(NSString *tokenString, NSString *refreshTime, NSString *expirationTime))success | 63 | -(void)obtainAccessTokenSuccess:(void (^)(NSString *tokenString, NSString *refreshTime, NSString *expirationTime))success |
64 | failure:(void (^)(NSString *errorString))failure; | 64 | failure:(void (^)(NSString *errorString))failure; |
65 | 65 | ||
66 | //获取是否展示安全页面,YES展示侵权页面,NO展示非侵权页面 | 66 | //获取是否展示安全页面,YES展示侵权页面,NO展示非侵权页面 |
67 | -(void)gameObtainSafeSetInfoWithAppId:(NSString *)appId | 67 | -(void)gameObtainSafeSetInfoWithAppId:(NSString *)appId |
68 | ChannelId:(NSString *)channelId | 68 | ChannelId:(NSString *)channelId |
69 | handleCallBack:(void (^)(BOOL resultStatus))callBack; | 69 | handleCallBack:(void (^)(BOOL resultStatus))callBack; |
70 | @end | 70 | @end |
71 | 71 |
ios/GameSDK.zip
No preview for this file type
ios/GameSDKDemo/GameSDKDemo.xcodeproj/project.xcworkspace/xcuserdata/yanglele.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ios/GameSDKDemo/letsgameDemo/LSGAppDelegate.m
1 | // | 1 | // |
2 | // LSGAppDelegate.m | 2 | // LSGAppDelegate.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 "LSGAppDelegate.h" | 9 | #import "LSGAppDelegate.h" |
10 | #import "LSGMainViewController.h" | 10 | #import "LSGMainViewController.h" |
11 | #import "LetsGameAPI.h" | 11 | #import "LetsGameAPI.h" |
12 | 12 | ||
13 | @implementation LSGAppDelegate | 13 | @implementation LSGAppDelegate |
14 | 14 | ||
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
16 | { | 16 | { |
17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
18 | 18 | ||
19 | LSGMainViewController *viewController = [[LSGMainViewController alloc] init]; | 19 | LSGMainViewController *viewController = [[LSGMainViewController alloc] init]; |
20 | self.window.rootViewController = viewController; | 20 | self.window.rootViewController = viewController; |
21 | [self.window addSubview:viewController.view]; | 21 | [self.window addSubview:viewController.view]; |
22 | 22 | ||
23 | self.window.backgroundColor = [UIColor whiteColor]; | 23 | self.window.backgroundColor = [UIColor whiteColor]; |
24 | [self.window makeKeyAndVisible]; | 24 | [self.window makeKeyAndVisible]; |
25 | //显示是否侵权的接口 | 25 | //显示是否侵权的接口 |
26 | // [[LetsGameAPI instance] gameObtainSafeSetInfoWithAppId:@"10056" ChannelId:@"1000" handleCallBack:^(BOOL resultStatus) { | 26 | // [[LetsGameAPI instance] gameObtainSafeSetInfoWithAppId:@"10056" ChannelId:@"1000" handleCallBack:^(BOOL resultStatus) { |
27 | // if (resultStatus) { | 27 | // if (resultStatus) { |
28 | // NSLog(@"YES 侵权"); | 28 | // NSLog(@"YES 侵权"); |
29 | // }else{ | 29 | // }else{ |
30 | // NSLog(@"NO 不侵权"); | 30 | // NSLog(@"NO 不侵权"); |
31 | // } | 31 | // } |
32 | // }]; | 32 | // }]; |
33 | |||
34 | [[UIApplication sharedApplication] setStatusBarHidden:YES]; | 33 | [[UIApplication sharedApplication] setStatusBarHidden:YES]; |
35 | [[LetsGameAPI instance] registeIapObserver]; | 34 | [[LetsGameAPI instance] registeIapObserver]; |
36 | 35 | ||
37 | 36 | ||
38 | return YES; | 37 | return YES; |
39 | } | 38 | } |
40 | 39 | ||
41 | - (void)applicationWillResignActive:(UIApplication *)application | 40 | - (void)applicationWillResignActive:(UIApplication *)application |
42 | { | 41 | { |
43 | // 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. | 42 | // 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. |
44 | // 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. | 43 | // 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. |
45 | } | 44 | } |
46 | 45 | ||
47 | - (void)applicationDidEnterBackground:(UIApplication *)application | 46 | - (void)applicationDidEnterBackground:(UIApplication *)application |
48 | { | 47 | { |
49 | // 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. | 48 | // 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. |
50 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | 49 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. |
51 | } | 50 | } |
52 | 51 | ||
53 | - (void)applicationWillEnterForeground:(UIApplication *)application | 52 | - (void)applicationWillEnterForeground:(UIApplication *)application |
54 | { | 53 | { |
55 | // 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. | 54 | // 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. |
56 | } | 55 | } |
57 | 56 | ||
58 | -(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ | 57 | -(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ |
59 | return [[LetsGameAPI instance] handleOpenURL:url sourceApplication:sourceApplication]; | 58 | return [[LetsGameAPI instance] handleOpenURL:url sourceApplication:sourceApplication]; |
60 | //return [[LetsGameAPI instance].vkBridge processOpenURL:url fromApplication:sourceApplication]; | 59 | //return [[LetsGameAPI instance].vkBridge processOpenURL:url fromApplication:sourceApplication]; |
61 | } | 60 | } |
62 | 61 | ||
63 | 62 | ||
64 | @end | 63 | @end |
65 | 64 |
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 = @"10056";//10047 | 85 | [LetsGameAPI instance].appId = @"10022";//10047 |
86 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//eccd9f7dc92858b741132fda313130cf | 86 | [LetsGameAPI instance].appKey = @"93a27b0bd99bac3e68a440b48aa421ab";//eccd9f7dc92858b741132fda313130cf |
87 | [LetsGameAPI hiddenLogo:YES]; | 87 | [LetsGameAPI hiddenLogo:YES]; |
88 | [LetsGameAPI disableFB:NO]; | 88 | [LetsGameAPI disableFB:NO]; |
89 | [LetsGameAPI disableGoogle:YES]; | 89 | [LetsGameAPI disableGoogle:NO]; |
90 | NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); | 90 | NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); |
91 | //启用vk登录 | 91 | //启用vk登录 |
92 | VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; | 92 | VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; |
93 | [LetsGameAPI instance].vkBridge = vkBridge; | 93 | [LetsGameAPI instance].vkBridge = vkBridge; |
94 | 94 | ||
95 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { | 95 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { |
96 | self.sessionKey = sessionKey; | 96 | self.sessionKey = sessionKey; |
97 | self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; | 97 | self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; |
98 | }; | 98 | }; |
99 | [LetsGameAPI instance].dismissBlock = ^() { | 99 | [LetsGameAPI instance].dismissBlock = ^() { |
100 | self.resultLabel.text = @"dismiss without login"; | 100 | self.resultLabel.text = @"dismiss without login"; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | [[LetsGameAPI instance] showLoginView]; | 103 | [[LetsGameAPI instance] showLoginView]; |
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | - (void)onLogoutTest { | 107 | - (void)onLogoutTest { |
108 | [LetsGameAPI instance].appId = @"10056"; | 108 | [LetsGameAPI instance].appId = @"10056"; |
109 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; | 109 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; |
110 | [[LetsGameAPI instance] logout]; | 110 | [[LetsGameAPI instance] logout]; |
111 | 111 | ||
112 | } | 112 | } |
113 | 113 | ||
114 | -(void)onPayTest{ | 114 | -(void)onPayTest{ |
115 | [LetsGameAPI instance].appId = @"10056";//10022 | 115 | [LetsGameAPI instance].appId = @"10056";//10022 |
116 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//93a27b0bd99bac3e68a440b48aa421ab | 116 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//93a27b0bd99bac3e68a440b48aa421ab |
117 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 117 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
118 | [payInfo setValue:@"100" forKey:@"serverId"]; | 118 | [payInfo setValue:@"100" forKey:@"serverId"]; |
119 | [payInfo setValue:@"10010" forKey:@"roleId"]; | 119 | [payInfo setValue:@"10010" forKey:@"roleId"]; |
120 | [payInfo setValue:@"1000" forKey:@"channelId"]; | 120 | [payInfo setValue:@"1000" forKey:@"channelId"]; |
121 | [payInfo setValue:@"10" forKey:@"amount"]; | 121 | [payInfo setValue:@"10" forKey:@"amount"]; |
122 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; | 122 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; |
123 | [payInfo setValue:@"test" forKey:@"product"]; | 123 | [payInfo setValue:@"test" forKey:@"product"]; |
124 | [payInfo setValue:@"76c17cc68ff9f7f40bd3d096ccc5600a" forKey:@"sessionKey"]; //self.sessionKey | 124 | [payInfo setValue:@"76c17cc68ff9f7f40bd3d096ccc5600a" forKey:@"sessionKey"]; //self.sessionKey |
125 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ | 125 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ |
126 | NSLog(@"第三方支付完成"); | 126 | NSLog(@"第三方支付完成"); |
127 | }]; | 127 | }]; |
128 | } | 128 | } |
129 | 129 | ||
130 | -(void)onIapTest{ | 130 | -(void)onIapTest{ |
131 | 131 | ||
132 | [LetsGameAPI instance].appId = @"10056"; | 132 | [LetsGameAPI instance].appId = @"10056"; |
133 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; | 133 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; |
134 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 134 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
135 | [payInfo setValue:@"5001" forKey:@"serverId"]; | 135 | [payInfo setValue:@"5001" forKey:@"serverId"]; |
136 | [payInfo setValue:@"10010" forKey:@"roleId"]; | 136 | [payInfo setValue:@"10010" forKey:@"roleId"]; |
137 | [payInfo setValue:@"1000" forKey:@"channelId"]; | 137 | [payInfo setValue:@"1000" forKey:@"channelId"]; |
138 | [payInfo setValue:@"10" forKey:@"amount"]; | 138 | [payInfo setValue:@"10" forKey:@"amount"]; |
139 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; | 139 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; |
140 | [payInfo setValue:@"test.product.1" forKey:@"product"]; | 140 | [payInfo setValue:@"test.product.1" forKey:@"product"]; |
141 | [[LetsGameAPI instance] iap:payInfo forUser:@"" handleCallback:^(NSString* orderId){ | 141 | [[LetsGameAPI instance] iap:payInfo forUser:@"" handleCallback:^(NSString* orderId){ |
142 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); | 142 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); |
143 | }]; | 143 | }]; |
144 | 144 | ||
145 | } | 145 | } |
146 | 146 | ||
147 | 147 | ||
148 | - (BOOL)shouldAutorotate { | 148 | - (BOOL)shouldAutorotate { |
149 | return YES; | 149 | return YES; |
150 | } | 150 | } |
151 | 151 | ||
152 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ | 152 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ |
153 | return UIInterfaceOrientationMaskAll; | 153 | return UIInterfaceOrientationMaskAll; |
154 | } | 154 | } |
155 | 155 | ||
156 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | 156 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
157 | return YES; | 157 | return YES; |
158 | } | 158 | } |
159 | 159 | ||
160 | @end | 160 | @end |
161 | 161 |