lizhihui

更新为海豹SDK

Showing 30 changed files with 148 additions and 228 deletions
No preview for this file type
#import <UIKit/UIKit.h>
@interface HaibaoGetWifiMac : NSObject
+ (NSString *)macaddress;
@end
//
// YouaiLoginInfo.h
// YouaiSDK
//
// Created by 莫 东荣 on 13-4-10.
// Copyright (c) 2013年 莫 东荣. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface YouaiLoginInfo : NSObject //用户uid
@interface HaibaoLoginInfo : NSObject //用户uid
{
//
NSString *openId;
......@@ -22,5 +14,5 @@ NSString *timestamp;
@property(retain,nonatomic) NSString *openId;
@property(retain,nonatomic) NSString *token;
@property(retain,nonatomic) NSString *timestamp;
+ (YouaiLoginInfo *)getInstance;
@end
\ No newline at end of file
+ (HaibaoLoginInfo *)getInstance;
@end
......
#import <Foundation/Foundation.h>
extern NSString * const haibaoExitNotification; /**< 退出 */
extern NSString * const haibaoLoginNotification; /**< 登录完成的通知*/
extern NSString * const haibaoErrorNotification; /**< 出错 */
@interface HaibaoNotifications : NSObject
@end
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface HaibaoSDKMgr : NSObject
{
NSString* appId_;
NSString* appKey_;
NSString* inviterCode_;
}
@property bool eatting;
+ (HaibaoSDKMgr *)getInstance;
- (void)initSDK;
- (void)startLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller;
- (void)setStyleName:(NSString*)styleName;
- (void)startHimiko: (NSString *)serverId : (NSString *)nickName : (NSNumber *)amount : (NSString *)callBack : (UIViewController *)controller;
- (void)startWithHimiko:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId;
@end
//
// YouaiViewController.h
// newYouaiSDK
//
// Created by Mog90 on 14-9-28.
// Copyright (c) 2014年 东荣 莫. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "YouaiLoginInfo.h"
#import "HaibaoLoginInfo.h"
#import <JavaScriptCore/JavaScriptCore.h>
@interface YouaiViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
@interface HaibaoViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webView_;
UIActivityIndicatorView *activityIndicator;
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
<string>1.1.408</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
......@@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<string>2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
......
......@@ -8,9 +8,9 @@
#include "SDKInterface.h"
#import <UIKit/UIKit.h>
#import "YouaiSDK/YouaiSDKMgr.h"
#import "YouaiSDK/YouaiNotifications.h"
#import "YouaiSDK/YouaiLoginInfo.h"
#import "HaibaoSDK/HaibaoSDKMgr.h"
#import "HaibaoSDK/HaibaoNotifications.h"
#import "HaibaoSDK/HaibaoLoginInfo.h"
#import "TrackingIO.h"
//SDK
......@@ -24,18 +24,17 @@ int mExchange;
/**
初始化SDK
*/
*/
- (void)SDKinit:(UIViewController *) control
{
//必须继承
[super SDKinit:control];
[PoolConfig getInstance];
[[YouaiSDKMgr getInstance]initSDK];
// [[YouaiSDKMgr getInstance]setServerUrl:@"http://123.207.86.242/"];
// [[YouaiSDKMgr getInstance]setStyleName:@"tg_new/sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:youaiLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youaiToolCallBack:) name:@"youaiToolCallBack" object:nil];
[[HaibaoSDKMgr getInstance]initSDK];
[[HaibaoSDKMgr getInstance]setStyleName:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:haibaoLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HaibaoToolCallBack:) name:@"HaibaoToolCallBack" object:nil];
[[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil];
......@@ -54,7 +53,7 @@ int mExchange;
NSLog(@"调用了LoginSDK");
NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[YouaiSDKMgr getInstance]openLogin:appId :appKey :self.controller];
[[HaibaoSDKMgr getInstance]startLogin:appId :appKey :self.controller];
}
......@@ -65,9 +64,9 @@ int mExchange;
{
NSLog(@"loginchek");
PoolLoginInfo *loginInfo = [PoolLoginInfo alloc];
loginInfo.openId = [[YouaiLoginInfo getInstance]openId];
loginInfo.sign = [[YouaiLoginInfo getInstance] token];
loginInfo.timestamp = [YouaiLoginInfo getInstance].timestamp;
loginInfo.openId = [[HaibaoLoginInfo getInstance]openId];
loginInfo.sign = [[HaibaoLoginInfo getInstance] token];
loginInfo.timestamp = [HaibaoLoginInfo getInstance].timestamp;
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[PoolChecker getInstance] startCheck:loginInfo];
......@@ -91,15 +90,15 @@ int mExchange;
苹果支付结果回调
*/
- (void)youaiToolCallBack:(NSNotification *)notification
- (void)HaibaoToolCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"youaiToolResult"];
NSString* receiptStr = [payResultDic objectForKey:@"HaibaoToolResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
......@@ -149,7 +148,7 @@ int mExchange;
if ([reportType isEqualToString:REPORT_ENTER]) {
[TrackingIO setLoginWithAccountID:[reportInfo playerId]];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
}else if ([reportType isEqualToString:REPORT_CREATEROLE]){
......@@ -185,7 +184,7 @@ int mExchange;
- (void) handlerLeakOrder{
NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults];
NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"];
NSLog(@"orderDic%@",queryIdArray);
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];//补单失败的queryid集合
......@@ -229,10 +228,10 @@ int mExchange;
NSString *other = [payInfo other];
if (other && [other length] > 0) {
[[YouaiSDKMgr getInstance] openUtil:serverId :roleName :amount :[payInfo queryId] :self.controller];
[[HaibaoSDKMgr getInstance] startHimiko:serverId :roleName :amount :[payInfo queryId] :self.controller];
}else{
NSString* products = [payInfo products];
[[YouaiSDKMgr getInstance] openWithUtil:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId];
[[HaibaoSDKMgr getInstance] startWithHimiko:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId];
}
}
......@@ -242,3 +241,4 @@ int mExchange;
}
@end
......
//
// GetWifiMac.h
// mangosanguo
//
// Created by 莫 on 12-9-28.
// Copyright (c) 2012年 private. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface YouaiGetWifiMac : NSObject
+ (NSString *)macaddress;
@end
//
// YouaiNotifications.h
// YouaiSDK
//
// Created by 莫 东荣 on 13-4-10.
// Copyright (c) 2013年 莫 东荣. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString * const youaiExitNotification; /**< 退出 */
extern NSString * const youaiLoginNotification; /**< 登录完成的通知*/
extern NSString * const youaiErrorNotification; /**< 出错 */
@interface YouaiNotifications : NSObject
@end
//
// YouaiSDKMgr.h
// YouaiSDK
//
// Created by 莫 东荣 on 13-4-9.
// Copyright (c) 2013年 莫 东荣. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface YouaiSDKMgr : NSObject
{
NSString* appId_;
NSString* appKey_;
NSString* inviterCode_;
}
@property bool appleing;
+ (YouaiSDKMgr *)getInstance;
- (void)initSDK;
- (void)setServerUrl:(NSString *)serverUrl;
- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller;
- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *) inviterCode;
- (void)setStyleName:(NSString*)styleName;
- (void)openUtil: (NSString *)serverId : (NSString *)nickName : (NSString *)callBack : (UIViewController *)controller;
- (void)openUtil: (NSString *)serverId : (NSString *)nickName : (NSNumber *)amount : (NSString *)callBack : (UIViewController *)controller;
- (void)openWithUtil:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId;
@end
{"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"}
{"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"}
......
#import <UIKit/UIKit.h>
@interface HaibaoGetWifiMac : NSObject
+ (NSString *)macaddress;
@end
//
// YouaiLoginInfo.h
// YouaiSDK
//
// Created by 莫 东荣 on 13-4-10.
// Copyright (c) 2013年 莫 东荣. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface YouaiLoginInfo : NSObject //用户uid
@interface HaibaoLoginInfo : NSObject //用户uid
{
//
NSString *openId;
......@@ -22,5 +14,5 @@ NSString *timestamp;
@property(retain,nonatomic) NSString *openId;
@property(retain,nonatomic) NSString *token;
@property(retain,nonatomic) NSString *timestamp;
+ (YouaiLoginInfo *)getInstance;
@end
\ No newline at end of file
+ (HaibaoLoginInfo *)getInstance;
@end
......
#import <Foundation/Foundation.h>
extern NSString * const haibaoExitNotification; /**< 退出 */
extern NSString * const haibaoLoginNotification; /**< 登录完成的通知*/
extern NSString * const haibaoErrorNotification; /**< 出错 */
@interface HaibaoNotifications : NSObject
@end
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface HaibaoSDKMgr : NSObject
{
NSString* appId_;
NSString* appKey_;
NSString* inviterCode_;
}
@property bool eatting;
+ (HaibaoSDKMgr *)getInstance;
- (void)initSDK;
- (void)startLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller;
- (void)setStyleName:(NSString*)styleName;
- (void)startHimiko: (NSString *)serverId : (NSString *)nickName : (NSNumber *)amount : (NSString *)callBack : (UIViewController *)controller;
- (void)startWithHimiko:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId;
@end
//
// YouaiViewController.h
// newYouaiSDK
//
// Created by Mog90 on 14-9-28.
// Copyright (c) 2014年 东荣 莫. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "YouaiLoginInfo.h"
#import "HaibaoLoginInfo.h"
#import <JavaScriptCore/JavaScriptCore.h>
@interface YouaiViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
@interface HaibaoViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webView_;
UIActivityIndicatorView *activityIndicator;
......
......@@ -8,9 +8,9 @@
#include "SDKInterface.h"
#import <UIKit/UIKit.h>
#import "YouaiSDK/YouaiSDKMgr.h"
#import "YouaiSDK/YouaiNotifications.h"
#import "YouaiSDK/YouaiLoginInfo.h"
#import "HaibaoSDK/HaibaoSDKMgr.h"
#import "HaibaoSDK/HaibaoNotifications.h"
#import "HaibaoSDK/HaibaoLoginInfo.h"
#import "TrackingIO.h"
//SDK
......@@ -24,17 +24,17 @@ int mExchange;
/**
初始化SDK
*/
*/
- (void)SDKinit:(UIViewController *) control
{
//必须继承
[super SDKinit:control];
[PoolConfig getInstance];
[[YouaiSDKMgr getInstance]initSDK];
[[YouaiSDKMgr getInstance]setStyleName:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:youaiLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youaiToolCallBack:) name:@"youaiToolCallBack" object:nil];
[[HaibaoSDKMgr getInstance]initSDK];
[[HaibaoSDKMgr getInstance]setStyleName:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:haibaoLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HaibaoToolCallBack:) name:@"HaibaoToolCallBack" object:nil];
[[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil];
......@@ -53,7 +53,7 @@ int mExchange;
NSLog(@"调用了LoginSDK");
NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[YouaiSDKMgr getInstance]openLogin:appId :appKey :self.controller];
[[HaibaoSDKMgr getInstance]startLogin:appId :appKey :self.controller];
}
......@@ -64,9 +64,9 @@ int mExchange;
{
NSLog(@"loginchek");
PoolLoginInfo *loginInfo = [PoolLoginInfo alloc];
loginInfo.openId = [[YouaiLoginInfo getInstance]openId];
loginInfo.sign = [[YouaiLoginInfo getInstance] token];
loginInfo.timestamp = [YouaiLoginInfo getInstance].timestamp;
loginInfo.openId = [[HaibaoLoginInfo getInstance]openId];
loginInfo.sign = [[HaibaoLoginInfo getInstance] token];
loginInfo.timestamp = [HaibaoLoginInfo getInstance].timestamp;
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[PoolChecker getInstance] startCheck:loginInfo];
......@@ -90,15 +90,15 @@ int mExchange;
苹果支付结果回调
*/
- (void)youaiToolCallBack:(NSNotification *)notification
- (void)HaibaoToolCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"youaiToolResult"];
NSString* receiptStr = [payResultDic objectForKey:@"HaibaoToolResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
......@@ -148,7 +148,7 @@ int mExchange;
if ([reportType isEqualToString:REPORT_ENTER]) {
[TrackingIO setLoginWithAccountID:[reportInfo playerId]];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
}else if ([reportType isEqualToString:REPORT_CREATEROLE]){
......@@ -184,7 +184,7 @@ int mExchange;
- (void) handlerLeakOrder{
NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults];
NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"];
NSLog(@"orderDic%@",queryIdArray);
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];//补单失败的queryid集合
......@@ -228,10 +228,10 @@ int mExchange;
NSString *other = [payInfo other];
if (other && [other length] > 0) {
[[YouaiSDKMgr getInstance] openUtil:serverId :roleName :amount :[payInfo queryId] :self.controller];
[[HaibaoSDKMgr getInstance] startHimiko:serverId :roleName :amount :[payInfo queryId] :self.controller];
}else{
NSString* products = [payInfo products];
[[YouaiSDKMgr getInstance] openWithUtil:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId];
[[HaibaoSDKMgr getInstance] startWithHimiko:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId];
}
}
......@@ -241,3 +241,4 @@ int mExchange;
}
@end
......
//
// GetWifiMac.h
// mangosanguo
//
// Created by 莫 on 12-9-28.
// Copyright (c) 2012年 private. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface YouaiGetWifiMac : NSObject
+ (NSString *)macaddress;
@end
//
// YouaiNotifications.h
// YouaiSDK
//
// Created by 莫 东荣 on 13-4-10.
// Copyright (c) 2013年 莫 东荣. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString * const youaiExitNotification; /**< 退出 */
extern NSString * const youaiLoginNotification; /**< 登录完成的通知*/
extern NSString * const youaiErrorNotification; /**< 出错 */
@interface YouaiNotifications : NSObject
@end
//
// YouaiSDKMgr.h
// YouaiSDK
//
// Created by 莫 东荣 on 13-4-9.
// Copyright (c) 2013年 莫 东荣. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface YouaiSDKMgr : NSObject
{
NSString* appId_;
NSString* appKey_;
NSString* inviterCode_;
}
@property bool appleing;
+ (YouaiSDKMgr *)getInstance;
- (void)initSDK;
- (void)setServerUrl:(NSString *)serverUrl;
- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller;
- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *) inviterCode;
- (void)setStyleName:(NSString*)styleName;
- (void)openUtil: (NSString *)serverId : (NSString *)nickName : (NSString *)callBack : (UIViewController *)controller;
- (void)openUtil: (NSString *)serverId : (NSString *)nickName : (NSNumber *)amount : (NSString *)callBack : (UIViewController *)controller;
- (void)openWithUtil:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId;
@end
2018-04-02:<br>
更新3.1.1被拒问题
已接入更新方法:
1、删除YouaiSDK.framework
2、引入HaibaoSDK.framework
3、替换SDKInterface文件
2017-11-23:<br>
1、更新3.1.1被拒问题
......