xuguohong

commit xingwan

Showing 62 changed files with 1397 additions and 189 deletions
No preview for this file type
This diff is collapsed. Click to expand it.
......@@ -37,7 +37,11 @@
[[PoolSdk shareSDK]applicationDidEnterBackground:application];
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
NSLog(@"applicationWillEnterForeground1111111");
[[PoolSdk shareSDK] applicationWillEnterForeground:application];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
......@@ -54,22 +58,10 @@
return true;
}
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options
{
[[PoolSdk shareSDK]application:app openURL:url options:options];
return YES;
}
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
[[PoolSdk shareSDK] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
return YES;
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
[[PoolSdk shareSDK] applicationWillEnterForeground:application];
}
@end
......
......@@ -154,36 +154,4 @@
}
}
#pragma mark - 截屏
- (void)screenShot:(UIView *)view{
UIImage* image = nil;
UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIGraphicsEndImageContext();
if (image != nil) {
NSLog(@"截图成功!");
UIImageWriteToSavedPhotosAlbum(image,self,@selector(image:didFinishSavingWithError:contextInfo:),NULL);
}
}
#pragma mark - 保存到相册
-(void)image:(UIImage *)image didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo
{
if(!error){
NSLog(@"存到相册");
}else{
NSLog(@"存储失败");
}
}
@end
......
This diff is collapsed. Click to expand it.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Demo.xcodeproj">
</FileRef>
</Workspace>
{
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "D1584AEF25B5C21395F515B62C90B71E0ACB26B2",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
"5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : {
}
},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"D1584AEF25B5C21395F515B62C90B71E0ACB26B2" : 0,
"5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : 0
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "8119CC7B-EDC1-4646-9378-8ECAC2EEB94B",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"D1584AEF25B5C21395F515B62C90B71E0ACB26B2" : "public_sdk_ios\/",
"5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : "youai_foolsdk_ios\/"
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "Demo",
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "PoolSdk_Demo\/Demo.xcodeproj",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "svn:\/\/10.21.210.99",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5b13317c-0110-4367-8746-06bc6aadd3cd++2397"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ssh:\/\/106.75.192.252:10022\/public_service\/public_sdk_ios.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D1584AEF25B5C21395F515B62C90B71E0ACB26B2"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../PoolSdk/PoolSdk/SDKInterface.m"
timestampString = "471440051.171901"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "77"
endingLineNumber = "77"
landmarkName = "-receiveLoginMessage:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../PoolSdk/PoolSdk/SDKInterface.m"
timestampString = "471440051.171901"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "43"
endingLineNumber = "43"
landmarkName = "-SDKloginSDK"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
BuildableName = "DemoTests.xctest"
BlueprintName = "DemoTests"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
BuildableName = "DemoTests.xctest"
BlueprintName = "DemoTests"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Demo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>BB5F3C871C1811BC00DA339D</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>BB5F3CA01C1811BC00DA339D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Demo/SDKInterface.h"
timestampString = "474775745.083759"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "9"
endingLineNumber = "9"
landmarkName = "@interface SDKInterface"
landmarkType = "2">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D"
BuildableName = "DemoTests.xctest"
BlueprintName = "DemoTests"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo_xingwan_login.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo_xingwan_login.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BB5F3C871C1811BC00DA339D"
BuildableName = "Demo.app"
BlueprintName = "Demo"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Demo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>BB5F3C871C1811BC00DA339D</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>BB5F3CA01C1811BC00DA339D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
No preview for this file type
No preview for this file type
No preview for this file type
//
// DCSdk.h
// DCSdk
//
// Created by xqwang on 13-7-8.
// Copyright (c) 2013年 digitcube. All rights reserved.
//
#import <Foundation/Foundation.h>
//这里提供静态方法
@interface DCTrackingAgent : NSObject
/**
* @brief 初始化接口,程序启动时调用
*
* 一般在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions内调用一次即可
* !!!一定要调用,否则后面无法上报,只能调用一次
* @param appId 在我们网站上创建游戏时分配的appId,用于标识这款游戏. 注意保密!
* @param channelId 渠道id , 方便统计分析你在各渠道的推广效果
*/
+ (void)initWithAppId:(NSString *)appId andChannelId:(NSString*)channelId;
/**
* @brief 设置数据上报间隔时间,该接口需要在onStart接口之前调用,否则无效。如果不调用该接口,SDK默认以1分钟的间隔上报数据
*
**/
+(void)setUploadInterval:(unsigned int)time;
/**
* @brief 设置应用版本号,不调用该接口时SDK默认从配置文件中读取应用版本号
*
* @param version:应用版本号
*/
+(void)setVersion:(NSString*)version;
/**
* @brief 立即上报数据
**/
+(void)uploadNow;
/**
* @brief 获取设备ID
**/
+(NSString*)getUID;
@end
@interface DCTrackingPoint : NSObject
/**
@brief 广告效果追踪设置有效的效果点
@param pointId 广告效果点
@param propDictionary 触发时希望传入的属性字典
**/
+(void)setEffectPoint:(NSString*)pointId propDictionary:(NSDictionary*)dictionary;
/**
@brief 玩家登陆事件
@param accountId 玩家账户ID
**/
+(void)login:(NSString*)accountId;
/**
@brief 玩家注册事件
@param accountId 玩家账户ID
**/
+(void)createAccount:(NSString*)accountId;
/**
@brief 玩家付费事件
@param orderId 订单ID
@param currencyAmount 付费总额
@param currencyType 货币类型
@param paymentType 支付途径
**/
+(void)paymentSuccess:(NSString*)orderId currencyAmount:(double)currencyAmount currencyType:(NSString*)currencyType paymentType:(NSString*)paymentType;
@end
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -33,11 +33,6 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
......
No preview for this file type
......@@ -5,7 +5,7 @@
// Created by yun on 16/1/11.
// Copyright © 2016年 yun. All rights reserved.
//
#define TRACK_VERSION @"1.0.1"
#define TRACK_VERSION @"3.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
......@@ -15,7 +15,7 @@
热云移动广告效果监测 平台 api 请选择对应的api进行使用
*/
NS_ASSUME_NONNULL_BEGIN
@interface TrackingIO : NSObject
@interface ReYunChannel : NSObject
//开启打印日志 正式上线包请关掉
+(void) setPrintLog :(BOOL)print;
// 开启数据统计
......@@ -29,10 +29,10 @@ NS_ASSUME_NONNULL_BEGIN
// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
+(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;
+(void)setEvent:(NSString *)eventName;
//获取设备信息
+(NSString*)getDeviceId;
+(BOOL)RYApplication:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options;
@end
NS_ASSUME_NONNULL_END
\ No newline at end of file
......
......@@ -11,7 +11,8 @@
#import "YouaiSDK/YouaiSDKMgr.h"
#import "YouaiSDK/YouaiNotifications.h"
#import "YouaiSDK/YouaiLoginInfo.h"
#import "TrackingIO.h"
#import "ReYunTrack.h"
#import "DCTrackingAgent.h"
//SDK
......@@ -31,18 +32,23 @@ int mExchange;
[super SDKinit:control];
[PoolConfig getInstance];
[[YouaiSDKMgr getInstance]initSDK];
[[YouaiSDKMgr getInstance]setStyleName:@"sdk"];
[[YouaiSDKMgr getInstance]setServerUrl:@"https://sdk.shxingwan.com"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:youaiLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applePayCallBack:) name:@"applePayCallBack" object:nil];
[[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil];
NSString* channelId = [[PoolConfig getInstance] getValueByKey:@"gamechannelid"];
if(channelId == nil || [channelId length] <= 0){
channelId = @"unknown";
}
[TrackingIO initWithappKey:[[PoolConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
NSString* channelId = [[PoolConfig getInstance] getValueByKey:@"sdkSimpleName"];
[ReYunChannel initWithappKey:[[PoolConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
NSString* dateEyeAppId = [[PoolConfig getInstance] getValueByKey:@"dateEyeAppId"];
[DCTrackingAgent initWithAppId:dateEyeAppId andChannelId:channelId];
}
/**
......@@ -50,11 +56,16 @@ int mExchange;
*/
- (void)SDKloginSDK
{
NSLog(@"no parames login");
[self SDKloginSDK:self.controller];
}
- (void)SDKloginSDK:(UIViewController *)control
{
NSLog(@"调用了LoginSDK");
NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[YouaiSDKMgr getInstance]openLogin:appId :appKey :self.controller];
[[YouaiSDKMgr getInstance]openLogin:appId :appKey :control];
}
/**
......@@ -67,11 +78,7 @@ int mExchange;
loginInfo.openId = [[YouaiLoginInfo getInstance]openId];
loginInfo.sign = [[YouaiLoginInfo getInstance] token];
loginInfo.timestamp = [YouaiLoginInfo getInstance].timestamp;
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[PoolChecker getInstance] startCheck:loginInfo];
});
}
......@@ -146,13 +153,15 @@ int mExchange;
NSString* reportType = [reportInfo reportType];
if (reportInfo) {
if ([reportType isEqualToString:REPORT_ENTER]) {
[TrackingIO setLoginWithAccountID:[reportInfo playerId]];
[ReYunChannel setLoginWithAccountID:[reportInfo playerId]];//reyun login
[DCTrackingPoint login:[reportInfo playerId]];//dateeye login
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
}else if ([reportType isEqualToString:REPORT_CREATEROLE]){
[TrackingIO setRegisterWithAccountID:[reportInfo playerId]];
}else if([reportType isEqualToString:REPORT_CREATEROLE]){
[ReYunChannel setRegisterWithAccountID:[reportInfo playerId]];//reyun reg
[DCTrackingPoint createAccount:[reportInfo playerId]];//reyun reg
}
}
}
......@@ -220,33 +229,28 @@ int mExchange;
NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
NSString *serverId = [payInfo serverId];
NSString *roleName = [payInfo playerName];
NSString *queryId = [payInfo queryId];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
NSString *isOpenThirdPay = [payInfo isOpenThirdPay];
NSLog(@"custom%@",[payInfo custom]);
if([isOpenThirdPay isEqualToString:@"false"]){
NSString* products = [payInfo products];
//NSLog(@"products:%@",products);
[[YouaiSDKMgr getInstance] openApplePay:self.controller products:products amount:[payInfo postAmount] queryId:queryId];
}else{
//NSString *isOpenThirdPay = [payInfo isOpenThirdPay];
NSString *other = [payInfo other];
if (other && [other length] > 0) {
[[YouaiSDKMgr getInstance] openPay:serverId :roleName :amount :[payInfo queryId] :self.controller];
}else{
NSString* products = [payInfo products];
[[YouaiSDKMgr getInstance] openApplePay:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:[payInfo queryId]];
}
int64_t delayInSeconds = 5.0; // 延迟的时间
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
NSLog(@"chage state");
[[PoolChecker getInstance] setOnlyOneTimePay:false];
});
}
-(void)paymentSuccess:(NSString *)accountId orderId:(NSString *)orderId currencyAmount:(double)amount currencyType:(NSString *)currencyType payType:(NSString *)payType custom:(NSArray *)customArray
{
[TrackingIO setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
[DCTrackingPoint paymentSuccess:orderId currencyAmount:amount currencyType:currencyType paymentType:payType];
[ReYunChannel setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
}
@end
\ No newline at end of file
......
{"renyunAppKey": "1", "payorderurl": "https://public.sdk.gzyouai.com/paycheck/create", "usertype": 150, "sdkSimpleName": "apple_youyu", "gamechannelid": "", "APP_KEY": "b06b86b79c25774ec758657a7203bae6", "custom": "{}", "sdkVersionCode": "V1_0", "loginCheckUrl": "https://public.sdk.gzyouai.com/logincheck/check", "appScheme": "com.qyj.ios.xw", "c2": "", "c1": "", "APP_ID": "58fd78a9834e7246b8dc0eac", "paycheckurl": "https://public.sdk.gzyouai.com/paycheck/confirm", "gameSimpleName": "fytx_test"}
\ No newline at end of file
{"renyunAppKey": "d4f6d8e337472e5277634bcdb1ef6cf6", "dateEyeAppId": "", "payorderurl": "https://public.sdk.gzyouai.com/paycheck/create", "usertype": 139, "sdkSimpleName": "apple_xingwan", "gamechannelid": "", "APP_KEY": "f0455d5b7f2e982144b2ac8bc642e453", "custom": "{}", "sdkVersionCode": "V1_0", "loginCheckUrl": "https://public.sdk.gzyouai.com/logincheck/check", "appScheme": "com.ssmyj.ios.xw", "c2": "", "c1": "", "APP_ID": "5936756454c21d629d0c2755", "paycheckurl": "https://public.sdk.gzyouai.com/paycheck/confirm", "gameSimpleName": "qyj4"}
\ No newline at end of file
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>i9133public</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>public.sdk.gzyouai.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
<key>sdk.shxingwan.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
<key>statistic.public.sdk.gzyouai.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>i9133public</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>public.sdk.gzyouai.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
<key>sdk.shxingwan.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
<key>statistic.public.sdk.gzyouai.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
</dict>
</dict>
</plist>
\ No newline at end of file
//
// DCSdk.h
// DCSdk
//
// Created by xqwang on 13-7-8.
// Copyright (c) 2013年 digitcube. All rights reserved.
//
#import <Foundation/Foundation.h>
//这里提供静态方法
@interface DCTrackingAgent : NSObject
/**
* @brief 初始化接口,程序启动时调用
*
* 一般在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions内调用一次即可
* !!!一定要调用,否则后面无法上报,只能调用一次
* @param appId 在我们网站上创建游戏时分配的appId,用于标识这款游戏. 注意保密!
* @param channelId 渠道id , 方便统计分析你在各渠道的推广效果
*/
+ (void)initWithAppId:(NSString *)appId andChannelId:(NSString*)channelId;
/**
* @brief 设置数据上报间隔时间,该接口需要在onStart接口之前调用,否则无效。如果不调用该接口,SDK默认以1分钟的间隔上报数据
*
**/
+(void)setUploadInterval:(unsigned int)time;
/**
* @brief 设置应用版本号,不调用该接口时SDK默认从配置文件中读取应用版本号
*
* @param version:应用版本号
*/
+(void)setVersion:(NSString*)version;
/**
* @brief 立即上报数据
**/
+(void)uploadNow;
/**
* @brief 获取设备ID
**/
+(NSString*)getUID;
@end
@interface DCTrackingPoint : NSObject
/**
@brief 广告效果追踪设置有效的效果点
@param pointId 广告效果点
@param propDictionary 触发时希望传入的属性字典
**/
+(void)setEffectPoint:(NSString*)pointId propDictionary:(NSDictionary*)dictionary;
/**
@brief 玩家登陆事件
@param accountId 玩家账户ID
**/
+(void)login:(NSString*)accountId;
/**
@brief 玩家注册事件
@param accountId 玩家账户ID
**/
+(void)createAccount:(NSString*)accountId;
/**
@brief 玩家付费事件
@param orderId 订单ID
@param currencyAmount 付费总额
@param currencyType 货币类型
@param paymentType 支付途径
**/
+(void)paymentSuccess:(NSString*)orderId currencyAmount:(double)currencyAmount currencyType:(NSString*)currencyType paymentType:(NSString*)paymentType;
@end
......@@ -5,7 +5,7 @@
// Created by yun on 16/1/11.
// Copyright © 2016年 yun. All rights reserved.
//
#define TRACK_VERSION @"1.0.1"
#define TRACK_VERSION @"3.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
......@@ -15,7 +15,7 @@
热云移动广告效果监测 平台 api 请选择对应的api进行使用
*/
NS_ASSUME_NONNULL_BEGIN
@interface TrackingIO : NSObject
@interface ReYunChannel : NSObject
//开启打印日志 正式上线包请关掉
+(void) setPrintLog :(BOOL)print;
// 开启数据统计
......@@ -29,10 +29,10 @@ NS_ASSUME_NONNULL_BEGIN
// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
+(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;
+(void)setEvent:(NSString *)eventName;
//获取设备信息
+(NSString*)getDeviceId;
+(BOOL)RYApplication:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options;
@end
NS_ASSUME_NONNULL_END
\ No newline at end of file
......
//
// PPInterface.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <PoolSdk/PoolSdk2.h>
@interface SDKInterface : Interface
@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 "YouaiSDK/YouaiSDKMgr.h"
#import "YouaiSDK/YouaiNotifications.h"
#import "YouaiSDK/YouaiLoginInfo.h"
//SDK
@implementation SDKInterface : Interface
int mExchange;
/**
初始化SDK
*/
- (void)SDKinit:(UIViewController *) control
{
//必须继承
[super SDKinit:control];
[PoolConfig getInstance];
[[YouaiSDKMgr getInstance]initSDK];
[[YouaiSDKMgr getInstance]setStyleName:@"sdk"];
[[YouaiSDKMgr getInstance]setServerUrl:@"https://sdk.shxingwan.com"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:youaiLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applePayCallBack:) name:@"applePayCallBack" object:nil];
[[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil];
}
/**
登录SDK
*/
- (void)SDKloginSDK
{
NSLog(@"no parames login");
[self SDKloginSDK:self.controller];
}
- (void)SDKloginSDK:(UIViewController *)control
{
NSLog(@"调用了LoginSDK");
NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[YouaiSDKMgr getInstance]openLogin:appId :appKey :control];
}
/**
loginCheck
*/
- (void)receiveLoginMessage:(NSNotification *)notification
{
NSLog(@"loginchek");
PoolLoginInfo *loginInfo = [PoolLoginInfo alloc];
loginInfo.openId = [[YouaiLoginInfo getInstance]openId];
loginInfo.sign = [[YouaiLoginInfo getInstance] token];
loginInfo.timestamp = [YouaiLoginInfo getInstance].timestamp;
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[PoolChecker getInstance] startCheck:loginInfo];
});
}
-(NSString*)DataTojsonString:(id)object
{
NSString *jsonString = nil;
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object
options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string
error:&error];
jsonString = [jsonData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
return jsonString;
}
/**
苹果支付结果回调
*/
- (void)applePayCallBack:(NSNotification *)notification
{
NSDictionary* payResultDic = notification.object;
NSString* receiptStr = [payResultDic objectForKey:@"payResult"];
NSString* queryId = [payResultDic objectForKey:@"query_id"];
NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic];
if([@"success" isEqualToString:result]){//确认订单成功
}else{//失败
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];
}
}
/**
支付 创建订单
*/
- (void)SDKpayWithPaymentInfo:(PoolCreateOrderInfo *)payInfo
{
mExchange = [payInfo exchange].intValue;
[super SDKpayWithPaymentInfo:payInfo];
}
/**
SDK
*/
- (void)SDKgotoUserCenter
{
}
- (void)SDKreport:(PoolReportInfo *)reportInfo
{
NSLog(@"reportInfo");
NSString* reportType = [reportInfo reportType];
if (reportInfo) {
if ([reportType isEqualToString:REPORT_ENTER]) {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
}
}
}
/**
SDK
*/
- (void)SDKexitSDK
{
}
- (void)SDKlogoutSDK
{
NSLog(@"切换账号");
}
- (void)handleOpenurl:(NSURL *)url
{
}
- (void)receivePayMessage : (NSNotification *)notification;
{
NSString *order_id = [notification object];
NSLog(@"订单ID:%@", order_id);
}
//补单处理
- (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集合
if(queryIdArray){
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 createPayUrl] :receiptDic];
if([@"success" isEqualToString:result]){//成功
[userDefaults removeObjectForKey:queryId];
}else{//补单失败
[failQueryIdArray addObject:queryId];
}
}
NSLog(@"order count:%lu",(unsigned long)[failQueryIdArray count]);
if([failQueryIdArray count] > 0){//含有补单失败项
[userDefaults setObject:failQueryIdArray forKey:@"queryIds"];
}else{//全部补单成功
[userDefaults removeObjectForKey:@"queryIds"];
}
[userDefaults synchronize];
}
}
- (void)receiveCreateOrder:(NSNotification *)notification
{
NSLog(@"创建订单成功");
PoolPayInfo *payInfo = [notification object];
NSString *queryId = [payInfo queryId];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
NSString* products = [payInfo products];
[[YouaiSDKMgr getInstance]openApplePay:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:queryId];
int64_t delayInSeconds = 5.0; // 延迟的时间
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
NSLog(@"chage state");
[[PoolChecker getInstance] setOnlyOneTimePay:false];
});
}
@end
\ No newline at end of file
//
// IapController.h
// mangosanguo
//
// Created by Gino on 12-11-6.
// Copyright (c) 2012年 private. All rights reserved.
//
#if applepay
#import <Foundation/Foundation.h>
#import "StoreKit/StoreKit.h"
@interface IapController : NSObject<SKProductsRequestDelegate,SKPaymentTransactionObserver>
{
bool isRequestedBuy;
SKPaymentTransaction *PayTransaction;
NSMutableArray *payArray;
SKPaymentTransaction *curTransaction;
}
+ (IapController *)sharedController;
- (id)init;
- (void)removeIt;
- (void)requestProductData;
- (void)requestBuyProduct:(NSString *)identifier;
- (void)requestProductInfoById:(NSString *)str;
- (void)comfireTransactions:(bool)isSuessPosted;
- (void)checkReceiptIsFail;
- (void)addItemToPayArray:(SKPaymentTransaction *)transaction;
- (bool)checkPayArrayIsEmpty;
- (void)checkReceiptForArray;
- (void)setAppleCallBack: (NSString*)url;
@end
#endif
\ No newline at end of file
//
// 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
//
// YouaiLoginInfo.h
// YouaiSDK
//
// Created by 莫 东荣 on 13-4-10.
// Copyright (c) 2013年 莫 东荣. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface YouaiLoginInfo : NSObject //用户uid
{
//
NSString *openId;
//token
NSString *token;
//时间戳
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
//
// 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 youaiPaytNotification; /**< 支付通知 */
extern NSString * const youaiShareNotification; /**< 分享通知 */
extern NSString * const youaiCenterNotification; /**< 用户中心通知 */
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_;
// NSString* openId;
// NSString* loginKey;
}
@property bool isApplePaying;
+ (YouaiSDKMgr *)getInstance;
- (void)initSDK;
- (void)initSDK:(NSString *)weixinId;
- (void)setServerUrl:(NSString *)serverUrl;
- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller;
- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *) inviterCode;
- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *) inviterCode : (NSString *)userName : (NSString *)passWord;
- (void)setStyleName:(NSString*)styleName;
- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *)userName : (NSString *)passWord;
- (void)openCenter: (UIViewController *)controller;
- (void)openPay: (NSString *)serverId : (NSString *)nickName : (NSString *)callBack : (UIViewController *)controller;
- (void)openPay: (NSString *)serverId : (NSString *)nickName : (NSNumber *)payAmount : (NSString *)callBack : (UIViewController *)controller;
- (void)openShare: (UIViewController *)controller;
- (void)openApplePay:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount productName:(NSString*)productName queryId:(NSString*) queryId;
- (void)applePayCallBack:(NSString *)url :(SKPaymentTransaction *)transaction :(NSString *)resultStr;
@end
//
// YouaiViewController.h
// newYouaiSDK
//
// Created by Mog90 on 14-9-28.
// Copyright (c) 2014年 东荣 莫. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "YouaiLoginInfo.h"
@interface YouaiViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
{
UIWebView *webView_;
UIActivityIndicatorView *activityIndicator;
}
//@property(assign) int webViewWidth;
//@property(assign) int webViewHeight;
//@property(assign) int screenwidth;
//@property(assign) int screenHeight;
@property(assign) BOOL hasCorner;
-(void)setView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
- (void)initWebView;
- (void)loadWebPageWithString:(NSString *)url;
- (void)loadWebPageWithJs:(NSString *)content;
- (void)postNotification:(NSString *)name : (NSString *)code;
- (void)receiveIap:(NSNotification *)notification;
@end
{"renyunAppKey": "d4f6d8e337472e5277634bcdb1ef6cf6", "dateEyeAppId": "", "payorderurl": "http://183.57.76.181:9020/paycheck/create", "usertype": 139, "sdkSimpleName": "apple_xingwan", "gamechannelid": "", "APP_KEY": "f0455d5b7f2e982144b2ac8bc642e453", "custom": "{}", "sdkVersionCode": "V1_0", "loginCheckUrl": "http://183.57.76.181:9010/logincheck/check", "appScheme": "com.ssmyj.ios.xw", "c2": "", "c1": "", "APP_ID": "5936756454c21d629d0c2755", "paycheckurl": "http://183.57.76.181:9020/paycheck/confirm", "gameSimpleName": "fytx_test"}
\ No newline at end of file
import shutil
import os
import plistlib
import config
import json
import packageProj
from mod_pbxproj import XcodeProject
gameProjName = config.gameProjName
channelName = "xingwan_login"
#copy dir xcodeproj
copyNewDirName = gameProjName + '_' + channelName + '.xcodeproj'
currentPath = os.path.abspath('.')
currentPath += '/' + copyNewDirName
if os.path.exists(currentPath):
shutil.rmtree(currentPath)
shutil.copytree(gameProjName + '.xcodeproj',currentPath)
project = XcodeProject.Load(copyNewDirName + '/project.pbxproj')
project.add_other_ldflags('-ObjC')
#frameworks = project.add_folder('poolsdk_file/poolsdk_itools')
#print(frameworks);
#add search path
channelRootPath = config.channelRootPath#'poolsdk_file'
frameworksPath = '$(PROJECT_DIR)/' + channelRootPath + '/poolsdk_' + channelName + '/SDK'
print(frameworksPath);
#add header search path
project.add_header_search_paths(frameworksPath, recursive=False)
#add framework search path
project.add_framework_search_paths(frameworksPath, recursive=False)
#add library search path
project.add_library_search_paths(frameworksPath, recursive=False)
#add poolsdk_xy dir all file into project
project.remove_group_by_name('poolsdk')
frameworkRelativePath = project.add_folder(channelRootPath + '/poolsdk_' + channelName + '/SDK')
project.add_file_if_doesnt_exist('pool_setting',parent=frameworkRelativePath, weak=True,ignore_unknown_type=True)
systemFrameworks = project.get_or_create_group('Frameworks')
#add system framework
project.add_file_if_doesnt_exist('System/Library/Frameworks/Security.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/StoreKit.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/Foundation.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/QuartzCore.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreText.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreGraphics.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/UIKit.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreMotion.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/CFNetwork.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreLocation.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreTelephony.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/SystemConfiguration.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
#add system dylib
systemLibs = project.get_or_create_group('Libraries')
project.add_file_if_doesnt_exist('/usr/lib/libsqlite3.dylib',parent=systemLibs, weak=True, tree='<absolute>')#absolute path
project.add_file_if_doesnt_exist('/usr/lib/libz.1.dylib',parent=systemLibs, weak=True, tree='<absolute>')
project.add_file_if_doesnt_exist('/usr/lib/libc++.1.dylib',parent=systemLibs, weak=True, tree='<absolute>')
#modify info.plist reference path
project.add_single_valued_flag('INFOPLIST_FILE',channelRootPath + '/poolsdk_' + channelName + '/Info.plist')
project.add_single_valued_flag('ENABLE_BITCODE', 'NO')
readInfoPlistFilePath = channelRootPath + '/poolsdk/Info.plist'
writeInfoFilePath = channelRootPath + '/poolsdk_' + channelName + '/Info.plist'
infoContent = plistlib.readPlist(readInfoPlistFilePath)
xyInfoPath = channelRootPath + '/poolsdk_' + channelName + '/Info_' + channelName + '.plist'
xyInfoContent = plistlib.readPlist(xyInfoPath)
#read pool_setting file
settingFile = open(channelRootPath + '/poolsdk_' + channelName + '/SDK/pool_setting','rw')
try:
settingFileContent = settingFile.read( )
finally:
settingFile.close( )
#json op
jsonStr = json.loads(settingFileContent)
#modify bundle id
project.add_single_valued_flag('PRODUCT_BUNDLE_IDENTIFIER',jsonStr["appScheme"])
#update and add info.plist content
infoContent.update(xyInfoContent)
#write
plistlib.writePlist(infoContent,writeInfoFilePath)
project.save()
packageProj.buildProjName = gameProjName + '_' + channelName
packageProj.targetName = gameProjName
packageProj.buildProj()
//
// DCSdk.h
// DCSdk
//
// Created by xqwang on 13-7-8.
// Copyright (c) 2013年 digitcube. All rights reserved.
//
#import <Foundation/Foundation.h>
//这里提供静态方法
@interface DCTrackingAgent : NSObject
/**
* @brief 初始化接口,程序启动时调用
*
* 一般在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions内调用一次即可
* !!!一定要调用,否则后面无法上报,只能调用一次
* @param appId 在我们网站上创建游戏时分配的appId,用于标识这款游戏. 注意保密!
* @param channelId 渠道id , 方便统计分析你在各渠道的推广效果
*/
+ (void)initWithAppId:(NSString *)appId andChannelId:(NSString*)channelId;
/**
* @brief 设置数据上报间隔时间,该接口需要在onStart接口之前调用,否则无效。如果不调用该接口,SDK默认以1分钟的间隔上报数据
*
**/
+(void)setUploadInterval:(unsigned int)time;
/**
* @brief 设置应用版本号,不调用该接口时SDK默认从配置文件中读取应用版本号
*
* @param version:应用版本号
*/
+(void)setVersion:(NSString*)version;
/**
* @brief 立即上报数据
**/
+(void)uploadNow;
/**
* @brief 获取设备ID
**/
+(NSString*)getUID;
@end
@interface DCTrackingPoint : NSObject
/**
@brief 广告效果追踪设置有效的效果点
@param pointId 广告效果点
@param propDictionary 触发时希望传入的属性字典
**/
+(void)setEffectPoint:(NSString*)pointId propDictionary:(NSDictionary*)dictionary;
/**
@brief 玩家登陆事件
@param accountId 玩家账户ID
**/
+(void)login:(NSString*)accountId;
/**
@brief 玩家注册事件
@param accountId 玩家账户ID
**/
+(void)createAccount:(NSString*)accountId;
/**
@brief 玩家付费事件
@param orderId 订单ID
@param currencyAmount 付费总额
@param currencyType 货币类型
@param paymentType 支付途径
**/
+(void)paymentSuccess:(NSString*)orderId currencyAmount:(double)currencyAmount currencyType:(NSString*)currencyType paymentType:(NSString*)paymentType;
@end
No preview for this file type
//
// NewTtack.h
// NewTtack
//
// Created by yun on 16/1/11.
// Copyright © 2016年 yun. All rights reserved.
//
#define TRACK_VERSION @"3.0.1"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/*
热云移动广告效果监测 平台 api 请选择对应的api进行使用
*/
NS_ASSUME_NONNULL_BEGIN
@interface ReYunChannel : NSObject
//开启打印日志 正式上线包请关掉
+(void) setPrintLog :(BOOL)print;
// 开启数据统计
+ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
//注册成功后调用
+ (void)setRegisterWithAccountID:(NSString *)account;
//登陆成功后调用
+ (void)setLoginWithAccountID:(NSString *)account;
//开始付费时 调用(人民币单位是元)
+(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;
//获取设备信息
+(NSString*)getDeviceId;
+(BOOL)RYApplication:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options;
@end
NS_ASSUME_NONNULL_END
\ No newline at end of file
......@@ -11,7 +11,8 @@
#import "YouaiSDK/YouaiSDKMgr.h"
#import "YouaiSDK/YouaiNotifications.h"
#import "YouaiSDK/YouaiLoginInfo.h"
#import "TrackingIO.h"
#import "ReYunTrack.h"
#import "DCTrackingAgent.h"
//SDK
......@@ -31,18 +32,23 @@ int mExchange;
[super SDKinit:control];
[PoolConfig getInstance];
[[YouaiSDKMgr getInstance]initSDK];
[[YouaiSDKMgr getInstance]setStyleName:@"sdk"];
[[YouaiSDKMgr getInstance]setServerUrl:@"https://sdk.shxingwan.com"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:youaiLoginNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applePayCallBack:) name:@"applePayCallBack" object:nil];
[[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil];
NSString* channelId = [[PoolConfig getInstance] getValueByKey:@"gamechannelid"];
if(channelId == nil || [channelId length] <= 0){
channelId = @"unknown";
}
[TrackingIO initWithappKey:[[PoolConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
NSString* channelId = [[PoolConfig getInstance] getValueByKey:@"sdkSimpleName"];
[ReYunChannel initWithappKey:[[PoolConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
NSString* dateEyeAppId = [[PoolConfig getInstance] getValueByKey:@"dateEyeAppId"];
[DCTrackingAgent initWithAppId:dateEyeAppId andChannelId:channelId];
}
/**
......@@ -50,11 +56,16 @@ int mExchange;
*/
- (void)SDKloginSDK
{
NSLog(@"no parames login");
[self SDKloginSDK:self.controller];
}
- (void)SDKloginSDK:(UIViewController *)control
{
NSLog(@"调用了LoginSDK");
NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[YouaiSDKMgr getInstance]openLogin:appId :appKey :self.controller];
[[YouaiSDKMgr getInstance]openLogin:appId :appKey :control];
}
/**
......@@ -67,11 +78,7 @@ int mExchange;
loginInfo.openId = [[YouaiLoginInfo getInstance]openId];
loginInfo.sign = [[YouaiLoginInfo getInstance] token];
loginInfo.timestamp = [YouaiLoginInfo getInstance].timestamp;
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[[PoolChecker getInstance] startCheck:loginInfo];
});
}
......@@ -146,13 +153,15 @@ int mExchange;
NSString* reportType = [reportInfo reportType];
if (reportInfo) {
if ([reportType isEqualToString:REPORT_ENTER]) {
[TrackingIO setLoginWithAccountID:[reportInfo playerId]];
[ReYunChannel setLoginWithAccountID:[reportInfo playerId]];//reyun login
[DCTrackingPoint login:[reportInfo playerId]];//dateeye login
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
}else if ([reportType isEqualToString:REPORT_CREATEROLE]){
[TrackingIO setRegisterWithAccountID:[reportInfo playerId]];
}else if([reportType isEqualToString:REPORT_CREATEROLE]){
[ReYunChannel setRegisterWithAccountID:[reportInfo playerId]];//reyun reg
[DCTrackingPoint createAccount:[reportInfo playerId]];//reyun reg
}
}
}
......@@ -220,33 +229,28 @@ int mExchange;
NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
NSString *serverId = [payInfo serverId];
NSString *roleName = [payInfo playerName];
NSString *queryId = [payInfo queryId];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[self handlerLeakOrder];
});
NSString *isOpenThirdPay = [payInfo isOpenThirdPay];
NSLog(@"custom%@",[payInfo custom]);
if([isOpenThirdPay isEqualToString:@"false"]){
NSString* products = [payInfo products];
//NSLog(@"products:%@",products);
[[YouaiSDKMgr getInstance] openApplePay:self.controller products:products amount:[payInfo postAmount] queryId:queryId];
}else{
//NSString *isOpenThirdPay = [payInfo isOpenThirdPay];
NSString *other = [payInfo other];
if (other && [other length] > 0) {
[[YouaiSDKMgr getInstance] openPay:serverId :roleName :amount :[payInfo queryId] :self.controller];
}else{
NSString* products = [payInfo products];
[[YouaiSDKMgr getInstance] openApplePay:self.controller products:products amount:[payInfo postAmount] productName:[payInfo productName] queryId:[payInfo queryId]];
}
int64_t delayInSeconds = 5.0; // 延迟的时间
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
NSLog(@"chage state");
[[PoolChecker getInstance] setOnlyOneTimePay:false];
});
}
-(void)paymentSuccess:(NSString *)accountId orderId:(NSString *)orderId currencyAmount:(double)amount currencyType:(NSString *)currencyType payType:(NSString *)payType custom:(NSArray *)customArray
{
[TrackingIO setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
[DCTrackingPoint paymentSuccess:orderId currencyAmount:amount currencyType:currencyType paymentType:payType];
[ReYunChannel setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
}
@end
\ No newline at end of file
......
No preview for this file type
{"renyunAppKey": "1", "payorderurl": "https://public.sdk.gzyouai.com/paycheck/create", "usertype": 150, "sdkSimpleName": "apple_youyu", "gamechannelid": "", "APP_KEY": "b06b86b79c25774ec758657a7203bae6", "custom": "{}", "sdkVersionCode": "V1_0", "loginCheckUrl": "https://public.sdk.gzyouai.com/logincheck/check", "appScheme": "com.qyj.ios.xw", "c2": "", "c1": "", "APP_ID": "58fd78a9834e7246b8dc0eac", "paycheckurl": "https://public.sdk.gzyouai.com/paycheck/confirm", "gameSimpleName": "fytx_test"}
\ No newline at end of file
{"renyunAppKey": "d4f6d8e337472e5277634bcdb1ef6cf6", "dateEyeAppId": "", "payorderurl": "https://public.sdk.gzyouai.com/paycheck/create", "usertype": 139, "sdkSimpleName": "apple_xingwan", "gamechannelid": "", "APP_KEY": "f0455d5b7f2e982144b2ac8bc642e453", "custom": "{}", "sdkVersionCode": "V1_0", "loginCheckUrl": "https://public.sdk.gzyouai.com/logincheck/check", "appScheme": "com.ssmyj.ios.xw", "c2": "", "c1": "", "APP_ID": "5936756454c21d629d0c2755", "paycheckurl": "https://public.sdk.gzyouai.com/paycheck/confirm", "gameSimpleName": "qyj4"}
\ No newline at end of file
......