Showing
30 changed files
with
148 additions
and
228 deletions
PoolSdk_Demo/HaibaoSDK.framework/HaibaoSDK
0 → 100644
No preview for this file type
1 | -// | ||
2 | -// YouaiLoginInfo.h | ||
3 | -// YouaiSDK | ||
4 | -// | ||
5 | -// Created by 莫 东荣 on 13-4-10. | ||
6 | -// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | #import <Foundation/Foundation.h> | 1 | #import <Foundation/Foundation.h> |
10 | 2 | ||
11 | -@interface YouaiLoginInfo : NSObject //用户uid | 3 | +@interface HaibaoLoginInfo : NSObject //用户uid |
12 | { | 4 | { |
13 | // | 5 | // |
14 | NSString *openId; | 6 | NSString *openId; |
... | @@ -22,5 +14,5 @@ NSString *timestamp; | ... | @@ -22,5 +14,5 @@ NSString *timestamp; |
22 | @property(retain,nonatomic) NSString *openId; | 14 | @property(retain,nonatomic) NSString *openId; |
23 | @property(retain,nonatomic) NSString *token; | 15 | @property(retain,nonatomic) NSString *token; |
24 | @property(retain,nonatomic) NSString *timestamp; | 16 | @property(retain,nonatomic) NSString *timestamp; |
25 | -+ (YouaiLoginInfo *)getInstance; | ||
26 | -@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
17 | ++ (HaibaoLoginInfo *)getInstance; | ||
18 | +@end | ... | ... |
1 | +#import <UIKit/UIKit.h> | ||
2 | +#import "StoreKit/StoreKit.h" | ||
3 | + | ||
4 | +@interface HaibaoSDKMgr : NSObject | ||
5 | +{ | ||
6 | + NSString* appId_; | ||
7 | + NSString* appKey_; | ||
8 | + | ||
9 | + NSString* inviterCode_; | ||
10 | +} | ||
11 | + | ||
12 | +@property bool eatting; | ||
13 | + | ||
14 | ++ (HaibaoSDKMgr *)getInstance; | ||
15 | +- (void)initSDK; | ||
16 | + | ||
17 | +- (void)startLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller; | ||
18 | + | ||
19 | +- (void)setStyleName:(NSString*)styleName; | ||
20 | + | ||
21 | +- (void)startHimiko: (NSString *)serverId : (NSString *)nickName : (NSNumber *)amount : (NSString *)callBack : (UIViewController *)controller; | ||
22 | + | ||
23 | +- (void)startWithHimiko:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId; | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | +@end |
1 | -// | ||
2 | -// YouaiViewController.h | ||
3 | -// newYouaiSDK | ||
4 | -// | ||
5 | -// Created by Mog90 on 14-9-28. | ||
6 | -// Copyright (c) 2014年 东荣 莫. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | #import <UIKit/UIKit.h> | 1 | #import <UIKit/UIKit.h> |
10 | -#import "YouaiLoginInfo.h" | 2 | +#import "HaibaoLoginInfo.h" |
11 | #import <JavaScriptCore/JavaScriptCore.h> | 3 | #import <JavaScriptCore/JavaScriptCore.h> |
12 | 4 | ||
13 | -@interface YouaiViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate> | 5 | +@interface HaibaoViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate> |
14 | { | 6 | { |
15 | UIWebView *webView_; | 7 | UIWebView *webView_; |
16 | UIActivityIndicatorView *activityIndicator; | 8 | UIActivityIndicatorView *activityIndicator; | ... | ... |
No preview for this file type
No preview for this file type
No preview for this file type
... | @@ -15,7 +15,7 @@ | ... | @@ -15,7 +15,7 @@ |
15 | <key>CFBundlePackageType</key> | 15 | <key>CFBundlePackageType</key> |
16 | <string>APPL</string> | 16 | <string>APPL</string> |
17 | <key>CFBundleShortVersionString</key> | 17 | <key>CFBundleShortVersionString</key> |
18 | - <string>1</string> | 18 | + <string>1.1.408</string> |
19 | <key>CFBundleSignature</key> | 19 | <key>CFBundleSignature</key> |
20 | <string>????</string> | 20 | <string>????</string> |
21 | <key>CFBundleURLTypes</key> | 21 | <key>CFBundleURLTypes</key> |
... | @@ -30,7 +30,7 @@ | ... | @@ -30,7 +30,7 @@ |
30 | </dict> | 30 | </dict> |
31 | </array> | 31 | </array> |
32 | <key>CFBundleVersion</key> | 32 | <key>CFBundleVersion</key> |
33 | - <string>1</string> | 33 | + <string>2</string> |
34 | <key>LSRequiresIPhoneOS</key> | 34 | <key>LSRequiresIPhoneOS</key> |
35 | <true/> | 35 | <true/> |
36 | <key>NSAppTransportSecurity</key> | 36 | <key>NSAppTransportSecurity</key> | ... | ... |
... | @@ -8,9 +8,9 @@ | ... | @@ -8,9 +8,9 @@ |
8 | #include "SDKInterface.h" | 8 | #include "SDKInterface.h" |
9 | #import <UIKit/UIKit.h> | 9 | #import <UIKit/UIKit.h> |
10 | 10 | ||
11 | -#import "YouaiSDK/YouaiSDKMgr.h" | 11 | +#import "HaibaoSDK/HaibaoSDKMgr.h" |
12 | -#import "YouaiSDK/YouaiNotifications.h" | 12 | +#import "HaibaoSDK/HaibaoNotifications.h" |
13 | -#import "YouaiSDK/YouaiLoginInfo.h" | 13 | +#import "HaibaoSDK/HaibaoLoginInfo.h" |
14 | #import "TrackingIO.h" | 14 | #import "TrackingIO.h" |
15 | 15 | ||
16 | //SDK | 16 | //SDK |
... | @@ -24,18 +24,17 @@ int mExchange; | ... | @@ -24,18 +24,17 @@ int mExchange; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | 初始化SDK | 26 | 初始化SDK |
27 | -*/ | 27 | + */ |
28 | - (void)SDKinit:(UIViewController *) control | 28 | - (void)SDKinit:(UIViewController *) control |
29 | { | 29 | { |
30 | //必须继承 | 30 | //必须继承 |
31 | [super SDKinit:control]; | 31 | [super SDKinit:control]; |
32 | 32 | ||
33 | [PoolConfig getInstance]; | 33 | [PoolConfig getInstance]; |
34 | - [[YouaiSDKMgr getInstance]initSDK]; | 34 | + [[HaibaoSDKMgr getInstance]initSDK]; |
35 | -// [[YouaiSDKMgr getInstance]setServerUrl:@"http://123.207.86.242/"]; | 35 | + [[HaibaoSDKMgr getInstance]setStyleName:@"sdk"]; |
36 | -// [[YouaiSDKMgr getInstance]setStyleName:@"tg_new/sdk"]; | 36 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:haibaoLoginNotification object:nil]; |
37 | - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:youaiLoginNotification object:nil]; | 37 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HaibaoToolCallBack:) name:@"HaibaoToolCallBack" object:nil]; |
38 | - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youaiToolCallBack:) name:@"youaiToolCallBack" object:nil]; | ||
39 | 38 | ||
40 | [[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil]; | 39 | [[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil]; |
41 | 40 | ||
... | @@ -54,7 +53,7 @@ int mExchange; | ... | @@ -54,7 +53,7 @@ int mExchange; |
54 | NSLog(@"调用了LoginSDK"); | 53 | NSLog(@"调用了LoginSDK"); |
55 | NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"]; | 54 | NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"]; |
56 | NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"]; | 55 | NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"]; |
57 | - [[YouaiSDKMgr getInstance]openLogin:appId :appKey :self.controller]; | 56 | + [[HaibaoSDKMgr getInstance]startLogin:appId :appKey :self.controller]; |
58 | 57 | ||
59 | } | 58 | } |
60 | 59 | ||
... | @@ -65,9 +64,9 @@ int mExchange; | ... | @@ -65,9 +64,9 @@ int mExchange; |
65 | { | 64 | { |
66 | NSLog(@"loginchek"); | 65 | NSLog(@"loginchek"); |
67 | PoolLoginInfo *loginInfo = [PoolLoginInfo alloc]; | 66 | PoolLoginInfo *loginInfo = [PoolLoginInfo alloc]; |
68 | - loginInfo.openId = [[YouaiLoginInfo getInstance]openId]; | 67 | + loginInfo.openId = [[HaibaoLoginInfo getInstance]openId]; |
69 | - loginInfo.sign = [[YouaiLoginInfo getInstance] token]; | 68 | + loginInfo.sign = [[HaibaoLoginInfo getInstance] token]; |
70 | - loginInfo.timestamp = [YouaiLoginInfo getInstance].timestamp; | 69 | + loginInfo.timestamp = [HaibaoLoginInfo getInstance].timestamp; |
71 | 70 | ||
72 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ | 71 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ |
73 | [[PoolChecker getInstance] startCheck:loginInfo]; | 72 | [[PoolChecker getInstance] startCheck:loginInfo]; |
... | @@ -91,15 +90,15 @@ int mExchange; | ... | @@ -91,15 +90,15 @@ int mExchange; |
91 | 苹果支付结果回调 | 90 | 苹果支付结果回调 |
92 | */ | 91 | */ |
93 | 92 | ||
94 | -- (void)youaiToolCallBack:(NSNotification *)notification | 93 | +- (void)HaibaoToolCallBack:(NSNotification *)notification |
95 | { | 94 | { |
96 | NSDictionary* payResultDic = notification.object; | 95 | NSDictionary* payResultDic = notification.object; |
97 | - | 96 | + |
98 | - NSString* receiptStr = [payResultDic objectForKey:@"youaiToolResult"]; | 97 | + NSString* receiptStr = [payResultDic objectForKey:@"HaibaoToolResult"]; |
99 | NSString* queryId = [payResultDic objectForKey:@"query_id"]; | 98 | NSString* queryId = [payResultDic objectForKey:@"query_id"]; |
100 | 99 | ||
101 | NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil]; | 100 | NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil]; |
102 | - NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic]; | 101 | + NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic]; |
103 | 102 | ||
104 | 103 | ||
105 | if([@"success" isEqualToString:result]){//确认订单成功 | 104 | if([@"success" isEqualToString:result]){//确认订单成功 |
... | @@ -149,7 +148,7 @@ int mExchange; | ... | @@ -149,7 +148,7 @@ int mExchange; |
149 | if ([reportType isEqualToString:REPORT_ENTER]) { | 148 | if ([reportType isEqualToString:REPORT_ENTER]) { |
150 | [TrackingIO setLoginWithAccountID:[reportInfo playerId]]; | 149 | [TrackingIO setLoginWithAccountID:[reportInfo playerId]]; |
151 | 150 | ||
152 | - dispatch_async(dispatch_get_global_queue(0, 0), ^{ | 151 | + dispatch_async(dispatch_get_global_queue(0, 0), ^{ |
153 | [self handlerLeakOrder]; | 152 | [self handlerLeakOrder]; |
154 | }); | 153 | }); |
155 | }else if ([reportType isEqualToString:REPORT_CREATEROLE]){ | 154 | }else if ([reportType isEqualToString:REPORT_CREATEROLE]){ |
... | @@ -185,7 +184,7 @@ int mExchange; | ... | @@ -185,7 +184,7 @@ int mExchange; |
185 | - (void) handlerLeakOrder{ | 184 | - (void) handlerLeakOrder{ |
186 | NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults]; | 185 | NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults]; |
187 | NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"]; | 186 | NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"]; |
188 | - | 187 | + |
189 | NSLog(@"orderDic%@",queryIdArray); | 188 | NSLog(@"orderDic%@",queryIdArray); |
190 | NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; | 189 | NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; |
191 | NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];//补单失败的queryid集合 | 190 | NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];//补单失败的queryid集合 |
... | @@ -229,10 +228,10 @@ int mExchange; | ... | @@ -229,10 +228,10 @@ int mExchange; |
229 | NSString *other = [payInfo other]; | 228 | NSString *other = [payInfo other]; |
230 | 229 | ||
231 | if (other && [other length] > 0) { | 230 | if (other && [other length] > 0) { |
232 | - [[YouaiSDKMgr getInstance] openUtil:serverId :roleName :amount :[payInfo queryId] :self.controller]; | 231 | + [[HaibaoSDKMgr getInstance] startHimiko:serverId :roleName :amount :[payInfo queryId] :self.controller]; |
233 | }else{ | 232 | }else{ |
234 | NSString* products = [payInfo products]; | 233 | NSString* products = [payInfo products]; |
235 | - [[YouaiSDKMgr getInstance] openWithUtil:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId]; | 234 | + [[HaibaoSDKMgr getInstance] startWithHimiko:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId]; |
236 | } | 235 | } |
237 | } | 236 | } |
238 | 237 | ||
... | @@ -242,3 +241,4 @@ int mExchange; | ... | @@ -242,3 +241,4 @@ int mExchange; |
242 | } | 241 | } |
243 | 242 | ||
244 | @end | 243 | @end |
244 | + | ... | ... |
PoolSdk_Demo/poolsdk_file/poolsdk/YouaiSDK.framework/Headers/YouaiNotifications.h
deleted
100755 → 0
1 | -// | ||
2 | -// YouaiNotifications.h | ||
3 | -// YouaiSDK | ||
4 | -// | ||
5 | -// Created by 莫 东荣 on 13-4-10. | ||
6 | -// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import <Foundation/Foundation.h> | ||
10 | - | ||
11 | -extern NSString * const youaiExitNotification; /**< 退出 */ | ||
12 | -extern NSString * const youaiLoginNotification; /**< 登录完成的通知*/ | ||
13 | -extern NSString * const youaiErrorNotification; /**< 出错 */ | ||
14 | - | ||
15 | - | ||
16 | -@interface YouaiNotifications : NSObject | ||
17 | - | ||
18 | -@end |
1 | -// | ||
2 | -// YouaiSDKMgr.h | ||
3 | -// YouaiSDK | ||
4 | -// | ||
5 | -// Created by 莫 东荣 on 13-4-9. | ||
6 | -// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import <UIKit/UIKit.h> | ||
10 | -#import "StoreKit/StoreKit.h" | ||
11 | - | ||
12 | -@interface YouaiSDKMgr : NSObject | ||
13 | -{ | ||
14 | - NSString* appId_; | ||
15 | - NSString* appKey_; | ||
16 | - | ||
17 | - NSString* inviterCode_; | ||
18 | -} | ||
19 | - | ||
20 | -@property bool appleing; | ||
21 | - | ||
22 | -+ (YouaiSDKMgr *)getInstance; | ||
23 | -- (void)initSDK; | ||
24 | -- (void)setServerUrl:(NSString *)serverUrl; | ||
25 | - | ||
26 | -- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller; | ||
27 | -- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *) inviterCode; | ||
28 | - | ||
29 | -- (void)setStyleName:(NSString*)styleName; | ||
30 | - | ||
31 | - | ||
32 | -- (void)openUtil: (NSString *)serverId : (NSString *)nickName : (NSString *)callBack : (UIViewController *)controller; | ||
33 | -- (void)openUtil: (NSString *)serverId : (NSString *)nickName : (NSNumber *)amount : (NSString *)callBack : (UIViewController *)controller; | ||
34 | - | ||
35 | -- (void)openWithUtil:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId; | ||
36 | - | ||
37 | - | ||
38 | - | ||
39 | -@end |
No preview for this file type
1 | -{"renyunAppKey": "1", "payorderurl": "https://public.sdk.gzyouai.com/paycheck/create", "usertype": 150, "sdkSimpleName": "apple_youyu", "gamechannelid": "", "APP_KEY": "c2ca9a68f83dc5ef0abb05ac2812688f", "custom": "{}", "sdkVersionCode": "V1_0", "loginCheckUrl": "https://public.sdk.gzyouai.com/logincheck/check", "appScheme": "com.qyj.ios.xw", "c2": "", "c1": "", "APP_ID": "5a449269792fd859a395b1b7", "paycheckurl": "https://public.sdk.gzyouai.com/paycheck/confirm", "gameSimpleName": "fytx_test"} | 1 | +{"renyunAppKey": "edac9e6bf2fc5eb8423af546c129d284", "payorderurl": "https://public.sdk.gzyouai.com/paycheck/create", "usertype": 150, "sdkSimpleName": "apple_youyu", "gamechannelid": "", "APP_KEY": "d724b75942454a0825caee31f51d4774", "custom": "{}", "sdkVersionCode": "V1_1", "loginCheckUrl": "https://public.sdk.gzyouai.com/logincheck/check", "appScheme": "com.jghb.xinqinji", "c2": "", "c1": "", "APP_ID": "5a2df3c7f0d7700a6f4124ca", "paycheckurl": "https://public.sdk.gzyouai.com/paycheck/confirm", "gameSimpleName": "xqj_hb"} | ... | ... |
No preview for this file type
No preview for this file type
1 | -// | ||
2 | -// YouaiLoginInfo.h | ||
3 | -// YouaiSDK | ||
4 | -// | ||
5 | -// Created by 莫 东荣 on 13-4-10. | ||
6 | -// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | #import <Foundation/Foundation.h> | 1 | #import <Foundation/Foundation.h> |
10 | 2 | ||
11 | -@interface YouaiLoginInfo : NSObject //用户uid | 3 | +@interface HaibaoLoginInfo : NSObject //用户uid |
12 | { | 4 | { |
13 | // | 5 | // |
14 | NSString *openId; | 6 | NSString *openId; |
... | @@ -22,5 +14,5 @@ NSString *timestamp; | ... | @@ -22,5 +14,5 @@ NSString *timestamp; |
22 | @property(retain,nonatomic) NSString *openId; | 14 | @property(retain,nonatomic) NSString *openId; |
23 | @property(retain,nonatomic) NSString *token; | 15 | @property(retain,nonatomic) NSString *token; |
24 | @property(retain,nonatomic) NSString *timestamp; | 16 | @property(retain,nonatomic) NSString *timestamp; |
25 | -+ (YouaiLoginInfo *)getInstance; | ||
26 | -@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
17 | ++ (HaibaoLoginInfo *)getInstance; | ||
18 | +@end | ... | ... |
1 | +#import <UIKit/UIKit.h> | ||
2 | +#import "StoreKit/StoreKit.h" | ||
3 | + | ||
4 | +@interface HaibaoSDKMgr : NSObject | ||
5 | +{ | ||
6 | + NSString* appId_; | ||
7 | + NSString* appKey_; | ||
8 | + | ||
9 | + NSString* inviterCode_; | ||
10 | +} | ||
11 | + | ||
12 | +@property bool eatting; | ||
13 | + | ||
14 | ++ (HaibaoSDKMgr *)getInstance; | ||
15 | +- (void)initSDK; | ||
16 | + | ||
17 | +- (void)startLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller; | ||
18 | + | ||
19 | +- (void)setStyleName:(NSString*)styleName; | ||
20 | + | ||
21 | +- (void)startHimiko: (NSString *)serverId : (NSString *)nickName : (NSNumber *)amount : (NSString *)callBack : (UIViewController *)controller; | ||
22 | + | ||
23 | +- (void)startWithHimiko:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId; | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | +@end |
1 | -// | ||
2 | -// YouaiViewController.h | ||
3 | -// newYouaiSDK | ||
4 | -// | ||
5 | -// Created by Mog90 on 14-9-28. | ||
6 | -// Copyright (c) 2014年 东荣 莫. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | #import <UIKit/UIKit.h> | 1 | #import <UIKit/UIKit.h> |
10 | -#import "YouaiLoginInfo.h" | 2 | +#import "HaibaoLoginInfo.h" |
11 | #import <JavaScriptCore/JavaScriptCore.h> | 3 | #import <JavaScriptCore/JavaScriptCore.h> |
12 | 4 | ||
13 | -@interface YouaiViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate> | 5 | +@interface HaibaoViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate> |
14 | { | 6 | { |
15 | UIWebView *webView_; | 7 | UIWebView *webView_; |
16 | UIActivityIndicatorView *activityIndicator; | 8 | UIActivityIndicatorView *activityIndicator; | ... | ... |
No preview for this file type
... | @@ -8,9 +8,9 @@ | ... | @@ -8,9 +8,9 @@ |
8 | #include "SDKInterface.h" | 8 | #include "SDKInterface.h" |
9 | #import <UIKit/UIKit.h> | 9 | #import <UIKit/UIKit.h> |
10 | 10 | ||
11 | -#import "YouaiSDK/YouaiSDKMgr.h" | 11 | +#import "HaibaoSDK/HaibaoSDKMgr.h" |
12 | -#import "YouaiSDK/YouaiNotifications.h" | 12 | +#import "HaibaoSDK/HaibaoNotifications.h" |
13 | -#import "YouaiSDK/YouaiLoginInfo.h" | 13 | +#import "HaibaoSDK/HaibaoLoginInfo.h" |
14 | #import "TrackingIO.h" | 14 | #import "TrackingIO.h" |
15 | 15 | ||
16 | //SDK | 16 | //SDK |
... | @@ -24,17 +24,17 @@ int mExchange; | ... | @@ -24,17 +24,17 @@ int mExchange; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | 初始化SDK | 26 | 初始化SDK |
27 | -*/ | 27 | + */ |
28 | - (void)SDKinit:(UIViewController *) control | 28 | - (void)SDKinit:(UIViewController *) control |
29 | { | 29 | { |
30 | //必须继承 | 30 | //必须继承 |
31 | [super SDKinit:control]; | 31 | [super SDKinit:control]; |
32 | 32 | ||
33 | [PoolConfig getInstance]; | 33 | [PoolConfig getInstance]; |
34 | - [[YouaiSDKMgr getInstance]initSDK]; | 34 | + [[HaibaoSDKMgr getInstance]initSDK]; |
35 | - [[YouaiSDKMgr getInstance]setStyleName:@"sdk"]; | 35 | + [[HaibaoSDKMgr getInstance]setStyleName:@"sdk"]; |
36 | - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:youaiLoginNotification object:nil]; | 36 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:haibaoLoginNotification object:nil]; |
37 | - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youaiToolCallBack:) name:@"youaiToolCallBack" object:nil]; | 37 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HaibaoToolCallBack:) name:@"HaibaoToolCallBack" object:nil]; |
38 | 38 | ||
39 | [[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil]; | 39 | [[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil]; |
40 | 40 | ||
... | @@ -53,7 +53,7 @@ int mExchange; | ... | @@ -53,7 +53,7 @@ int mExchange; |
53 | NSLog(@"调用了LoginSDK"); | 53 | NSLog(@"调用了LoginSDK"); |
54 | NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"]; | 54 | NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"]; |
55 | NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"]; | 55 | NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"]; |
56 | - [[YouaiSDKMgr getInstance]openLogin:appId :appKey :self.controller]; | 56 | + [[HaibaoSDKMgr getInstance]startLogin:appId :appKey :self.controller]; |
57 | 57 | ||
58 | } | 58 | } |
59 | 59 | ||
... | @@ -64,9 +64,9 @@ int mExchange; | ... | @@ -64,9 +64,9 @@ int mExchange; |
64 | { | 64 | { |
65 | NSLog(@"loginchek"); | 65 | NSLog(@"loginchek"); |
66 | PoolLoginInfo *loginInfo = [PoolLoginInfo alloc]; | 66 | PoolLoginInfo *loginInfo = [PoolLoginInfo alloc]; |
67 | - loginInfo.openId = [[YouaiLoginInfo getInstance]openId]; | 67 | + loginInfo.openId = [[HaibaoLoginInfo getInstance]openId]; |
68 | - loginInfo.sign = [[YouaiLoginInfo getInstance] token]; | 68 | + loginInfo.sign = [[HaibaoLoginInfo getInstance] token]; |
69 | - loginInfo.timestamp = [YouaiLoginInfo getInstance].timestamp; | 69 | + loginInfo.timestamp = [HaibaoLoginInfo getInstance].timestamp; |
70 | 70 | ||
71 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ | 71 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ |
72 | [[PoolChecker getInstance] startCheck:loginInfo]; | 72 | [[PoolChecker getInstance] startCheck:loginInfo]; |
... | @@ -90,15 +90,15 @@ int mExchange; | ... | @@ -90,15 +90,15 @@ int mExchange; |
90 | 苹果支付结果回调 | 90 | 苹果支付结果回调 |
91 | */ | 91 | */ |
92 | 92 | ||
93 | -- (void)youaiToolCallBack:(NSNotification *)notification | 93 | +- (void)HaibaoToolCallBack:(NSNotification *)notification |
94 | { | 94 | { |
95 | NSDictionary* payResultDic = notification.object; | 95 | NSDictionary* payResultDic = notification.object; |
96 | - | 96 | + |
97 | - NSString* receiptStr = [payResultDic objectForKey:@"youaiToolResult"]; | 97 | + NSString* receiptStr = [payResultDic objectForKey:@"HaibaoToolResult"]; |
98 | NSString* queryId = [payResultDic objectForKey:@"query_id"]; | 98 | NSString* queryId = [payResultDic objectForKey:@"query_id"]; |
99 | 99 | ||
100 | NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil]; | 100 | NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil]; |
101 | - NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic]; | 101 | + NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic]; |
102 | 102 | ||
103 | 103 | ||
104 | if([@"success" isEqualToString:result]){//确认订单成功 | 104 | if([@"success" isEqualToString:result]){//确认订单成功 |
... | @@ -148,7 +148,7 @@ int mExchange; | ... | @@ -148,7 +148,7 @@ int mExchange; |
148 | if ([reportType isEqualToString:REPORT_ENTER]) { | 148 | if ([reportType isEqualToString:REPORT_ENTER]) { |
149 | [TrackingIO setLoginWithAccountID:[reportInfo playerId]]; | 149 | [TrackingIO setLoginWithAccountID:[reportInfo playerId]]; |
150 | 150 | ||
151 | - dispatch_async(dispatch_get_global_queue(0, 0), ^{ | 151 | + dispatch_async(dispatch_get_global_queue(0, 0), ^{ |
152 | [self handlerLeakOrder]; | 152 | [self handlerLeakOrder]; |
153 | }); | 153 | }); |
154 | }else if ([reportType isEqualToString:REPORT_CREATEROLE]){ | 154 | }else if ([reportType isEqualToString:REPORT_CREATEROLE]){ |
... | @@ -184,7 +184,7 @@ int mExchange; | ... | @@ -184,7 +184,7 @@ int mExchange; |
184 | - (void) handlerLeakOrder{ | 184 | - (void) handlerLeakOrder{ |
185 | NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults]; | 185 | NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults]; |
186 | NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"]; | 186 | NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"]; |
187 | - | 187 | + |
188 | NSLog(@"orderDic%@",queryIdArray); | 188 | NSLog(@"orderDic%@",queryIdArray); |
189 | NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; | 189 | NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; |
190 | NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];//补单失败的queryid集合 | 190 | NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];//补单失败的queryid集合 |
... | @@ -228,10 +228,10 @@ int mExchange; | ... | @@ -228,10 +228,10 @@ int mExchange; |
228 | NSString *other = [payInfo other]; | 228 | NSString *other = [payInfo other]; |
229 | 229 | ||
230 | if (other && [other length] > 0) { | 230 | if (other && [other length] > 0) { |
231 | - [[YouaiSDKMgr getInstance] openUtil:serverId :roleName :amount :[payInfo queryId] :self.controller]; | 231 | + [[HaibaoSDKMgr getInstance] startHimiko:serverId :roleName :amount :[payInfo queryId] :self.controller]; |
232 | }else{ | 232 | }else{ |
233 | NSString* products = [payInfo products]; | 233 | NSString* products = [payInfo products]; |
234 | - [[YouaiSDKMgr getInstance] openWithUtil:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId]; | 234 | + [[HaibaoSDKMgr getInstance] startWithHimiko:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId]; |
235 | } | 235 | } |
236 | } | 236 | } |
237 | 237 | ||
... | @@ -241,3 +241,4 @@ int mExchange; | ... | @@ -241,3 +241,4 @@ int mExchange; |
241 | } | 241 | } |
242 | 242 | ||
243 | @end | 243 | @end |
244 | + | ... | ... |
1 | -// | ||
2 | -// YouaiNotifications.h | ||
3 | -// YouaiSDK | ||
4 | -// | ||
5 | -// Created by 莫 东荣 on 13-4-10. | ||
6 | -// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import <Foundation/Foundation.h> | ||
10 | - | ||
11 | -extern NSString * const youaiExitNotification; /**< 退出 */ | ||
12 | -extern NSString * const youaiLoginNotification; /**< 登录完成的通知*/ | ||
13 | -extern NSString * const youaiErrorNotification; /**< 出错 */ | ||
14 | - | ||
15 | - | ||
16 | -@interface YouaiNotifications : NSObject | ||
17 | - | ||
18 | -@end |
1 | -// | ||
2 | -// YouaiSDKMgr.h | ||
3 | -// YouaiSDK | ||
4 | -// | ||
5 | -// Created by 莫 东荣 on 13-4-9. | ||
6 | -// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | -// | ||
8 | - | ||
9 | -#import <UIKit/UIKit.h> | ||
10 | -#import "StoreKit/StoreKit.h" | ||
11 | - | ||
12 | -@interface YouaiSDKMgr : NSObject | ||
13 | -{ | ||
14 | - NSString* appId_; | ||
15 | - NSString* appKey_; | ||
16 | - | ||
17 | - NSString* inviterCode_; | ||
18 | -} | ||
19 | - | ||
20 | -@property bool appleing; | ||
21 | - | ||
22 | -+ (YouaiSDKMgr *)getInstance; | ||
23 | -- (void)initSDK; | ||
24 | -- (void)setServerUrl:(NSString *)serverUrl; | ||
25 | - | ||
26 | -- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller; | ||
27 | -- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *) inviterCode; | ||
28 | - | ||
29 | -- (void)setStyleName:(NSString*)styleName; | ||
30 | - | ||
31 | - | ||
32 | -- (void)openUtil: (NSString *)serverId : (NSString *)nickName : (NSString *)callBack : (UIViewController *)controller; | ||
33 | -- (void)openUtil: (NSString *)serverId : (NSString *)nickName : (NSNumber *)amount : (NSString *)callBack : (UIViewController *)controller; | ||
34 | - | ||
35 | -- (void)openWithUtil:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId; | ||
36 | - | ||
37 | - | ||
38 | - | ||
39 | -@end |
No preview for this file type
-
Please register or login to post a comment