lizhihui

update

Showing 90 changed files with 843 additions and 367 deletions
No preview for this file type
......@@ -7,10 +7,10 @@
objects = {
/* Begin PBXBuildFile section */
2692FA5A21FFFDF900371736 /* Resident.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2692FA5921FFFDF900371736 /* Resident.framework */; };
265B2A59228015D600F193F4 /* Reluctant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 265B2A58228015D600F193F4 /* Reluctant.framework */; };
269897F921A54A6500E0AE84 /* PoolSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 269897F821A54A6500E0AE84 /* PoolSdk.framework */; };
845D18221C8D778400F27EB9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 845D181B1C8D778400F27EB9 /* Images.xcassets */; };
846BD2241EE9342700E89A1D /* public_setting in Resources */ = {isa = PBXBuildFile; fileRef = 846BD21F1EE9342700E89A1D /* public_setting */; };
846BD2241EE9342700E89A1D /* pool_setting in Resources */ = {isa = PBXBuildFile; fileRef = 846BD21F1EE9342700E89A1D /* pool_setting */; };
846BD2261EE9342700E89A1D /* SDKInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 846BD2231EE9342700E89A1D /* SDKInterface.m */; };
847EE5E21EE9007E003A4B7B /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 847EE5E11EE9007E003A4B7B /* MainViewController.m */; };
8484E4F51EE7E0DC00B402D1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8484E4F21EE7E0DC00B402D1 /* AppDelegate.m */; };
......@@ -59,11 +59,11 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
2692FA5921FFFDF900371736 /* Resident.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Resident.framework; sourceTree = "<group>"; };
265B2A58228015D600F193F4 /* Reluctant.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Reluctant.framework; sourceTree = "<group>"; };
269897F821A54A6500E0AE84 /* PoolSdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PoolSdk.framework; sourceTree = "<group>"; };
845D181B1C8D778400F27EB9 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = poolsdk_file/poolsdk/Images.xcassets; sourceTree = "<group>"; };
845D181C1C8D778400F27EB9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = poolsdk_file/poolsdk/Info.plist; sourceTree = "<group>"; };
846BD21F1EE9342700E89A1D /* public_setting */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = public_setting; path = poolsdk_file/poolsdk/public_setting; sourceTree = "<group>"; };
846BD21F1EE9342700E89A1D /* pool_setting */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = pool_setting; path = poolsdk_file/poolsdk/pool_setting; sourceTree = "<group>"; };
846BD2221EE9342700E89A1D /* SDKInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDKInterface.h; path = poolsdk_file/poolsdk/SDKInterface.h; sourceTree = "<group>"; };
846BD2231EE9342700E89A1D /* SDKInterface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDKInterface.m; path = poolsdk_file/poolsdk/SDKInterface.m; sourceTree = "<group>"; };
847EE5E01EE9007E003A4B7B /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
......@@ -107,7 +107,6 @@
8484E5121EE7E2B800B402D1 /* libz.1.dylib in Frameworks */,
8484E5101EE7E29A00B402D1 /* libc++.1.dylib in Frameworks */,
8484E5001EE7E20C00B402D1 /* CFNetwork.framework in Frameworks */,
2692FA5A21FFFDF900371736 /* Resident.framework in Frameworks */,
8484E5061EE7E24A00B402D1 /* CoreMotion.framework in Frameworks */,
8484E5021EE7E21F00B402D1 /* UIKit.framework in Frameworks */,
8484E50C1EE7E27100B402D1 /* CoreGraphics.framework in Frameworks */,
......@@ -119,6 +118,7 @@
8484E5041EE7E24400B402D1 /* StoreKit.framework in Frameworks */,
8484E4FE1EE7E1F700B402D1 /* CoreTelephony.framework in Frameworks */,
84A090AB1F160A69003D23FB /* TrackingIO.a in Frameworks */,
265B2A59228015D600F193F4 /* Reluctant.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -143,10 +143,10 @@
8476DF641C4DD71D00EC42BA /* poolsdk */ = {
isa = PBXGroup;
children = (
2692FA5921FFFDF900371736 /* Resident.framework */,
265B2A58228015D600F193F4 /* Reluctant.framework */,
84A090AC1F174E21003D23FB /* TrackingIO.h */,
84A090AA1F160A69003D23FB /* TrackingIO.a */,
846BD21F1EE9342700E89A1D /* public_setting */,
846BD21F1EE9342700E89A1D /* pool_setting */,
846BD2221EE9342700E89A1D /* SDKInterface.h */,
846BD2231EE9342700E89A1D /* SDKInterface.m */,
845D181B1C8D778400F27EB9 /* Images.xcassets */,
......@@ -280,7 +280,7 @@
TargetAttributes = {
BB5F3C871C1811BC00DA339D = {
CreatedOnToolsVersion = 6.4;
DevelopmentTeam = A3DGN26BA8;
DevelopmentTeam = PNDD7Y396D;
ProvisioningStyle = Manual;
};
BB5F3CA01C1811BC00DA339D = {
......@@ -315,7 +315,7 @@
files = (
845D18221C8D778400F27EB9 /* Images.xcassets in Resources */,
BB5F3C971C1811BC00DA339D /* Main.storyboard in Resources */,
846BD2241EE9342700E89A1D /* public_setting in Resources */,
846BD2241EE9342700E89A1D /* pool_setting in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -469,7 +469,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = A3DGN26BA8;
DEVELOPMENT_TEAM = PNDD7Y396D;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -487,10 +487,10 @@
);
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.mihuyo.beta;
PRODUCT_BUNDLE_IDENTIFIER = com.test.youai;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "f5e11833-b2e3-48fd-8903-8da416b533f7";
PROVISIONING_PROFILE_SPECIFIER = dev_provision;
PROVISIONING_PROFILE = "9303482b-bf64-4d76-83c5-97cec24e2bd5";
PROVISIONING_PROFILE_SPECIFIER = dev;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "arm64 armv7s";
};
......@@ -503,7 +503,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = A3DGN26BA8;
DEVELOPMENT_TEAM = PNDD7Y396D;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -521,10 +521,10 @@
);
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.mihuyo.beta;
PRODUCT_BUNDLE_IDENTIFIER = com.test.youai;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "efde732c-987c-4f2a-bc64-c11762722e03";
PROVISIONING_PROFILE_SPECIFIER = dis_provision;
PROVISIONING_PROFILE = "8e8ee19d-d19f-41ba-9a9d-108915ed5380";
PROVISIONING_PROFILE_SPECIFIER = dis;
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = "arm64 armv7s";
};
......
......@@ -113,7 +113,7 @@ NSString* sdkUserId = @"";
[payInfo setExchange:@"10"];
[payInfo setServerName:@"servername"];
[payInfo setCustom:@"custom"];
[[PoolSdk shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
[[PoolSdk shareSDK] payWithPaymentInfo:payInfo];
}
-(NSString*)getCurrentTimestamp{
......
//
// PGLogger.h
// PanguCommonLib
//
// Created by ouyanghua on 14-2-22.
// Copyright (c) 2014年 pangu. All rights reserved.
//
#import <Foundation/Foundation.h>
void DGLog(NSString *fmt, ...);
......@@ -11,7 +19,7 @@ typedef NS_ENUM(NSInteger, DGLoggerLevel)
ELogError
};
@interface ResidentDGLogger : NSObject
@interface DGLogger : NSObject
+ (void)showLog:(NSString *)fmt,...;
......
//
// NetCenter.h
// public_i9133
//
// Created by winFan on 12/2/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NetCenter : NSObject
......
//
// OtherSetting.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#ifndef __PoolSdk__OtherSetting__
#define __PoolSdk__OtherSetting__
......
//
// PoolBaseModel.h
// public_i9133
//
// Created by winFan on 12/2/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "OtherSetting.h"
@interface PoolBaseModel : NSObject
- (NSString *)objectToJsonString;
- (NSMutableString *)paramAddToString;
- (id)initWithDiction:(NSDictionary *)diction;
@end
\ No newline at end of file
//
// PoolLoginChecker.h
// public_i9133
//
// Created by winFan on 12/1/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PoolSdk/PoolLoginInfo.h"
#import "PoolSdk/PoolNotification.h"
......@@ -10,16 +17,16 @@
@property(nonatomic, strong)NSString *userId;
@property(nonatomic, strong)id<PoolSdkDelegate> mPoolSdkDelegate;
@property bool onlyOneTimeGzyazf;
@property bool onlyOneTimePay;
+ (PoolChecker *)getInstance;
- (void)initChecker;
- (void)startCheck:(PoolLoginInfo *)loginInfo;
- (void) createOrder:(PoolCreateOrderInfo *)gzyazfInfo;
- (void) ResidentreportOpen;
- (void) ResidentreportSDKOpen;
- (void)ResidenthandleFirstOpenApp:(NSString*) path;
- (void) createOrder:(PoolCreateOrderInfo *)payInfo;
- (void) reportOpen;
- (void) reportSDKOpen;
- (void)handleFirstOpenApp:(NSString*) path;
- (void) reportEnter:(PoolReportInfo *)reInfo;
- (void) ResidentReport:(NSString *)_action :(PoolReportInfo *)reInfo;
- (void) report:(NSString *)_action :(PoolReportInfo *)reInfo;
- (void)sendNotice:(PoolSDKNotificationType)notiType
notiName:(NSString *)notiName
statusCode:(int)nCode
......@@ -28,7 +35,10 @@
- (void)startCheckDelegate:(PoolLoginInfo *)loginInfo;
- (void)ResidentStartCheckDelegate:(PoolLoginInfo *)loginInfo type:(int)type;
/**
*type PoolSDKNotificationLogin 为登录验证 PoolSDKNotificationSwitchAccount 为切换账号成功验证
*/
- (void)startCheckDelegate:(PoolLoginInfo *)loginInfo type:(int)type;
/*
*初始化时调用
......
//
// PoolConfig.h
// PoolSdk
//
// Created by winFan on 12/11/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PoolConfig : NSObject
......@@ -6,8 +14,8 @@
@property(nonatomic, strong)NSString *sdkSimpleName;
@property(nonatomic, strong)NSString *sdkVersionCode;
@property(nonatomic, strong)NSString *loginCheckUrl;
@property(nonatomic, strong)NSString *gzyazfOrderUrl;
@property(nonatomic, strong)NSString *gzyazfCheckUrl;
@property(nonatomic, strong)NSString *payOrderUrl;
@property(nonatomic, strong)NSString *payCheckUrl;
@property(nonatomic, strong)NSString *c1;
@property(nonatomic, strong)NSString *c2;
@property(nonatomic, strong)NSString *custom;
......
#import "PoolSdk/ResidentPoolBaseModel.h"
@interface PoolCreateOrderInfo : ResidentPoolBaseModel
//
// PayInfo.h
// public_i9133
//
// Created by winFan on 12/3/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/PoolBaseModel.h"
@interface PoolCreateOrderInfo : PoolBaseModel
@property(nonatomic,strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
......@@ -16,7 +25,7 @@
@property(nonatomic, strong)NSString *userId;//用户ID
@property(nonatomic, strong)NSString *timestamp;//时间戳
- (NSString *) ResidentGetTsign ;
- (NSString *) ResidentGetTimestamp ;
- (NSString *) getTsign ;
- (NSString *) getTimestamp ;
@end
\ No newline at end of file
......
#import "PoolSdk/ResidentPoolBaseModel.h"
@interface PoolLoginInfo : ResidentPoolBaseModel
//
// PoolLoginInfo.h
// public_i9133
//
// Created by winFan on 12/1/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/PoolBaseModel.h"
@interface PoolLoginInfo : PoolBaseModel
@property(nonatomic,strong)NSString *timestamp;
@property(nonatomic, strong)NSString *sign;
@property(nonatomic, strong)NSString *other;
@property(nonatomic, strong)NSString *sign;//serverSign
@property(nonatomic, strong)NSString *other;//透传
@property(nonatomic, strong)NSString *openId;
@property(nonatomic, strong)NSString *userType;
......
......@@ -18,7 +18,7 @@ extern NSString * const _create_order_notification; /**< */
typedef NS_ENUM(int, PoolSDKNotificationType) {
PoolSDKNotificationLogin = 1,//登录
PoolSDKNotificationLogout,//注销
PoolSDKNotificationGzyazf,//支付完成
PoolSDKNotificationPay,//支付完成
PoolSDKNotificationPause,//暂停退出
PoolSDKNotificationRole,//创建角色
PoolSDKNotificationInitSDK,//初始化SDK
......
#import "PoolSdk/ResidentPoolBaseModel.h"
@interface PoolGzyazfInfo : ResidentPoolBaseModel
//
// PoolPayInfo.h
// public_i9133
//
// Created by winFan on 12/3/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/PoolBaseModel.h"
@interface PoolPayInfo : PoolBaseModel
@property(nonatomic, strong)NSString *serverId;
@property(nonatomic, strong)NSString *queryId;
......
//
// ResidentPoolReportInfo.h
// PoolReportInfo.h
// PoolSdk
//
// Created by winFan on 12/21/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/ResidentPoolBaseModel.h"
@interface PoolReportInfo : ResidentPoolBaseModel
#import "PoolSdk/PoolBaseModel.h"
@interface PoolReportInfo : PoolBaseModel
@property(nonatomic, strong)NSString *reportType;//类型
@property(nonatomic, strong)NSString *playerId;//玩家ID
......@@ -30,16 +30,14 @@
@property(nonatomic, strong)NSString *openId;
#define REPORT_URL @"https://statistic.public.sdk.gzyouai.com/sdk/statistic"
#define REPORT_URL @"https://statistic.public.sdk.gzyouai.com/sdk/statistic" //http://183.57.76.181:9030/sdk/statistic
#define REPORT_IDFA_URL @"https://statistic.public.sdk.gzyouai.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
#define REPORT_IDFA_URL @"https://statistic.public.sdk.gzyouai.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@" //@"http://183.57.76.181:9030/sdk/last_channel?idfa="//
#define REPORT_OPEN @"open"
#define REPORT_ENTER @"enter"
#define REPORT_CREATEROLE @"createrole"
#define REPORT_ROLEUPGRADE @"roleupgrade"
#define REPORT_SDK_OPEN @"opensdk"
#define REPORT_EXIT @"exit"
#define REPORT_SELECT_SERVER @"selectserver"
@end
......
//
// PoolSdk.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PoolSdk2.h"
#import <UIKit/UIKit.h>
@interface PoolSdk : NSObject
/**
* 当前SDK的版本
*/
@property(nonatomic, strong, readonly)NSString *sdkVersion;
/**
* 用于设置url types schemes 默认为工程名
*/
@property(nonatomic, strong)NSString *urlSchemes;
@property BOOL isAppleGzyazfing;
+ (PoolSdk *)shareSDK;
/**
获取SDK实例对象
*/
+ (PoolSdk *)shareSDK;
/**
初始化SDK
*/
- (void)initSDK:(UIViewController *) control;
......@@ -22,60 +38,131 @@
- (void)setViewController:(UIViewController *)viewController;
/**
登录SDK
*/
- (void)loginSDK;
- (void)loginSDK:(UIViewController *)viewController;
- (void)gzyazfWithGzyazfmentInfo:(PoolCreateOrderInfo *)gzyazfInfo;
/**
进行支付
*/
- (void)payWithPaymentInfo:(PoolCreateOrderInfo *)payInfo;
/**
*是否含有用户中心接口
**/
- (BOOL)hasUserCenter;
/**
用户中心
*/
- (void)gotoUserCenter;
/**
report
*/
- (void)reportSDK:(PoolReportInfo *)reportInfo;
/**
*是否含有注销接口
*/
- (BOOL)hasLogout;
/**
注销
*/
- (void)logoutSDK;
/**
*是否含有切换账号接口
**/
- (BOOL)hasSwitchAccount;
/**
*切换账号
**/
- (void)switchAccount;
/**
*是否含有退出接口
**/
- (BOOL)hasExit;
/**
退出
*/
- (void)exitSDK;
/**
*SDK销毁操作(游戏退出时调用)
*/
- (void)destroySDK;
/**
显示/隐藏浮标
*/
//- (void)showFloatIcon:(BOOL)bFlag;
/**
// called in - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
*/
/**
应用 appid
*/
/**
应用支持的方向 默认为 EDreamSDKOrientationLandscape
*/
@property(nonatomic, assign)ESDKOrientation sdkOrientation;
/**
浮标是否已经显示,默认为NO
*/
@property(nonatomic, assign)BOOL bShowedFloat;
/**
serverId
*/
@property(nonatomic, assign)int serverId;
/**
获取gamechannelid
*/
-(NSString *) getGameChannelId;
/**
获取Custom
*/
- (NSString *) getCustomValue;
/**
获取ChannelParameter1
*/
- (NSString *) getChannelParameter1;
/**
获取ChannelParameter2
*/
- (NSString *) getChannelParameter2;
-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray*)customArray;
/**
*充值统计参数
*accountId 账号ID,必填项, 和登陆、注册使用的accountId保持一致即可。
*orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
*currencyAmount 货币金额,单位为元,支持小数
*currencyType 货币类型
*payType 支付类型(渠道)
*custom 自定义扩展参数
*/
-(void)paymentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType payType:(NSString*)payType custom:(NSArray*)customArray;
- (void)handleOpenurl:(NSURL *)url;
......@@ -86,9 +173,9 @@
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
//推送
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
//推送
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
......
//
// PoolSdk.h
// PoolSdk
//
// Created by 许 on 16/1/15.
// Copyright © 2016年 许. All rights reserved.
//
// In this header, you should import all the public headers of your framework using statements like #import <PoolSdk/PublicHeader.h>
#import <UIKit/UIKit.h>
#import "PoolChecker.h"
#import "Interface.h"
#import "PoolReportInfo.h"
#import "PoolLoginInfo.h"
#import "Interface.h"
#import "PoolNotification.h"
#import "PoolPayInfo.h"
#import "UnionInterface.h"
......@@ -12,3 +21,4 @@
#import "NetCenter.h"
#import "PoolSdk.h"
#import "PoolSdkDelegate.h"
......
//
// PoolSdkDelegate.h
// PoolSdk_i9133
//
// Created by 许 on 17/6/30.
// Copyright © 2017年 许. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol PoolSdkDelegate <NSObject>
......
//
// PoolUtils.h
// public_i9133
//
// Created by winFan on 12/3/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface PoolUtils : NSObject
+(NSString *)md5:(NSString *)str;
+ (NSDictionary *)ResidentDictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createGzyazfOrderUrl;
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createPayOrderUrl;
//*充值回调地址
+(NSString *)createGzyazfUrl;
+(NSString *)createPayUrl;
+(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
+(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
......
#import <Foundation/Foundation.h>
#import "OtherSetting.h"
@interface ResidentPoolBaseModel : NSObject
- (NSString *)ResidentObjectToJsonString;
- (NSMutableString *)paramAddToString;
- (id)initWithDiction:(NSDictionary *)diction;
@end
//
// NewTtack.h
// NewTtack
//
// Created by yun on 16/1/11.
// Copyright © 2016年 yun. All rights reserved.
//
#define TRACK_VERSION @"1.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/*
热云移动广告效果监测 平台 api 请选择对应的api进行使用
*/
NS_ASSUME_NONNULL_BEGIN
@interface TrackingIO : NSObject
//开启打印日志 正式上线包请关掉
+(void) setPrintLog :(BOOL)print;
// 开启数据统计
+ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
//注册成功后调用
+ (void)setRegisterWithAccountID:(NSString *)account;
//登陆成功后调用
+ (void)setLoginWithAccountID:(NSString *)account;
+(void)setGzyazfmentStart:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
+(void)setGzyazfment:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
//开始付费时 调用(人民币单位是元)
+(void)setPaymentStart:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
+(void)setPayment:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
//自定义事件
+(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
//标准接口
+(void)setProfile:(NSDictionary *)dataDic;
//获取设备信息
+(NSString*)getDeviceId;
@end
NS_ASSUME_NONNULL_END
......
//
// UnionInterface.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "PoolSdk2.h"
#import "PoolCreateOrderInfo.h"
#import "PoolReportInfo.h"
@protocol UnionInterface
/**
初始化SDK
*/
//[[PoolChecker getInstance] sendNotice:PoolSDKNotificationGzyazf notiName:@"" statusCode:POOLSDK_NO_ERROR description:@"" extendData:order_id];
//[[PoolChecker getInstance] sendNotice:PoolSDKNotificationPay notiName:@"" statusCode:POOLSDK_NO_ERROR description:@"" extendData:order_id];
- (void)SDKinit:(UIViewController *) control;
......@@ -83,7 +91,7 @@
进行支付
*/
- (void)SDKgzyazfWithGzyazfmentInfo:(PoolCreateOrderInfo *)gzyazfInfo;
- (void)SDKpayWithPaymentInfo:(PoolCreateOrderInfo *)payInfo;
- (void)receiveCreateOrder: (NSNotification *)notification;
/**
......@@ -92,9 +100,9 @@
*orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
*currencyAmount 货币金额,单位为元,支持小数
*currencyType 货币类型
*gzyazfType 支付类型(渠道)
*payType 支付类型(渠道)
*/
-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray *)customArray;
-(void)paymentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType payType:(NSString*)payType custom:(NSArray *)customArray;
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
......
......@@ -79,7 +79,7 @@
[payInfo setExchange:@"10"];
[payInfo setCustom:@"custom"];
NSLog(@"start pay");
[[PoolSdk shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
[[PoolSdk shareSDK] payWithPaymentInfo:payInfo];
}
else if(tag == 6){
PoolSdk *poolSdk = [PoolSdk shareSDK];
......@@ -122,7 +122,7 @@
}
}
break;
case PoolSDKNotificationGzyazf:
case PoolSDKNotificationPay:
{
NSLog(@"收到登陆信息PoolSDKNotificationPay");
}
......
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface ReluctantAllManager : NSObject
{
NSString* ReluctantAPPID_;
NSString* ReluctantAPPKEY_;
NSString* ReluctantInviterCode_;
}
@property bool ReluctantGeiWoHuaQianBa;
+ (ReluctantAllManager *)ReluctantInstance;
- (void)ReluctantChuShiHua;
- (void)ReluctantDengLu:(NSString *)ReluctantAPPID : (NSString *)ReluctantAPPKEY : (UIViewController *)controller;
- (void)ReluctantYangShi:(NSString*)ReluctantLeiXing;
- (void)ReluctantQuery: (NSString *)ReluctantFuWuQiID : (NSString *)ReluctantNickName : (NSNumber *)ReluctantAmount : (NSString *)ReluctantCallBack : (UIViewController *)controller : (NSString *)ReluctantServerName;
- (void)ReluctantQueryOperation:(UIViewController*)controll ReluctantHuoWuID:(NSString*)products ReluctantJiaGe:(NSString*)amount ReluctantHuoWuMing:(NSString*)productName ReluctantDingDanHao:(NSString*) DingDanHao;
@end
#import <Foundation/Foundation.h>
extern NSString * const ReluctantExitNotification;
extern NSString * const ReluctantLoginNotification;
extern NSString * const ReluctantErrorNotification;
@interface ReluctantHuiTiaoNotification : NSObject
@end
#import <UIKit/UIKit.h>
@interface ReluctantIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* ReluctantDingDanHao;
@property(nonatomic,strong) NSDictionary* ReluctantHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* ReluctantHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *ReluctantHuoWuLieBiaoView;
- (void)ReluctantHuaQianView:(UIViewController*)controller ReluctantHuoWuD:(NSString*)products ReluctantQian:(NSString*)amount ReluctantHuoWuMing:(NSString*)productName ReluctantDingDanHao:(NSString*)DingDanHao;
@end
#import <Foundation/Foundation.h>
@interface ResidentInformation : NSObject
@interface ReluctantInformation : NSObject
{
//
NSString *openId;
......@@ -12,5 +12,5 @@ NSString *timestamp;
@property(retain,nonatomic) NSString *openId;
@property(retain,nonatomic) NSString *token;
@property(retain,nonatomic) NSString *timestamp;
+ (ResidentInformation *)getInstance;
+ (ReluctantInformation *)getInstance;
@end
......
#import <Foundation/Foundation.h>
@interface ResidentInformationJM : NSObject
@interface ReluctantInformationJM : NSObject
+(NSString *)ResidentJM:(NSString *)jm;
+(NSString *)ReluctantJM:(NSString *)jm;
@end
......
#import <UIKit/UIKit.h>
@interface ResidentLocation : NSObject
@interface ReluctantLocation : NSObject
+ (NSString *)ResidentSKCloudServiceSetupOptionsKey;
+ (NSString *)ReluctantSKCloudServiceSetupOptionsKey;
@end
......
#import <UIKit/UIKit.h>
#import "ResidentInformation.h"
#import "ReluctantInformation.h"
#import <JavaScriptCore/JavaScriptCore.h>
@interface ResidentMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
@interface ReluctantMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webView_;
UIWebView *webReluctantView_;
UIActivityIndicatorView *activityIndicator;
}
@property(assign) BOOL ResidentYouYuanJiao;
@property(assign) BOOL ReluctantYouYuanJiao;
- (void)ResidentSettingCKAssetsView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)ResidentChuShiHuaWebView;
- (void)ReluctantSettingReluctantView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)ReluctantInitWebView;
- (void)loadWebPageWithString:(NSString *)url;
- (void)loadWebPageWithJs:(NSString *)content;
- (void)postNotification:(NSString *)name : (NSString *)code;
......
No preview for this file type
#import <UIKit/UIKit.h>
@interface ResidentIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* ResidentDingDanHao;
@property(nonatomic,strong) NSDictionary* ResidentHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* ResidentHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *ResidentHuoWuLieBiaoView;
- (void)ResidentHuaQianView:(UIViewController*)controller ResidentHuoWuD:(NSString*)products ResidentQian:(NSString*)amount ResidentHuoWuMing:(NSString*)productName ResidentDingDanHao:(NSString*)DingDanHao;
@end
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface ResidentAllManager : NSObject
{
NSString* ResidentAPPID_;
NSString* ResidentAPPKEY_;
NSString* ResidentInviterCode_;
}
@property bool ResidentGeiWoHuaQianBa;
+ (ResidentAllManager *)ResidentInstance;
- (void)ResidentChuShiHua;
- (void)ResidentDengLu:(NSString *)ResidentAPPID : (NSString *)ResidentAPPKEY : (UIViewController *)controller;
- (void)ResidentYangShi:(NSString*)ResidentLeiXing;
- (void)ResidentQuery: (NSString *)ResidentFuWuQiID : (NSString *)ResidentNickName : (NSNumber *)ResidentAmount : (NSString *)ResidentCallBack : (UIViewController *)controller : (NSString *)ResidentServerName;
- (void)ResidentQueryOperation:(UIViewController*)controll ResidentHuoWuID:(NSString*)products ResidentJiaGe:(NSString*)amount ResidentHuoWuMing:(NSString*)productName ResidentDingDanHao:(NSString*) DingDanHao;
@end
#import <Foundation/Foundation.h>
extern NSString * const ResidentExitNotification;
extern NSString * const ResidentLoginNotification;
extern NSString * const ResidentErrorNotification;
@interface ResidentHuiTiaoNotification : NSObject
@end
......@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>海豹DEMO</string>
<string>I9133</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.408</string>
<string>1.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
......
//
// UnionInterface.m
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#include "SDKInterface.h"
#import <UIKit/UIKit.h>
#import "Resident/ResidentAllManager.h"
#import "Resident/ResidentHuiTiaoNotification.h"
#import "Resident/ResidentInformation.h"
#import "Reluctant/ReluctantAllManager.h"
#import "Reluctant/ReluctantHuiTiaoNotification.h"
#import "Reluctant/ReluctantInformation.h"
#import "TrackingIO.h"
//SDK
@implementation SDKInterface : Interface
int mExchange;
NSString *ResidentAppId;
NSString *ResidentAppKey;
NSString *ReluctantAppId;
NSString *ReluctantAppKey;
NSString *ReluctantLeakOrderUrl;
/**
初始化SDK
*/
- (void)SDKinit:(UIViewController *) control
{
//必须继承
[super SDKinit:control];
[PoolConfig getInstance];
[[ResidentAllManager ResidentInstance]ResidentChuShiHua];
[[ResidentAllManager ResidentInstance]ResidentYangShi:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:ResidentLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"ResidentToolCallBack" object:nil];
[[ReluctantAllManager ReluctantInstance]ReluctantChuShiHua];
[[ReluctantAllManager ReluctantInstance]ReluctantYangShi:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:ReluctantLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youaiToolCallBack:) name:@"ReluctantToolCallBack" object:nil];
[[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil];
NSString* channelId = [[PoolConfig getInstance] getValueByKey:@"gamechannelid"];
......@@ -38,10 +51,10 @@ NSString *ResidentAppKey;
*/
- (void)SDKloginSDK
{
//APPID APPKEY
ResidentAppId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
ResidentAppKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[ResidentAllManager ResidentInstance]ResidentDengLu:ResidentAppId :ResidentAppKey :self.controller];
NSLog(@"调用了LoginSDK");
ReluctantAppId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
ReluctantAppKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[ReluctantAllManager ReluctantInstance]ReluctantDengLu:ReluctantAppId :ReluctantAppKey :self.controller];
}
......@@ -52,9 +65,9 @@ NSString *ResidentAppKey;
{
NSLog(@"loginchek");
PoolLoginInfo *loginInfo = [PoolLoginInfo alloc];
loginInfo.openId = [[ResidentInformation getInstance]openId];
loginInfo.sign = [[ResidentInformation getInstance] token];
loginInfo.timestamp = [[ResidentInformation getInstance] timestamp];
loginInfo.openId = [[ReluctantInformation getInstance]openId];
loginInfo.sign = [[ReluctantInformation getInstance] token];
loginInfo.timestamp = [[ReluctantInformation getInstance] timestamp];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[PoolChecker getInstance] startCheck:loginInfo];
......@@ -78,47 +91,47 @@ NSString *ResidentAppKey;
苹果支付结果回调
*/
- (void)HCKAssetsToolCallBack:(NSNotification *)notification
- (void)youaiToolCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"ResidentToolResult"];
NSString* receiptStr = [payResultDic objectForKey:@"ReluctantToolResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createGzyazfUrl] :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
}else{//失败
//收到回调,保存queryid和data
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableArray* queryIdArray = [userDefaults objectForKey:@"queryIds"];
NSMutableArray* tempQueryIdArray = [[NSMutableArray alloc] initWithCapacity:10];
if (queryIdArray) {
}else{
queryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
}
for (NSString* arrayQueryId in queryIdArray) {
[tempQueryIdArray addObject:arrayQueryId];
}
[tempQueryIdArray addObject:queryId];
[userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
[userDefaults setObject:receiptStr forKey:queryId];
[userDefaults synchronize];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:ReluctantLeakOrderUrl :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
//删除已保存的
[userDefaults removeObjectForKey:queryId];
[tempQueryIdArray removeObject:queryId];
[userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
[userDefaults removeObjectForKey:@"lastqueryid"];
}
[userDefaults synchronize];
}
/**
支付 创建订单
*/
- (void)SDKgzyazfWithGzyazfmentInfo:(PoolCreateOrderInfo *)payInfo
- (void)SDKpayWithPaymentInfo:(PoolCreateOrderInfo *)payInfo
{
mExchange = [payInfo exchange].intValue;
[super SDKgzyazfWithGzyazfmentInfo:payInfo];
[super SDKpayWithPaymentInfo:payInfo];
}
/**
......@@ -181,7 +194,13 @@ NSString *ResidentAppKey;
for (NSString* queryId in queryIdArray) {
NSString* receiptStr = [userDefaults valueForKey:queryId];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createGzyazfUrl] :receiptDic];
NSString* lastReluctantLeakOrderUrl = [userDefaults objectForKey:@"lastReluctantLeakOrderUrl"];
NSString* result;
if (lastReluctantLeakOrderUrl!=nil) {
result = [[NetCenter getInstance] httpPostSyn:lastReluctantLeakOrderUrl :receiptDic];
}else{
result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic];
}
if([@"success" isEqualToString:result]){//成功
[userDefaults removeObjectForKey:queryId];
}else{//补单失败
......@@ -202,7 +221,7 @@ NSString *ResidentAppKey;
- (void)receiveCreateOrder:(NSNotification *)notification
{
NSLog(@"创建订单成功");
PoolGzyazfInfo *payInfo = [notification object];
PoolPayInfo *payInfo = [notification object];
NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
NSString *serverId = [payInfo serverId];
......@@ -216,10 +235,14 @@ NSString *ResidentAppKey;
NSString *other = [payInfo other];
if (other && [other length] > 0) {
[[ResidentAllManager ResidentInstance] ResidentQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
[[ReluctantAllManager ReluctantInstance] ReluctantQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
}else{
NSString* products = [payInfo products];
[[ResidentAllManager ResidentInstance] ResidentQueryOperation:self.controller ResidentHuoWuID:products ResidentJiaGe:[payInfo postAmount] ResidentHuoWuMing:[payInfo productName] ResidentDingDanHao:queryId];
//保存订单号到本地
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:queryId forKey:@"lastqueryid"];
[userDefaults synchronize];
[[ReluctantAllManager ReluctantInstance] ReluctantQueryOperation:self.controller ReluctantHuoWuID:products ReluctantJiaGe:[payInfo postAmount] ReluctantHuoWuMing:[payInfo productName] ReluctantDingDanHao:queryId];
}
}
......@@ -229,4 +252,3 @@ NSString *ResidentAppKey;
}
@end
......
新接入请参考对接文档和demo<br>
2019-01-29:<br>
2019-05-06:<br>
1、``` 删除poolsdk_file文件夹中原来framework ``` <br>
2、``` 引入poolsdk_file文件夹中Resident.framework ``` <br>
2、``` 引入poolsdk_file文件夹中Reluctant.framework ``` <br>
3、``` 替换SDKInterface.m文件 ``` <br>
4、``` 替换PoolSdk.framework ``` <br>
\ No newline at end of file
5、``` 原 URL Schemes 中的 i9133public 改为 sdk.uuufish.com (可参考demo中info设置) ``` <br>
6、``` 原pool_setting文件 替换成新 public_setting文件 ``` <br>
\ No newline at end of file
......
No preview for this file type
//
// PGLogger.h
// PanguCommonLib
//
// Created by ouyanghua on 14-2-22.
// Copyright (c) 2014年 pangu. All rights reserved.
//
#import <Foundation/Foundation.h>
void DGLog(NSString *fmt, ...);
......@@ -11,7 +19,7 @@ typedef NS_ENUM(NSInteger, DGLoggerLevel)
ELogError
};
@interface ResidentDGLogger : NSObject
@interface DGLogger : NSObject
+ (void)showLog:(NSString *)fmt,...;
......
//
// NetCenter.h
// public_i9133
//
// Created by winFan on 12/2/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NetCenter : NSObject
......
//
// OtherSetting.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#ifndef __PoolSdk__OtherSetting__
#define __PoolSdk__OtherSetting__
......
//
// PoolBaseModel.h
// public_i9133
//
// Created by winFan on 12/2/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "OtherSetting.h"
@interface PoolBaseModel : NSObject
- (NSString *)objectToJsonString;
- (NSMutableString *)paramAddToString;
- (id)initWithDiction:(NSDictionary *)diction;
@end
\ No newline at end of file
//
// PoolLoginChecker.h
// public_i9133
//
// Created by winFan on 12/1/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PoolSdk/PoolLoginInfo.h"
#import "PoolSdk/PoolNotification.h"
......@@ -10,16 +17,16 @@
@property(nonatomic, strong)NSString *userId;
@property(nonatomic, strong)id<PoolSdkDelegate> mPoolSdkDelegate;
@property bool onlyOneTimeGzyazf;
@property bool onlyOneTimePay;
+ (PoolChecker *)getInstance;
- (void)initChecker;
- (void)startCheck:(PoolLoginInfo *)loginInfo;
- (void) createOrder:(PoolCreateOrderInfo *)gzyazfInfo;
- (void) ResidentreportOpen;
- (void) ResidentreportSDKOpen;
- (void)ResidenthandleFirstOpenApp:(NSString*) path;
- (void) createOrder:(PoolCreateOrderInfo *)payInfo;
- (void) reportOpen;
- (void) reportSDKOpen;
- (void)handleFirstOpenApp:(NSString*) path;
- (void) reportEnter:(PoolReportInfo *)reInfo;
- (void) ResidentReport:(NSString *)_action :(PoolReportInfo *)reInfo;
- (void) report:(NSString *)_action :(PoolReportInfo *)reInfo;
- (void)sendNotice:(PoolSDKNotificationType)notiType
notiName:(NSString *)notiName
statusCode:(int)nCode
......@@ -28,7 +35,10 @@
- (void)startCheckDelegate:(PoolLoginInfo *)loginInfo;
- (void)ResidentStartCheckDelegate:(PoolLoginInfo *)loginInfo type:(int)type;
/**
*type PoolSDKNotificationLogin 为登录验证 PoolSDKNotificationSwitchAccount 为切换账号成功验证
*/
- (void)startCheckDelegate:(PoolLoginInfo *)loginInfo type:(int)type;
/*
*初始化时调用
......
//
// PoolConfig.h
// PoolSdk
//
// Created by winFan on 12/11/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PoolConfig : NSObject
......@@ -6,8 +14,8 @@
@property(nonatomic, strong)NSString *sdkSimpleName;
@property(nonatomic, strong)NSString *sdkVersionCode;
@property(nonatomic, strong)NSString *loginCheckUrl;
@property(nonatomic, strong)NSString *gzyazfOrderUrl;
@property(nonatomic, strong)NSString *gzyazfCheckUrl;
@property(nonatomic, strong)NSString *payOrderUrl;
@property(nonatomic, strong)NSString *payCheckUrl;
@property(nonatomic, strong)NSString *c1;
@property(nonatomic, strong)NSString *c2;
@property(nonatomic, strong)NSString *custom;
......
#import "PoolSdk/ResidentPoolBaseModel.h"
@interface PoolCreateOrderInfo : ResidentPoolBaseModel
//
// PayInfo.h
// public_i9133
//
// Created by winFan on 12/3/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/PoolBaseModel.h"
@interface PoolCreateOrderInfo : PoolBaseModel
@property(nonatomic,strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
......@@ -16,7 +25,7 @@
@property(nonatomic, strong)NSString *userId;//用户ID
@property(nonatomic, strong)NSString *timestamp;//时间戳
- (NSString *) ResidentGetTsign ;
- (NSString *) ResidentGetTimestamp ;
- (NSString *) getTsign ;
- (NSString *) getTimestamp ;
@end
\ No newline at end of file
......
#import "PoolSdk/ResidentPoolBaseModel.h"
@interface PoolLoginInfo : ResidentPoolBaseModel
//
// PoolLoginInfo.h
// public_i9133
//
// Created by winFan on 12/1/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/PoolBaseModel.h"
@interface PoolLoginInfo : PoolBaseModel
@property(nonatomic,strong)NSString *timestamp;
@property(nonatomic, strong)NSString *sign;
@property(nonatomic, strong)NSString *other;
@property(nonatomic, strong)NSString *sign;//serverSign
@property(nonatomic, strong)NSString *other;//透传
@property(nonatomic, strong)NSString *openId;
@property(nonatomic, strong)NSString *userType;
......
......@@ -18,7 +18,7 @@ extern NSString * const _create_order_notification; /**< */
typedef NS_ENUM(int, PoolSDKNotificationType) {
PoolSDKNotificationLogin = 1,//登录
PoolSDKNotificationLogout,//注销
PoolSDKNotificationGzyazf,//支付完成
PoolSDKNotificationPay,//支付完成
PoolSDKNotificationPause,//暂停退出
PoolSDKNotificationRole,//创建角色
PoolSDKNotificationInitSDK,//初始化SDK
......
#import "PoolSdk/ResidentPoolBaseModel.h"
@interface PoolGzyazfInfo : ResidentPoolBaseModel
//
// PoolPayInfo.h
// public_i9133
//
// Created by winFan on 12/3/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/PoolBaseModel.h"
@interface PoolPayInfo : PoolBaseModel
@property(nonatomic, strong)NSString *serverId;
@property(nonatomic, strong)NSString *queryId;
......
//
// ResidentPoolReportInfo.h
// PoolReportInfo.h
// PoolSdk
//
// Created by winFan on 12/21/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/ResidentPoolBaseModel.h"
@interface PoolReportInfo : ResidentPoolBaseModel
#import "PoolSdk/PoolBaseModel.h"
@interface PoolReportInfo : PoolBaseModel
@property(nonatomic, strong)NSString *reportType;//类型
@property(nonatomic, strong)NSString *playerId;//玩家ID
......@@ -30,16 +30,14 @@
@property(nonatomic, strong)NSString *openId;
#define REPORT_URL @"https://statistic.public.sdk.gzyouai.com/sdk/statistic"
#define REPORT_URL @"https://statistic.public.sdk.gzyouai.com/sdk/statistic" //http://183.57.76.181:9030/sdk/statistic
#define REPORT_IDFA_URL @"https://statistic.public.sdk.gzyouai.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
#define REPORT_IDFA_URL @"https://statistic.public.sdk.gzyouai.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@" //@"http://183.57.76.181:9030/sdk/last_channel?idfa="//
#define REPORT_OPEN @"open"
#define REPORT_ENTER @"enter"
#define REPORT_CREATEROLE @"createrole"
#define REPORT_ROLEUPGRADE @"roleupgrade"
#define REPORT_SDK_OPEN @"opensdk"
#define REPORT_EXIT @"exit"
#define REPORT_SELECT_SERVER @"selectserver"
@end
......
//
// PoolSdk.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PoolSdk2.h"
#import <UIKit/UIKit.h>
@interface PoolSdk : NSObject
/**
* 当前SDK的版本
*/
@property(nonatomic, strong, readonly)NSString *sdkVersion;
/**
* 用于设置url types schemes 默认为工程名
*/
@property(nonatomic, strong)NSString *urlSchemes;
@property BOOL isAppleGzyazfing;
+ (PoolSdk *)shareSDK;
/**
获取SDK实例对象
*/
+ (PoolSdk *)shareSDK;
/**
初始化SDK
*/
- (void)initSDK:(UIViewController *) control;
......@@ -22,60 +38,131 @@
- (void)setViewController:(UIViewController *)viewController;
/**
登录SDK
*/
- (void)loginSDK;
- (void)loginSDK:(UIViewController *)viewController;
- (void)gzyazfWithGzyazfmentInfo:(PoolCreateOrderInfo *)gzyazfInfo;
/**
进行支付
*/
- (void)payWithPaymentInfo:(PoolCreateOrderInfo *)payInfo;
/**
*是否含有用户中心接口
**/
- (BOOL)hasUserCenter;
/**
用户中心
*/
- (void)gotoUserCenter;
/**
report
*/
- (void)reportSDK:(PoolReportInfo *)reportInfo;
/**
*是否含有注销接口
*/
- (BOOL)hasLogout;
/**
注销
*/
- (void)logoutSDK;
/**
*是否含有切换账号接口
**/
- (BOOL)hasSwitchAccount;
/**
*切换账号
**/
- (void)switchAccount;
/**
*是否含有退出接口
**/
- (BOOL)hasExit;
/**
退出
*/
- (void)exitSDK;
/**
*SDK销毁操作(游戏退出时调用)
*/
- (void)destroySDK;
/**
显示/隐藏浮标
*/
//- (void)showFloatIcon:(BOOL)bFlag;
/**
// called in - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
*/
/**
应用 appid
*/
/**
应用支持的方向 默认为 EDreamSDKOrientationLandscape
*/
@property(nonatomic, assign)ESDKOrientation sdkOrientation;
/**
浮标是否已经显示,默认为NO
*/
@property(nonatomic, assign)BOOL bShowedFloat;
/**
serverId
*/
@property(nonatomic, assign)int serverId;
/**
获取gamechannelid
*/
-(NSString *) getGameChannelId;
/**
获取Custom
*/
- (NSString *) getCustomValue;
/**
获取ChannelParameter1
*/
- (NSString *) getChannelParameter1;
/**
获取ChannelParameter2
*/
- (NSString *) getChannelParameter2;
-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray*)customArray;
/**
*充值统计参数
*accountId 账号ID,必填项, 和登陆、注册使用的accountId保持一致即可。
*orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
*currencyAmount 货币金额,单位为元,支持小数
*currencyType 货币类型
*payType 支付类型(渠道)
*custom 自定义扩展参数
*/
-(void)paymentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType payType:(NSString*)payType custom:(NSArray*)customArray;
- (void)handleOpenurl:(NSURL *)url;
......@@ -86,9 +173,9 @@
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
//推送
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
//推送
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
......
//
// PoolSdk.h
// PoolSdk
//
// Created by 许 on 16/1/15.
// Copyright © 2016年 许. All rights reserved.
//
// In this header, you should import all the public headers of your framework using statements like #import <PoolSdk/PublicHeader.h>
#import <UIKit/UIKit.h>
#import "PoolChecker.h"
#import "Interface.h"
#import "PoolReportInfo.h"
#import "PoolLoginInfo.h"
#import "Interface.h"
#import "PoolNotification.h"
#import "PoolPayInfo.h"
#import "UnionInterface.h"
......@@ -12,3 +21,4 @@
#import "NetCenter.h"
#import "PoolSdk.h"
#import "PoolSdkDelegate.h"
......
//
// PoolSdkDelegate.h
// PoolSdk_i9133
//
// Created by 许 on 17/6/30.
// Copyright © 2017年 许. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol PoolSdkDelegate <NSObject>
......
//
// PoolUtils.h
// public_i9133
//
// Created by winFan on 12/3/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface PoolUtils : NSObject
+(NSString *)md5:(NSString *)str;
+ (NSDictionary *)ResidentDictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createGzyazfOrderUrl;
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createPayOrderUrl;
//*充值回调地址
+(NSString *)createGzyazfUrl;
+(NSString *)createPayUrl;
+(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
+(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
......
#import <Foundation/Foundation.h>
#import "OtherSetting.h"
@interface ResidentPoolBaseModel : NSObject
- (NSString *)ResidentObjectToJsonString;
- (NSMutableString *)paramAddToString;
- (id)initWithDiction:(NSDictionary *)diction;
@end
//
// NewTtack.h
// NewTtack
//
// Created by yun on 16/1/11.
// Copyright © 2016年 yun. All rights reserved.
//
#define TRACK_VERSION @"1.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/*
热云移动广告效果监测 平台 api 请选择对应的api进行使用
*/
NS_ASSUME_NONNULL_BEGIN
@interface TrackingIO : NSObject
//开启打印日志 正式上线包请关掉
+(void) setPrintLog :(BOOL)print;
// 开启数据统计
+ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
//注册成功后调用
+ (void)setRegisterWithAccountID:(NSString *)account;
//登陆成功后调用
+ (void)setLoginWithAccountID:(NSString *)account;
+(void)setGzyazfmentStart:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
+(void)setGzyazfment:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
//开始付费时 调用(人民币单位是元)
+(void)setPaymentStart:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
+(void)setPayment:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
//自定义事件
+(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
//标准接口
+(void)setProfile:(NSDictionary *)dataDic;
//获取设备信息
+(NSString*)getDeviceId;
@end
NS_ASSUME_NONNULL_END
......
//
// UnionInterface.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "PoolSdk2.h"
#import "PoolCreateOrderInfo.h"
#import "PoolReportInfo.h"
@protocol UnionInterface
/**
初始化SDK
*/
//[[PoolChecker getInstance] sendNotice:PoolSDKNotificationGzyazf notiName:@"" statusCode:POOLSDK_NO_ERROR description:@"" extendData:order_id];
//[[PoolChecker getInstance] sendNotice:PoolSDKNotificationPay notiName:@"" statusCode:POOLSDK_NO_ERROR description:@"" extendData:order_id];
- (void)SDKinit:(UIViewController *) control;
......@@ -83,7 +91,7 @@
进行支付
*/
- (void)SDKgzyazfWithGzyazfmentInfo:(PoolCreateOrderInfo *)gzyazfInfo;
- (void)SDKpayWithPaymentInfo:(PoolCreateOrderInfo *)payInfo;
- (void)receiveCreateOrder: (NSNotification *)notification;
/**
......@@ -92,9 +100,9 @@
*orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
*currencyAmount 货币金额,单位为元,支持小数
*currencyType 货币类型
*gzyazfType 支付类型(渠道)
*payType 支付类型(渠道)
*/
-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray *)customArray;
-(void)paymentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType payType:(NSString*)payType custom:(NSArray *)customArray;
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
......
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface ReluctantAllManager : NSObject
{
NSString* ReluctantAPPID_;
NSString* ReluctantAPPKEY_;
NSString* ReluctantInviterCode_;
}
@property bool ReluctantGeiWoHuaQianBa;
+ (ReluctantAllManager *)ReluctantInstance;
- (void)ReluctantChuShiHua;
- (void)ReluctantDengLu:(NSString *)ReluctantAPPID : (NSString *)ReluctantAPPKEY : (UIViewController *)controller;
- (void)ReluctantYangShi:(NSString*)ReluctantLeiXing;
- (void)ReluctantQuery: (NSString *)ReluctantFuWuQiID : (NSString *)ReluctantNickName : (NSNumber *)ReluctantAmount : (NSString *)ReluctantCallBack : (UIViewController *)controller : (NSString *)ReluctantServerName;
- (void)ReluctantQueryOperation:(UIViewController*)controll ReluctantHuoWuID:(NSString*)products ReluctantJiaGe:(NSString*)amount ReluctantHuoWuMing:(NSString*)productName ReluctantDingDanHao:(NSString*) DingDanHao;
@end
#import <Foundation/Foundation.h>
extern NSString * const ReluctantExitNotification;
extern NSString * const ReluctantLoginNotification;
extern NSString * const ReluctantErrorNotification;
@interface ReluctantHuiTiaoNotification : NSObject
@end
#import <UIKit/UIKit.h>
@interface ReluctantIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* ReluctantDingDanHao;
@property(nonatomic,strong) NSDictionary* ReluctantHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* ReluctantHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *ReluctantHuoWuLieBiaoView;
- (void)ReluctantHuaQianView:(UIViewController*)controller ReluctantHuoWuD:(NSString*)products ReluctantQian:(NSString*)amount ReluctantHuoWuMing:(NSString*)productName ReluctantDingDanHao:(NSString*)DingDanHao;
@end
#import <Foundation/Foundation.h>
@interface ResidentInformation : NSObject
@interface ReluctantInformation : NSObject
{
//
NSString *openId;
......@@ -12,5 +12,5 @@ NSString *timestamp;
@property(retain,nonatomic) NSString *openId;
@property(retain,nonatomic) NSString *token;
@property(retain,nonatomic) NSString *timestamp;
+ (ResidentInformation *)getInstance;
+ (ReluctantInformation *)getInstance;
@end
......
#import <Foundation/Foundation.h>
@interface ResidentInformationJM : NSObject
@interface ReluctantInformationJM : NSObject
+(NSString *)ResidentJM:(NSString *)jm;
+(NSString *)ReluctantJM:(NSString *)jm;
@end
......
#import <UIKit/UIKit.h>
@interface ResidentLocation : NSObject
@interface ReluctantLocation : NSObject
+ (NSString *)ResidentSKCloudServiceSetupOptionsKey;
+ (NSString *)ReluctantSKCloudServiceSetupOptionsKey;
@end
......
#import <UIKit/UIKit.h>
#import "ResidentInformation.h"
#import "ReluctantInformation.h"
#import <JavaScriptCore/JavaScriptCore.h>
@interface ResidentMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
@interface ReluctantMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webView_;
UIWebView *webReluctantView_;
UIActivityIndicatorView *activityIndicator;
}
@property(assign) BOOL ResidentYouYuanJiao;
@property(assign) BOOL ReluctantYouYuanJiao;
- (void)ResidentSettingCKAssetsView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)ResidentChuShiHuaWebView;
- (void)ReluctantSettingReluctantView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)ReluctantInitWebView;
- (void)loadWebPageWithString:(NSString *)url;
- (void)loadWebPageWithJs:(NSString *)content;
- (void)postNotification:(NSString *)name : (NSString *)code;
......
#import <UIKit/UIKit.h>
@interface ResidentIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
@property(nonatomic,strong) NSString* ResidentDingDanHao;
@property(nonatomic,strong) NSDictionary* ResidentHuoWuLieBiao;
@property(nonatomic,strong) NSMutableArray* ResidentHuoWuIDLieBiao;
@property(nonatomic, strong) UITableView *ResidentHuoWuLieBiaoView;
- (void)ResidentHuaQianView:(UIViewController*)controller ResidentHuoWuD:(NSString*)products ResidentQian:(NSString*)amount ResidentHuoWuMing:(NSString*)productName ResidentDingDanHao:(NSString*)DingDanHao;
@end
#import <UIKit/UIKit.h>
#import "StoreKit/StoreKit.h"
@interface ResidentAllManager : NSObject
{
NSString* ResidentAPPID_;
NSString* ResidentAPPKEY_;
NSString* ResidentInviterCode_;
}
@property bool ResidentGeiWoHuaQianBa;
+ (ResidentAllManager *)ResidentInstance;
- (void)ResidentChuShiHua;
- (void)ResidentDengLu:(NSString *)ResidentAPPID : (NSString *)ResidentAPPKEY : (UIViewController *)controller;
- (void)ResidentYangShi:(NSString*)ResidentLeiXing;
- (void)ResidentQuery: (NSString *)ResidentFuWuQiID : (NSString *)ResidentNickName : (NSNumber *)ResidentAmount : (NSString *)ResidentCallBack : (UIViewController *)controller : (NSString *)ResidentServerName;
- (void)ResidentQueryOperation:(UIViewController*)controll ResidentHuoWuID:(NSString*)products ResidentJiaGe:(NSString*)amount ResidentHuoWuMing:(NSString*)productName ResidentDingDanHao:(NSString*) DingDanHao;
@end
#import <Foundation/Foundation.h>
extern NSString * const ResidentExitNotification;
extern NSString * const ResidentLoginNotification;
extern NSString * const ResidentErrorNotification;
@interface ResidentHuiTiaoNotification : NSObject
@end
//
// UnionInterface.m
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#include "SDKInterface.h"
#import <UIKit/UIKit.h>
#import "Resident/ResidentAllManager.h"
#import "Resident/ResidentHuiTiaoNotification.h"
#import "Resident/ResidentInformation.h"
#import "Reluctant/ReluctantAllManager.h"
#import "Reluctant/ReluctantHuiTiaoNotification.h"
#import "Reluctant/ReluctantInformation.h"
#import "TrackingIO.h"
//SDK
@implementation SDKInterface : Interface
int mExchange;
NSString *ResidentAppId;
NSString *ResidentAppKey;
NSString *ReluctantAppId;
NSString *ReluctantAppKey;
NSString *ReluctantLeakOrderUrl;
/**
初始化SDK
*/
- (void)SDKinit:(UIViewController *) control
{
//必须继承
[super SDKinit:control];
[PoolConfig getInstance];
[[ResidentAllManager ResidentInstance]ResidentChuShiHua];
[[ResidentAllManager ResidentInstance]ResidentYangShi:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:ResidentLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"ResidentToolCallBack" object:nil];
[[ReluctantAllManager ReluctantInstance]ReluctantChuShiHua];
[[ReluctantAllManager ReluctantInstance]ReluctantYangShi:@"sdk"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:ReluctantLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youaiToolCallBack:) name:@"ReluctantToolCallBack" object:nil];
[[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil];
NSString* channelId = [[PoolConfig getInstance] getValueByKey:@"gamechannelid"];
......@@ -38,10 +51,10 @@ NSString *ResidentAppKey;
*/
- (void)SDKloginSDK
{
//APPID APPKEY
ResidentAppId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
ResidentAppKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[ResidentAllManager ResidentInstance]ResidentDengLu:ResidentAppId :ResidentAppKey :self.controller];
NSLog(@"调用了LoginSDK");
ReluctantAppId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
ReluctantAppKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[ReluctantAllManager ReluctantInstance]ReluctantDengLu:ReluctantAppId :ReluctantAppKey :self.controller];
}
......@@ -52,9 +65,9 @@ NSString *ResidentAppKey;
{
NSLog(@"loginchek");
PoolLoginInfo *loginInfo = [PoolLoginInfo alloc];
loginInfo.openId = [[ResidentInformation getInstance]openId];
loginInfo.sign = [[ResidentInformation getInstance] token];
loginInfo.timestamp = [[ResidentInformation getInstance] timestamp];
loginInfo.openId = [[ReluctantInformation getInstance]openId];
loginInfo.sign = [[ReluctantInformation getInstance] token];
loginInfo.timestamp = [[ReluctantInformation getInstance] timestamp];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[PoolChecker getInstance] startCheck:loginInfo];
......@@ -78,47 +91,47 @@ NSString *ResidentAppKey;
苹果支付结果回调
*/
- (void)HCKAssetsToolCallBack:(NSNotification *)notification
- (void)youaiToolCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"ResidentToolResult"];
NSString* receiptStr = [payResultDic objectForKey:@"ReluctantToolResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createGzyazfUrl] :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
}else{//失败
//收到回调,保存queryid和data
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableArray* queryIdArray = [userDefaults objectForKey:@"queryIds"];
NSMutableArray* tempQueryIdArray = [[NSMutableArray alloc] initWithCapacity:10];
if (queryIdArray) {
}else{
queryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
}
for (NSString* arrayQueryId in queryIdArray) {
[tempQueryIdArray addObject:arrayQueryId];
}
[tempQueryIdArray addObject:queryId];
[userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
[userDefaults setObject:receiptStr forKey:queryId];
[userDefaults synchronize];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:ReluctantLeakOrderUrl :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
//删除已保存的
[userDefaults removeObjectForKey:queryId];
[tempQueryIdArray removeObject:queryId];
[userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
[userDefaults removeObjectForKey:@"lastqueryid"];
}
[userDefaults synchronize];
}
/**
支付 创建订单
*/
- (void)SDKgzyazfWithGzyazfmentInfo:(PoolCreateOrderInfo *)payInfo
- (void)SDKpayWithPaymentInfo:(PoolCreateOrderInfo *)payInfo
{
mExchange = [payInfo exchange].intValue;
[super SDKgzyazfWithGzyazfmentInfo:payInfo];
[super SDKpayWithPaymentInfo:payInfo];
}
/**
......@@ -181,7 +194,13 @@ NSString *ResidentAppKey;
for (NSString* queryId in queryIdArray) {
NSString* receiptStr = [userDefaults valueForKey:queryId];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createGzyazfUrl] :receiptDic];
NSString* lastReluctantLeakOrderUrl = [userDefaults objectForKey:@"lastReluctantLeakOrderUrl"];
NSString* result;
if (lastReluctantLeakOrderUrl!=nil) {
result = [[NetCenter getInstance] httpPostSyn:lastReluctantLeakOrderUrl :receiptDic];
}else{
result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic];
}
if([@"success" isEqualToString:result]){//成功
[userDefaults removeObjectForKey:queryId];
}else{//补单失败
......@@ -202,7 +221,7 @@ NSString *ResidentAppKey;
- (void)receiveCreateOrder:(NSNotification *)notification
{
NSLog(@"创建订单成功");
PoolGzyazfInfo *payInfo = [notification object];
PoolPayInfo *payInfo = [notification object];
NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
NSString *serverId = [payInfo serverId];
......@@ -216,10 +235,14 @@ NSString *ResidentAppKey;
NSString *other = [payInfo other];
if (other && [other length] > 0) {
[[ResidentAllManager ResidentInstance] ResidentQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
[[ReluctantAllManager ReluctantInstance] ReluctantQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
}else{
NSString* products = [payInfo products];
[[ResidentAllManager ResidentInstance] ResidentQueryOperation:self.controller ResidentHuoWuID:products ResidentJiaGe:[payInfo postAmount] ResidentHuoWuMing:[payInfo productName] ResidentDingDanHao:queryId];
//保存订单号到本地
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:queryId forKey:@"lastqueryid"];
[userDefaults synchronize];
[[ReluctantAllManager ReluctantInstance] ReluctantQueryOperation:self.controller ReluctantHuoWuID:products ReluctantJiaGe:[payInfo postAmount] ReluctantHuoWuMing:[payInfo productName] ReluctantDingDanHao:queryId];
}
}
......@@ -229,4 +252,3 @@ NSString *ResidentAppKey;
}
@end
......
{"renyunAppKey": "1", "payorderurl": "http://183.136.223.85:9020/paycheck/create", "usertype": 150, "sdkSimpleName": "apple_youyu", "gamechannelid": "", "APP_KEY": "b06b86b79c25774ec758657a7203bae6", "custom": "{}", "sdkVersionCode": "V1_1", "loginCheckUrl": "http://183.136.223.85:9010/logincheck/check/", "appScheme": "com.jghb.xinqinji", "c2": "", "c1": "", "APP_ID": "58fd78a9834e7246b8dc0eac", "paycheckurl": "http://183.136.223.85:9020/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"}