Commit 730d2b7066131115237fbe482c730d0ca502bcea
1 parent
f1dc4bfa90
Exists in
master
v3.4.4版本修改提交
Showing 5 changed files with 1 additions and 2 deletions Inline Diff
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 hiddenLogo = NO; | 14 | static BOOL hiddenLogo = NO; |
15 | 15 | ||
16 | static NSString *version = @"3.4.3"; | 16 | static NSString *version = @"3.4.4"; |
17 | 17 | ||
18 | @interface LetsGameAPI : NSObject<UIApplicationDelegate> | 18 | @interface LetsGameAPI : NSObject<UIApplicationDelegate> |
19 | 19 | ||
20 | @property (nonatomic, strong) NSString *appId; | 20 | @property (nonatomic, strong) NSString *appId; |
21 | @property (nonatomic, strong) NSString *appKey; | 21 | @property (nonatomic, strong) NSString *appKey; |
22 | @property (nonatomic, copy) LSGLoginSuccBlock succBlock; | 22 | @property (nonatomic, copy) LSGLoginSuccBlock succBlock; |
23 | @property (nonatomic, copy) LSGDismissBlock dismissBlock; | 23 | @property (nonatomic, copy) LSGDismissBlock dismissBlock; |
24 | @property (nonatomic, assign) int isDebug; | 24 | @property (nonatomic, assign) int isDebug; |
25 | @property (nonatomic, assign) int decideWebPay; | 25 | @property (nonatomic, assign) int decideWebPay; |
26 | @property (nonatomic,retain) id<VKBridgeProtocol> vkBridge; | 26 | @property (nonatomic,retain) id<VKBridgeProtocol> vkBridge; |
27 | //@property(nonatomic,strong) NSString *version; | 27 | //@property(nonatomic,strong) NSString *version; |
28 | 28 | ||
29 | + (instancetype)instance; | 29 | + (instancetype)instance; |
30 | 30 | ||
31 | -(NSString*)version; | 31 | -(NSString*)version; |
32 | 32 | ||
33 | - (void)showLoginView; | 33 | - (void)showLoginView; |
34 | - (void)showLoginViewInView:(UIView *)view; | 34 | - (void)showLoginViewInView:(UIView *)view; |
35 | 35 | ||
36 | +(void)disableFB:(BOOL)isDisable; | 36 | +(void)disableFB:(BOOL)isDisable; |
37 | +(BOOL)isFBDisable; | 37 | +(BOOL)isFBDisable; |
38 | +(BOOL)isVKEnable; | 38 | +(BOOL)isVKEnable; |
39 | +(void)hiddenLogo:(BOOL)isHidden; | 39 | +(void)hiddenLogo:(BOOL)isHidden; |
40 | +(BOOL)isHiddenLogo; | 40 | +(BOOL)isHiddenLogo; |
41 | 41 | ||
42 | - (void)logout; | 42 | - (void)logout; |
43 | 43 | ||
44 | - (void)hide; | 44 | - (void)hide; |
45 | 45 | ||
46 | - (BOOL)handleOpenURL:(NSURL *)url | 46 | - (BOOL)handleOpenURL:(NSURL *)url |
47 | sourceApplication:(NSString *)sourceApplication; | 47 | sourceApplication:(NSString *)sourceApplication; |
48 | 48 | ||
49 | -(void)pay:(NSDictionary*) payInfo handleCallBack:(void (^)()) payAccomplistCallback; | 49 | -(void)pay:(NSDictionary*) payInfo handleCallBack:(void (^)()) payAccomplistCallback; |
50 | 50 | ||
51 | -(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid handleCallback:(void (^)(NSString* orderId)) callback; | 51 | -(void)iap:(NSDictionary*) payInfo forUser:(NSString*) uid handleCallback:(void (^)(NSString* orderId)) callback; |
52 | 52 | ||
53 | -(void)registeIapObserver; | 53 | -(void)registeIapObserver; |
54 | 54 | ||
55 | -(void)decideIsDebug:(int)isDebug; | 55 | -(void)decideIsDebug:(int)isDebug; |
56 | 56 | ||
57 | -(void)decideWebPayVersion:(int)decideWebPay; | 57 | -(void)decideWebPayVersion:(int)decideWebPay; |
58 | 58 | ||
59 | -(void)obtainAccessTokenSuccess:(void (^)(NSString *tokenString, NSString *refreshTime, NSString *expirationTime))success | 59 | -(void)obtainAccessTokenSuccess:(void (^)(NSString *tokenString, NSString *refreshTime, NSString *expirationTime))success |
60 | failure:(void (^)(NSString *errorString))failure; | 60 | failure:(void (^)(NSString *errorString))failure; |
61 | 61 | ||
62 | //获取是否展示安全页面,YES展示侵权页面,NO展示非侵权页面 | 62 | //获取是否展示安全页面,YES展示侵权页面,NO展示非侵权页面 |
63 | -(void)gameObtainSafeSetInfoWithAppId:(NSString *)appId | 63 | -(void)gameObtainSafeSetInfoWithAppId:(NSString *)appId |
64 | ChannelId:(NSString *)channelId | 64 | ChannelId:(NSString *)channelId |
65 | handleCallBack:(void (^)(BOOL resultStatus))callBack; | 65 | handleCallBack:(void (^)(BOOL resultStatus))callBack; |
66 | @end | 66 | @end |
67 | 67 |
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/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 = @"10056";//10047 |
86 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//eccd9f7dc92858b741132fda313130cf | 86 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//eccd9f7dc92858b741132fda313130cf |
87 | [LetsGameAPI hiddenLogo:YES]; | 87 | [LetsGameAPI hiddenLogo:YES]; |
88 | // [LetsGameAPI disableFB:NO]; | 88 | // [LetsGameAPI disableFB:NO]; |
89 | NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); | 89 | NSLog(@"sdk version:%@",[[LetsGameAPI instance] version]); |
90 | //启用vk登录 | 90 | //启用vk登录 |
91 | VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; | 91 | VKBridge *vkBridge = [[VKBridge alloc] initWithVKAppId:@"5029792"]; |
92 | [LetsGameAPI instance].vkBridge = vkBridge; | 92 | [LetsGameAPI instance].vkBridge = vkBridge; |
93 | 93 | ||
94 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { | 94 | [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { |
95 | self.sessionKey = sessionKey; | 95 | self.sessionKey = sessionKey; |
96 | self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; | 96 | self.resultLabel.text = [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %ld", userId, sessionKey, type]; |
97 | }; | 97 | }; |
98 | [LetsGameAPI instance].dismissBlock = ^() { | 98 | [LetsGameAPI instance].dismissBlock = ^() { |
99 | self.resultLabel.text = @"dismiss without login"; | 99 | self.resultLabel.text = @"dismiss without login"; |
100 | }; | 100 | }; |
101 | 101 | ||
102 | [[LetsGameAPI instance] showLoginView]; | 102 | [[LetsGameAPI instance] showLoginView]; |
103 | } | 103 | } |
104 | 104 | ||
105 | 105 | ||
106 | - (void)onLogoutTest { | 106 | - (void)onLogoutTest { |
107 | [LetsGameAPI instance].appId = @"10056"; | 107 | [LetsGameAPI instance].appId = @"10056"; |
108 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; | 108 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; |
109 | [[LetsGameAPI instance] logout]; | 109 | [[LetsGameAPI instance] logout]; |
110 | 110 | ||
111 | } | 111 | } |
112 | 112 | ||
113 | -(void)onPayTest{ | 113 | -(void)onPayTest{ |
114 | [LetsGameAPI instance].appId = @"10056";//10022 | 114 | [LetsGameAPI instance].appId = @"10056";//10022 |
115 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//93a27b0bd99bac3e68a440b48aa421ab | 115 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21";//93a27b0bd99bac3e68a440b48aa421ab |
116 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 116 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
117 | [payInfo setValue:@"100" forKey:@"serverId"]; | 117 | [payInfo setValue:@"100" forKey:@"serverId"]; |
118 | [payInfo setValue:@"10010" forKey:@"roleId"]; | 118 | [payInfo setValue:@"10010" forKey:@"roleId"]; |
119 | [payInfo setValue:@"1000" forKey:@"channelId"]; | 119 | [payInfo setValue:@"1000" forKey:@"channelId"]; |
120 | [payInfo setValue:@"10" forKey:@"amount"]; | 120 | [payInfo setValue:@"10" forKey:@"amount"]; |
121 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; | 121 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; |
122 | [payInfo setValue:@"test" forKey:@"product"]; | 122 | [payInfo setValue:@"test" forKey:@"product"]; |
123 | [payInfo setValue:@"76c17cc68ff9f7f40bd3d096ccc5600a" forKey:@"sessionKey"]; //self.sessionKey | 123 | [payInfo setValue:@"76c17cc68ff9f7f40bd3d096ccc5600a" forKey:@"sessionKey"]; //self.sessionKey |
124 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ | 124 | [[LetsGameAPI instance] pay:payInfo handleCallBack:^{ |
125 | NSLog(@"第三方支付完成"); | 125 | NSLog(@"第三方支付完成"); |
126 | }]; | 126 | }]; |
127 | } | 127 | } |
128 | 128 | ||
129 | -(void)onIapTest{ | 129 | -(void)onIapTest{ |
130 | |||
131 | [LetsGameAPI instance].appId = @"10056"; | 130 | [LetsGameAPI instance].appId = @"10056"; |
132 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; | 131 | [LetsGameAPI instance].appKey = @"b59c21a078fde074a6750e91ed19fb21"; |
133 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; | 132 | NSMutableDictionary *payInfo = [NSMutableDictionary dictionary]; |
134 | [payInfo setValue:@"5001" forKey:@"serverId"]; | 133 | [payInfo setValue:@"5001" forKey:@"serverId"]; |
135 | [payInfo setValue:@"10010" forKey:@"roleId"]; | 134 | [payInfo setValue:@"10010" forKey:@"roleId"]; |
136 | [payInfo setValue:@"1000" forKey:@"channelId"]; | 135 | [payInfo setValue:@"1000" forKey:@"channelId"]; |
137 | [payInfo setValue:@"10" forKey:@"amount"]; | 136 | [payInfo setValue:@"10" forKey:@"amount"]; |
138 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; | 137 | [payInfo setValue:@"ios demo" forKey:@"extraInfo"]; |
139 | [payInfo setValue:@"test.product.1" forKey:@"product"]; | 138 | [payInfo setValue:@"test.product.1" forKey:@"product"]; |
140 | [[LetsGameAPI instance] iap:payInfo forUser:@"" handleCallback:^(NSString* orderId){ | 139 | [[LetsGameAPI instance] iap:payInfo forUser:@"" handleCallback:^(NSString* orderId){ |
141 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); | 140 | NSLog(@"IAP completed orderId of Gumptech:%@",orderId); |
142 | }]; | 141 | }]; |
143 | } | 142 | } |
144 | 143 | ||
145 | 144 | ||
146 | - (BOOL)shouldAutorotate { | 145 | - (BOOL)shouldAutorotate { |
147 | return YES; | 146 | return YES; |
148 | } | 147 | } |
149 | 148 | ||
150 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ | 149 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations{ |
151 | return UIInterfaceOrientationMaskAll; | 150 | return UIInterfaceOrientationMaskAll; |
152 | } | 151 | } |
153 | 152 | ||
154 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | 153 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
155 | return YES; | 154 | return YES; |
156 | } | 155 | } |
157 | 156 | ||
158 | @end | 157 | @end |
159 | 158 |