xuguohong

add public sdk ios

Showing 362 changed files with 2669 additions and 0 deletions
No preview for this file type
No preview for this file type
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" : "5b13317c-0110-4367-8746-06bc6aadd3cd++2397",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
"5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : {
}
},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : 0
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "8119CC7B-EDC1-4646-9378-8ECAC2EEB94B",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"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"
}
]
}
\ 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.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.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
//
// AppDelegate.h
// publiDemo
//
// Created by winFan on 11/30/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
//
// AppDelegate.m
// publiDemo
//
// Created by winFan on 11/30/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "AppDelegate.h"
#import "ViewController.h"
#import "PoolSdk.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (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.
}
- (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.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
NSLog(@"hanldeOpenURL%@",url.path );
[[PoolSdk shareSDK] handleOpenurl:url];
return true;
}
@end
No preview for this file type
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 winFan. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Demo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<scenes>
<!--Main View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="MainViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GQW-et-jRb">
<rect key="frame" x="196" y="71" width="208" height="30"/>
<state key="normal" title="初始化"/>
<connections>
<action selector="actionInit:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Srh-bu-gYD"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s0O-FE-ge8">
<rect key="frame" x="213" y="123" width="175" height="30"/>
<state key="normal" title="登录"/>
<connections>
<action selector="actionLogin:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="381-gB-ImA"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JQY-uO-q36">
<rect key="frame" x="205" y="168" width="191" height="30"/>
<state key="normal" title="充值"/>
<connections>
<action selector="actionPay:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="bvf-M4-rqy"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5na-1c-IlO">
<rect key="frame" x="250" y="218" width="100" height="30"/>
<state key="normal" title="数据"/>
<connections>
<action selector="actionSubmitRoleData:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="aNf-Iw-unv"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Q9b-py-Nk0">
<rect key="frame" x="233" y="268" width="134" height="30"/>
<state key="normal" title="注销"/>
<connections>
<action selector="actionLogout:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="t6e-7P-tJU"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="445" y="282"/>
</scene>
</scenes>
</document>
<?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>com.mango.ios.fytx</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>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<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>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// MainViewController.h
// Demo_qiyu
//
// Created by 许 on 17/6/7.
// Copyright © 2017年 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MainViewController : UIViewController
@end
//
// MainViewController.m
// Demo_qiyu
//
// Created by 许 on 17/6/7.
// Copyright © 2017年 winFan. All rights reserved.
//
#import "MainViewController.h"
#import "PoolSdk.h"
@interface MainViewController ()
@end
@implementation MainViewController
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:poolSDK_Notification object:nil];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
//[[PoolSdk shareSDK] viewDidAppear];
}
- (void)receiveSDKMessage:(NSNotification *)notification
{
PoolSDKResult *result = [notification object];
if (result) {
NSLog(@"notiType:%d",result.notiType);
switch (result.notiType) {
case PoolSDKNotificationInitSDK:
{
NSLog(@"sdk初始化成功");
}
break;
case PoolSDKNotificationLogin:
{
NSLog(@"result state:%d",result.statusCode);
if (result.statusCode == POOLSDK_NO_ERROR) {
PoolLoginInfo *loginInfo = (PoolLoginInfo*)result.extendData;
NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
NSLog(@"userType:%@",[loginInfo userType]);
}else{
NSLog(@"%@",[result description]);
}
}
break;
case PoolSDKNotificationLogout:
{
NSLog(@"sdk注销成功,游戏处理");
}
break;
default:
break;
}
}
}
- (IBAction)actionInit:(id)sender {
[[PoolSdk shareSDK]initSDK:self];
}
- (IBAction)actionLogin:(id)sender {
[[PoolSdk shareSDK] loginSDK];
}
- (IBAction)actionPay:(id)sender {
PoolCreateOrderInfo *payInfo = [[PoolCreateOrderInfo alloc]init];
[payInfo setServerId:@"111"];
[payInfo setPlayerName:@"roleName"];
[payInfo setPlayerLevel:@"10"];
[payInfo setPostAmount:@"6"];
[payInfo setProductId:@"com.fytx.6"];
[payInfo setPlayerId:@"1231241234"];
[payInfo setTimestamp:@"1232134"];
[payInfo setExchange:@"10"];
[payInfo setCustom:@"custom"];
NSLog(@"start pay");
[[PoolSdk shareSDK] payWithPaymentInfo:payInfo];
}
/**
serverid
servername
roleid
rolename
rolelevel
*/
- (IBAction)actionSubmitRoleData:(id)sender {
NSLog(@"数据接口");
PoolReportInfo *reportInfo = [[PoolReportInfo alloc]init];
[reportInfo setReportType:REPORT_ENTER];
//[reportInfo setReportType:REPORT_CREATEROLE];
//[reportInfo setReportType:REPORT_ROLEUPGRADE]
[reportInfo setServerId:@"9133"];
[reportInfo setServerName:@"serverName"];
[reportInfo setPlayerId:@"123456"];
[reportInfo setPlayerName:@"playName"];
[reportInfo setPlayerLevel:@"100"];
[[PoolSdk shareSDK] reportSDK:reportInfo];
}
- (IBAction)actionLogout:(id)sender {
NSLog(@"注销");
[[PoolSdk shareSDK] logoutSDK];
}
@end
//
// 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, ...);
typedef NS_ENUM(NSInteger, DGLoggerLevel)
{
ELogVerbose = 1,
ELogDebug,
ELogInfo,
ELogWarn,
ELogError
};
@interface DGLogger : NSObject
+ (void)showLog:(NSString *)fmt,...;
+ (void)showLog:(DGLoggerLevel)level log:(NSString *)fmt,...;
+ (void)isShowLog:(BOOL)flag;
@end
//
// Interface.h
// PoolSdk
//
// Created by winFan on 12/10/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#include "UnionInterface.h"
#import <SafariServices/SafariServices.h>
@interface Interface : NSObject <UnionInterface,SFSafariViewControllerDelegate>
@property(nonatomic, strong)UIViewController *controller;
@end
\ No newline at end of file
//
// 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
@property(nonatomic,retain) NSMutableData *receiveData;
@property(nonatomic,assign)int dataPackSerialNo;
+ (NetCenter *)getInstance;
- (NSString *)httpGetSyn:(NSString *) getUrl;
- (NSString *)httpPostSyn:(NSString *) postUrl : (NSDictionary *) postData;
- (void)httpGetNoSyn;
- (void)httpPostNoSyn:(NSString *) postUrl :(NSDictionary *)postDict;
- (void)httpPostAsync:(NSString*)postUrl :(NSDictionary*)postDict;
- (void)httpPostAsyncOpen:(NSString*)postUrl :(NSDictionary*)postDict;
- (NSString *)dicToString:(NSDictionary *) dict;
@end
//
// OtherSetting.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#ifndef __PoolSdk__OtherSetting__
#define __PoolSdk__OtherSetting__
/**
应用支持的方向
*/
typedef NS_ENUM(NSUInteger, ESDKOrientation) {
ESDKOrientationPortrait = 1,//竖
ESDKOrientationLandscape,//横
ESDKOrientationNone//自动旋转
};
/**
应用支持的方向
*/
typedef NS_ENUM(NSUInteger, REPORT_TYPE) {
REPORT_TYPE_OPEN = 1,//竖
REPORT_TYPE_ENTER,//横
REPORT_TYPE_DEFINE//自动旋转
};
#endif /* defined(__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"
#import "PoolSdk/PoolCreateOrderInfo.h"
#import "PoolSdk/PoolPayInfo.h"
#import "PoolReportInfo.h"
#import "PoolSdkDelegate.h"
@interface PoolChecker : NSObject<PoolSdkDelegate>
@property(nonatomic, strong)NSString *userId;
@property(nonatomic, strong)id<PoolSdkDelegate> mPoolSdkDelegate;
@property bool onlyOneTimePay;
+ (PoolChecker *)getInstance;
- (void)initChecker;
- (void)startCheck:(PoolLoginInfo *)loginInfo;
- (void) createOrder:(PoolCreateOrderInfo *)payInfo;
- (void) reportOpen;
- (void) reportSDKOpen;
- (void)handleFirstOpenApp:(NSString*) path;
- (void) reportEnter:(PoolReportInfo *)reInfo;
- (void) report:(NSString *)_action :(PoolReportInfo *)reInfo;
- (void)sendNotice:(PoolSDKNotificationType)notiType
notiName:(NSString *)notiName
statusCode:(int)nCode
description:(NSString *)szDescripton
extendData:(NSObject *)extendData;
- (void)startCheckDelegate:(PoolLoginInfo *)loginInfo;
- (void)setPoolSdkDelegate:(nullable id<PoolSdkDelegate>)poolSdkDeletate;
@end
//
// PoolConfig.h
// PoolSdk
//
// Created by winFan on 12/11/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PoolConfig : NSObject
@property(nonatomic, strong)NSString *gameSimpleName;
@property(nonatomic, strong)NSString *sdkSimpleName;
@property(nonatomic, strong)NSString *sdkVersionCode;
@property(nonatomic, strong)NSString *loginCheckUrl;
@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;
+ (PoolConfig *)getInstance;
- (void) loadFile:(NSString *) fileName;
- (NSString *)getValueByKey:(NSString *) key;
- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
@end
\ No newline at end of file
//
// 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;//角色名称
@property(nonatomic, strong)NSString *playerId;//玩家ID
@property(nonatomic, strong)NSString *playerName;//玩家名称
@property(nonatomic, strong)NSString *playerLevel;//玩家等级
@property(nonatomic, strong)NSString *postAmount;//金额
@property(nonatomic, strong)NSString *productId;//产品ID
@property(nonatomic, strong)NSString *productName;//产品名称
@property(nonatomic, strong)NSString *productDesc;//产品描述
@property(nonatomic, strong)NSString *custom;//透传参数
@property(nonatomic, strong)NSString *exchange;//兑换比例
@property(nonatomic, strong)NSString *otherInfo;//扩展参数
@property(nonatomic, strong)NSString *userId;//用户ID
@property(nonatomic, strong)NSString *timestamp;//时间戳
- (NSString *) getTsign ;
- (NSString *) getTimestamp ;
@end
\ No newline at end of file
//
// 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;//serverSign
@property(nonatomic, strong)NSString *other;//透传
@property(nonatomic, strong)NSString *openId;
@property(nonatomic, strong)NSString *userType;
@end
\ No newline at end of file
//
// PoolNotification.h
// public_i9133
//
// Created by winFan on 12/1/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString * const poolSDK_Notification; /**< */
extern NSString * const _create_order_notification; /**< */
/**
应用支持的方向
*/
typedef NS_ENUM(int, PoolSDKNotificationType) {
PoolSDKNotificationLogin = 1,//登录
PoolSDKNotificationLogout,//注销
PoolSDKNotificationPay,//支付完成
PoolSDKNotificationPause,//暂停退出
PoolSDKNotificationRole,//创建角色
PoolSDKNotificationInitSDK//初始化SDK
};
@interface PoolNotification : NSObject
@end
//////////////////////////////////////////////////////////////////////
@interface PoolSDKResult : NSObject
@property(nonatomic, assign)int statusCode;//请参照此文件下面状态标识
@property(nonatomic, strong)NSString *resultDescription;
@property(nonatomic, strong)NSObject *extendData;
//V1.2.0新增
@property(nonatomic, assign)PoolSDKNotificationType notiType;//消息类型
@property(nonatomic, strong)NSString *notiName;//消息名称
@end
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/* 状态标识 */
#define POOLSDK_NO_ERROR 0 /*操作成功*/
#define POOLSDK_ERROR_LOGIN_FAILED -100 /*登录失败*/
#define POOLSDK_ERROR_LOGIN_CANCEL -101 /*登录取消*/
#define POOLSDK_ERROR_LOGIN_GAMGEACCOUNT -102 /*游戏帐号登录,非平台账号*/
#define POOLSDK_ERROR_PAY_FAILED -200 /*支付失败*/
#define POOLSDK_ERROR_PAY_CANCEL -201 /*支付取消*/
#define POOLSDK_ERROR_PAY_VERSIGN -202 /*支付验签失败*/
#define POOLSDK_ERROR_CREATE_ORDER_FAILED -203 /*支付验签失败*/
#define POOLSDK_ERROR_ROLE_CREATE_FAILED -300 /*角色创建失败*/
#define POOLSDK_ERROR_INIT_FAILED -400 /*初始化失败*/
//////////////////////////////////////////////////////////////////////
//
// 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;
@property(nonatomic, strong)NSString *playerId;
@property(nonatomic, strong)NSString *playerName;
@property(nonatomic, strong)NSString *postAmount;
@property(nonatomic, strong)NSString *productId;
@property(nonatomic, strong)NSString *products;
@property(nonatomic, strong)NSString *custom;
@property(nonatomic, strong)NSString *postTime;
@property(nonatomic, strong)NSString *other;
@property(nonatomic, strong)NSString *isOpenThirdPay;//是否开启第三方充值
@end
\ No newline at end of file
//
// PoolReportInfo.h
// PoolSdk
//
// Created by winFan on 12/21/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk/PoolBaseModel.h"
@interface PoolReportInfo : PoolBaseModel
@property(nonatomic, strong)NSString *serverId;//服务器ID
@property(nonatomic, strong)NSString *serverName;//服务器名称
@property(nonatomic, strong)NSString *playerId;//玩家ID
@property(nonatomic, strong)NSString *playerName;//玩家名称
@property(nonatomic, strong)NSString *playerLevel;//玩家等级
@property(nonatomic, strong)NSString *custom;//透传参数
@property(nonatomic, strong)NSString *reportType;//类型
@property(nonatomic, strong)NSString *openId;
#define REPORT_URL @"https://statistic.public.sdk.gzyouai.com/sdk/statistic" //@http://public.sdk.gzyouai.com:9030/sdk/statistic"//@"http://10.200.201.230:9001/sdk/statistic"//@"https://statistic.public.sdk.gzyouai.com/sdk/statistic"//
#define REPORT_OPEN @"open"
#define REPORT_ENTER @"enter"
#define REPORT_CREATEROLE @"createrole"
#define REPORT_ROLEUPGRADE @"roleupgrade"
#define REPORT_SDK_OPEN @"opensdk"
@end
//
// PoolSdk.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <PoolSdk/PoolSdk2.h>
#import <UIKit/UIKit.h>
#import "TrackingIO.h"
@interface PoolSdk : NSObject
/**
* 当前SDK的版本
*/
@property(nonatomic, strong, readonly)NSString *sdkVersion;
/**
* 用于设置url types schemes 默认为工程名
*/
@property(nonatomic, strong)NSString *urlSchemes;
/**
获取SDK实例对象
*/
+ (PoolSdk *)shareSDK;
/**
初始化SDK
*/
- (void)initSDK:(UIViewController *) control;
-(void)viewDidAppear;
/**
登录SDK
*/
- (void)loginSDK;
/**
进行支付
*/
- (void)payWithPaymentInfo:(PoolCreateOrderInfo *)payInfo;
/**
用户中心
*/
- (void)gotoUserCenter;
/**
report
*/
- (void)reportSDK:(PoolReportInfo *)reportInfo;
/**
注销
*/
- (void)logoutSDK;
/**
退出
*/
- (void)exitSDK;
/**
显示/隐藏浮标
*/
//- (void)showFloatIcon:(BOOL)bFlag;
/**
// called in - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
*/
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
/**
应用 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;
@end
//
// 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 "PoolNotification.h"
#import "PoolPayInfo.h"
#import "UnionInterface.h"
#import "PoolCreateOrderInfo.h"
#import "PoolConfig.h"
#import "TrackingIO.h"
#import "PoolUtils.h"
#import "NetCenter.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>
@optional
-(void)PoolSdkLoginSuccess:(PoolLoginInfo*)loginInfo;
-(void)PoolSdkLoginFail:(NSString*)msg;
@end
//
// PoolUtils.h
// public_i9133
//
// Created by winFan on 12/3/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PoolUtils : NSObject
+(NSString *)md5:(NSString *)str;
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
+(NSString *)createPayOrderUrl;
//*充值回调地址
+(NSString *)createPayUrl;
@end
\ No newline at end of file
//
// 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)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 "PoolCreateOrderInfo.h"
#import "PoolReportInfo.h"
@protocol UnionInterface
/**
初始化SDK
*/
//[[PoolChecker getInstance] sendNotice:PoolSDKNotificationPay notiName:@"" statusCode:POOLSDK_NO_ERROR description:@"" extendData:order_id];
- (void)SDKinit:(UIViewController *) control;
/**
登录SDK
*/
- (void)SDKloginSDK;
/**
注销
*/
- (void)SDKlogoutSDK;
/**
退出
*/
- (void)SDKexitSDK;
/**
用户中心
*/
- (void)SDKgotoUserCenter;
- (void)viewDidAppear;
/**
提交数据
*/
- (void)SDKreport:(PoolReportInfo *) reportInfo;
/**
进行支付
*/
- (void)SDKpayWithPaymentInfo:(PoolCreateOrderInfo *)payInfo;
- (void)receiveCreateOrder: (NSNotification *)notification;
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
@end
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
//
// ViewController.h
// publiDemo
//
// Created by winFan on 11/30/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
- (void)receiveSDKMessage : (NSNotification *)notification;
@end
#import "ViewController.h"
#import "PoolSdk.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
[button1 setTitle:@"登陆" forState:UIControlStateNormal];
button1.frame = CGRectMake(50.0f, 100.0f, 50.0f, 40.0f);
button1.tag = 1;
[button1 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:button1];
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
[button2 setTitle:@"数据" forState:UIControlStateNormal];
button2.frame = CGRectMake(150.0f, 100.0f, 50.0f, 40.0f);
button2.tag = 2;
[button2 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:button2];
UIButton *button4 = [UIButton buttonWithType:UIButtonTypeCustom];
[button4 setTitle:@"充值" forState:UIControlStateNormal];
button4.frame = CGRectMake(150.0f, 50.0f, 50.0f, 40.0f);
button4.tag = 4;
[button4 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:button4];
UIButton *button6 = [UIButton buttonWithType:UIButtonTypeCustom];
[button6 setTitle:@"获取配置参数" forState:UIControlStateNormal];
button6.frame = CGRectMake(10.0f, 50.0f, 150.0f, 40.0f);
button6.tag = 6;
[button6 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview:button6];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:poolSDK_Notification object:nil];
[[PoolSdk shareSDK]initSDK:self];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
//[[PoolSdk shareSDK] viewDidAppear];
}
- (void) toggleButton: (UIButton *) button
{
int tag = (int)button.tag;
if (tag == 1) {
[[PoolSdk shareSDK] loginSDK];
}
else if (tag == 2)
{
NSLog(@"数据接口");
PoolReportInfo *reportInfo = [[PoolReportInfo alloc]init];
[reportInfo setReportType:REPORT_ENTER];
//[reportInfo setReportType:REPORT_CREATEROLE];
//[reportInfo setReportType:REPORT_ROLEUPGRADE]
[reportInfo setServerId:@"9133"];
[reportInfo setPlayerName:@"roleName"];
[reportInfo setPlayerId:@"pserverName"];
[[PoolSdk shareSDK] reportSDK:reportInfo];
}
else if (tag == 4)
{
PoolCreateOrderInfo *payInfo = [[PoolCreateOrderInfo alloc]init];
[payInfo setServerId:@"111"];
[payInfo setPostAmount:@"6"];
[payInfo setPlayerId:@"1231241234"];
[payInfo setTimestamp:@"1232134"];
[payInfo setExchange:@"10"];
[payInfo setCustom:@"custom"];
NSLog(@"start pay");
[[PoolSdk shareSDK] payWithPaymentInfo:payInfo];
}
else if(tag == 6){
PoolSdk *poolSdk = [PoolSdk shareSDK];
NSLog(@"channelId:%@parame1:%@parame2:%@custom:%@",[poolSdk getGameChannelId],[poolSdk getChannelParameter1],[poolSdk getChannelParameter2],[poolSdk getCustomValue]);
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)receiveSDKMessage:(NSNotification *)notification
{
NSLog(@"receiveSDKMessage");
[[PoolConfig getInstance] getValueByKey:@"gamechannelid"];
PoolSDKResult *result = [notification object];
if (result == nil ) {
return;
}
switch (result.notiType) {
case PoolSDKNotificationInitSDK:
{
NSLog(@"收到PoolSDKNotificationInitSDK");
}
break;
case PoolSDKNotificationLogin:
{
NSLog(@"result state:%d",result.statusCode);
if (result.statusCode == POOLSDK_NO_ERROR) {
PoolLoginInfo *loginInfo = (PoolLoginInfo*)result.extendData;
NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
NSLog(@"userType:%@",[loginInfo userType]);
}else{
NSLog(@"%@",[result description]);
}
}
break;
case PoolSDKNotificationPay:
{
NSLog(@"收到登陆信息PoolSDKNotificationPay");
}
break;
default:
break;
}
}
@end
//
// main.m
// Demo
//
// Created by winFan on 12/9/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
No preview for this file type
//
// DemoTests.m
// DemoTests
//
// Created by winFan on 12/9/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
@interface DemoTests : XCTestCase
@end
@implementation DemoTests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end
<?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>com.mango.ios.fytx.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
channelRootPath = "poolsdk_file"
gameProjName = 'Demo'
\ No newline at end of file
No preview for this file type
import shutil
import os
import plistlib
import config
import json
import packageProj
from mod_pbxproj import XcodeProject
gameProjName = config.gameProjName
channelName = "linyou"
#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/CoreTelephony.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
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/QuartzCore.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/SystemConfiguration.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/AdSupport.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/CoreText.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')
#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()
This diff is collapsed. Click to expand it.
No preview for this file type
import os
import commands
buildProjName = ''
targetName = ''
import shutil
import os
def buildProj():
if buildProjName == '':
print('buildProjName is not define')
else:
#build project
commands.getstatusoutput('xcodebuild -project ' + buildProjName + '.xcodeproj')
releaseDir = os.path.abspath('.') + '/Release'
if not os.path.exists(releaseDir):
os.mkdir(releaseDir)
ipaPath = releaseDir + '/' + buildProjName + '-Release.ipa'
buildPath = os.path.abspath('.') + '/build'
if os.path.exists(ipaPath):
os.remove(ipaPath)
resultStr = commands.getstatusoutput('xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/' + targetName + '.app -o ' +ipaPath)
#print(resultStr)
if os.path.exists(buildPath):
shutil.rmtree(buildPath)
No preview for this file type
No preview for this file type
No preview for this file type
{
"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
<?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>com.youai.sdk</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<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>
//
// PoolSdk.h
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <PoolSdk/PoolSdk2.h>
#import <UIKit/UIKit.h>
@interface PoolSdk : NSObject
/**
* 当前SDK的版本
*/
@property(nonatomic, strong, readonly)NSString *sdkVersion;
/**
* 用于设置url types schemes 默认为工程名
*/
@property(nonatomic, strong)NSString *urlSchemes;
/**
获取SDK实例对象
*/
+ (PoolSdk *)shareSDK;
/**
初始化SDK
*/
- (void)initSDK:(UIViewController *) control;
-(void)viewDidAppear;
/**
登录SDK
*/
- (void)loginSDK;
/**
进行支付
*/
- (void)payWithPaymentInfo:(PoolCreateOrderInfo *)payInfo;
/**
用户中心
*/
- (void)gotoUserCenter;
/**
report
*/
- (void)reportSDK:(PoolReportInfo *)reportInfo;
/**
注销
*/
- (void)logoutSDK;
/**
退出
*/
- (void)exitSDK;
/**
显示/隐藏浮标
*/
//- (void)showFloatIcon:(BOOL)bFlag;
/**
// called in - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
*/
- (void)handleOpenurl:(NSURL *)url;
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
/**
应用 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;
@end
//
// PoolSdk.m
// PoolSdk
//
// Created by winFan on 11/23/15.
// Copyright (c) 2015 winFan. All rights reserved.
//
#import "PoolSdk.h"
#import "SDKInterface.h"
static PoolSdk *s_PoolSdkCerterInstance = nil;
static id<UnionInterface> _interface = nil;
@implementation PoolSdk : NSObject
- (id)init
{
if(self = [super init])
{
_sdkVersion = [NSString stringWithFormat:@"%@ - %@",[[PoolConfig getInstance] gameSimpleName], [[PoolConfig getInstance] sdkSimpleName]];
_interface = [[SDKInterface alloc] init];
self.urlSchemes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
}
return self;
}
- (void)initSDK :(UIViewController *) control
{
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"pool_everLaunched"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"pool_everLaunched"];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"pool_firstLaunch"];
}
else{
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"pool_firstLaunch"];
}
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]) {
}
[_interface SDKinit:control];
[[PoolChecker getInstance] reportSDKOpen];
NSString* channelId = [[PoolConfig getInstance] getValueByKey:@"gamechannelid"];
[TrackingIO initWithappKey:[[PoolConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
}
/**
获取SDK实例对象
*/
+ (PoolSdk *)shareSDK
{
static dispatch_once_t dgonceToken;
dispatch_once(&dgonceToken, ^{
s_PoolSdkCerterInstance = [[PoolSdk alloc] init];
s_PoolSdkCerterInstance.sdkOrientation = ESDKOrientationLandscape;
s_PoolSdkCerterInstance.bShowedFloat = NO;
});
return s_PoolSdkCerterInstance;
}
-(void)viewDidAppear{
[_interface viewDidAppear];
}
- (void)loginSDK
{
[[PoolChecker getInstance] reportOpen];
[_interface SDKloginSDK];
}
- (void)payWithPaymentInfo:(PoolCreateOrderInfo *)payInfo
{
[_interface SDKpayWithPaymentInfo:payInfo];
}
- (void)reportSDK:(PoolReportInfo *)reportInfo
{
NSString *reportT = [reportInfo reportType];
reportInfo.openId = [[PoolChecker getInstance] userId];
if ([reportT isEqualToString:REPORT_ENTER]) {
[[PoolChecker getInstance] reportEnter:reportInfo];
NSLog(@"reportSDK enter");
[TrackingIO setLoginWithAccountID:[reportInfo playerId]];
}else if ([reportT isEqualToString:REPORT_ROLEUPGRADE]){
}else if ([reportT isEqualToString:REPORT_CREATEROLE]){
NSLog(@"reportSDK createRole");
[TrackingIO setRegisterWithAccountID:[reportInfo playerId]];
}
// [[PoolChecker getInstance] reportOpen];
[_interface SDKreport:reportInfo];
}
- (void)gotoUserCenter
{
[_interface SDKgotoUserCenter];
}
- (void)logoutSDK
{
[_interface SDKlogoutSDK];
}
- (void)exitSDK
{
[_interface SDKexitSDK];
}
- (void)handleOpenurl:(NSURL *)url
{
NSLog(@"handleOpenurl%@",url);
if([[url host] isEqualToString:@"c_code"]){
NSString* path = url.path;
NSString* codeValue = [path substringFromIndex:1];
[[PoolChecker getInstance] handleFirstOpenApp:codeValue];
}
[_interface handleOpenurl:url];
}
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return [_interface application:application supportedInterfaceOrientationsForWindow:window];
}
- (NSString *)getGameChannelId{
return [[PoolConfig getInstance]getValueByKey:@"gamechannelid"];
}
- (NSString *)getCustomValue{
return [[PoolConfig getInstance]getValueByKey:@"custom"];
}
- (NSString *)getChannelParameter1{
return [[PoolConfig getInstance]getValueByKey:@"c1"];
}
- (NSString *)getChannelParameter2{
return [[PoolConfig getInstance]getValueByKey:@"c2"];
}
@end
//
// 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"];
[[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(@"调用了LoginSDK");
NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"];
NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"];
[[YouaiSDKMgr getInstance]openLogin:appId :appKey :self.controller];
}
/**
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];
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{
[[YouaiSDKMgr getInstance] openPay:serverId :roleName :amount :[payInfo queryId] :self.controller];
}
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;
}
+ (YouaiSDKMgr *)getInstance;
- (void)initSDK;
- (void)initSDK:(NSString *)weixinId;
- (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)log: (NSString*)log_key : (NSInteger)log_data: (NSString*)log_remark;
- (void)openApplePay:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount queryId:(NSString*) queryId;
- (void)checkAilpay: (NSURL *)url : (UIViewController *)controller;
- (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
{
"APP_ID": "58fd78a9834e7246b8dc0eac",
"APP_KEY":"b06b86b79c25774ec758657a7203bae6",
"renyunAppKey":"7ca554a6f94f5477c6592f4e484bb49d",
"appScheme": "com.qyj.ios.xw",
"gameSimpleName": "fytx_test",
"sdkSimpleName": "apple_youyu",
"sdkVersionCode":"V1_0",
"gamechannelid": "123456",
"custom": "",
"c2": "",
"c1": "",
"loginCheckUrl": "https://public.sdk.gzyouai.com/logincheck/check/",
"payorderurl": "https://public.sdk.gzyouai.com/paycheck/create",
"paycheckurl": "https://public.sdk.gzyouai.com/paycheck/confirm"
}
\ 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
#copy dir xcodeproj
copyNewDirName = gameProjName + '_youdian.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_youdian/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_youdian/SDK')
#ignore_unknown_type
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/MobileCoreServices.framework',parent=systemFrameworks, weak=True, tree='SDKROOT')
project.add_file_if_doesnt_exist('System/Library/Frameworks/WebKit.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/libz.1.dylib',parent=systemLibs, weak=True, tree='<absolute>')
#modify info.plist reference path
project.add_single_valued_flag('INFOPLIST_FILE',channelRootPath + '/poolsdk_youdian/Info.plist')
project.add_single_valued_flag('ENABLE_BITCODE', 'NO')
readInfoPlistFilePath = channelRootPath + '/poolsdk/Info.plist'
writeInfoFilePath = channelRootPath + '/poolsdk_youdian/Info.plist'
infoContent = plistlib.readPlist(readInfoPlistFilePath)
xyInfoPath = channelRootPath + '/poolsdk_youdian/Info_youdian.plist'
xyInfoContent = plistlib.readPlist(xyInfoPath)
#read pool_setting file
settingFile = open(channelRootPath + '/poolsdk_youdian/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 + '_youdian'
packageProj.targetName = gameProjName
packageProj.buildProj()
No preview for this file type
No preview for this file type
<?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>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.