1 | +{ | ||
2 | + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "5b13317c-0110-4367-8746-06bc6aadd3cd++2397", | ||
3 | + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { | ||
4 | + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : { | ||
5 | + | ||
6 | + } | ||
7 | + }, | ||
8 | + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { | ||
9 | + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : 0 | ||
10 | + }, | ||
11 | + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "8119CC7B-EDC1-4646-9378-8ECAC2EEB94B", | ||
12 | + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { | ||
13 | + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : "youai_foolsdk_ios\/" | ||
14 | + }, | ||
15 | + "DVTSourceControlWorkspaceBlueprintNameKey" : "Demo", | ||
16 | + "DVTSourceControlWorkspaceBlueprintVersion" : 204, | ||
17 | + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "PoolSdk_Demo\/Demo.xcodeproj", | ||
18 | + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ | ||
19 | + { | ||
20 | + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "svn:\/\/10.21.210.99", | ||
21 | + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion", | ||
22 | + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" | ||
23 | + } | ||
24 | + ] | ||
25 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<Bucket | ||
3 | + type = "1" | ||
4 | + version = "2.0"> | ||
5 | + <Breakpoints> | ||
6 | + <BreakpointProxy | ||
7 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
8 | + <BreakpointContent | ||
9 | + shouldBeEnabled = "Yes" | ||
10 | + ignoreCount = "0" | ||
11 | + continueAfterRunningActions = "No" | ||
12 | + filePath = "../PoolSdk/PoolSdk/SDKInterface.m" | ||
13 | + timestampString = "471440051.171901" | ||
14 | + startingColumnNumber = "9223372036854775807" | ||
15 | + endingColumnNumber = "9223372036854775807" | ||
16 | + startingLineNumber = "77" | ||
17 | + endingLineNumber = "77" | ||
18 | + landmarkName = "-receiveLoginMessage:" | ||
19 | + landmarkType = "5"> | ||
20 | + </BreakpointContent> | ||
21 | + </BreakpointProxy> | ||
22 | + <BreakpointProxy | ||
23 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
24 | + <BreakpointContent | ||
25 | + shouldBeEnabled = "Yes" | ||
26 | + ignoreCount = "0" | ||
27 | + continueAfterRunningActions = "No" | ||
28 | + filePath = "../PoolSdk/PoolSdk/SDKInterface.m" | ||
29 | + timestampString = "471440051.171901" | ||
30 | + startingColumnNumber = "9223372036854775807" | ||
31 | + endingColumnNumber = "9223372036854775807" | ||
32 | + startingLineNumber = "43" | ||
33 | + endingLineNumber = "43" | ||
34 | + landmarkName = "-SDKloginSDK" | ||
35 | + landmarkType = "5"> | ||
36 | + </BreakpointContent> | ||
37 | + </BreakpointProxy> | ||
38 | + </Breakpoints> | ||
39 | +</Bucket> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<Scheme | ||
3 | + LastUpgradeVersion = "0640" | ||
4 | + version = "1.3"> | ||
5 | + <BuildAction | ||
6 | + parallelizeBuildables = "YES" | ||
7 | + buildImplicitDependencies = "YES"> | ||
8 | + <BuildActionEntries> | ||
9 | + <BuildActionEntry | ||
10 | + buildForTesting = "YES" | ||
11 | + buildForRunning = "YES" | ||
12 | + buildForProfiling = "YES" | ||
13 | + buildForArchiving = "YES" | ||
14 | + buildForAnalyzing = "YES"> | ||
15 | + <BuildableReference | ||
16 | + BuildableIdentifier = "primary" | ||
17 | + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D" | ||
18 | + BuildableName = "Demo.app" | ||
19 | + BlueprintName = "Demo" | ||
20 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
21 | + </BuildableReference> | ||
22 | + </BuildActionEntry> | ||
23 | + <BuildActionEntry | ||
24 | + buildForTesting = "YES" | ||
25 | + buildForRunning = "YES" | ||
26 | + buildForProfiling = "NO" | ||
27 | + buildForArchiving = "NO" | ||
28 | + buildForAnalyzing = "YES"> | ||
29 | + <BuildableReference | ||
30 | + BuildableIdentifier = "primary" | ||
31 | + BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D" | ||
32 | + BuildableName = "DemoTests.xctest" | ||
33 | + BlueprintName = "DemoTests" | ||
34 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
35 | + </BuildableReference> | ||
36 | + </BuildActionEntry> | ||
37 | + </BuildActionEntries> | ||
38 | + </BuildAction> | ||
39 | + <TestAction | ||
40 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
41 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
42 | + shouldUseLaunchSchemeArgsEnv = "YES" | ||
43 | + buildConfiguration = "Debug"> | ||
44 | + <Testables> | ||
45 | + <TestableReference | ||
46 | + skipped = "NO"> | ||
47 | + <BuildableReference | ||
48 | + BuildableIdentifier = "primary" | ||
49 | + BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D" | ||
50 | + BuildableName = "DemoTests.xctest" | ||
51 | + BlueprintName = "DemoTests" | ||
52 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
53 | + </BuildableReference> | ||
54 | + </TestableReference> | ||
55 | + </Testables> | ||
56 | + <MacroExpansion> | ||
57 | + <BuildableReference | ||
58 | + BuildableIdentifier = "primary" | ||
59 | + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D" | ||
60 | + BuildableName = "Demo.app" | ||
61 | + BlueprintName = "Demo" | ||
62 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
63 | + </BuildableReference> | ||
64 | + </MacroExpansion> | ||
65 | + </TestAction> | ||
66 | + <LaunchAction | ||
67 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
68 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
69 | + launchStyle = "0" | ||
70 | + useCustomWorkingDirectory = "NO" | ||
71 | + buildConfiguration = "Debug" | ||
72 | + ignoresPersistentStateOnLaunch = "NO" | ||
73 | + debugDocumentVersioning = "YES" | ||
74 | + allowLocationSimulation = "YES"> | ||
75 | + <BuildableProductRunnable | ||
76 | + runnableDebuggingMode = "0"> | ||
77 | + <BuildableReference | ||
78 | + BuildableIdentifier = "primary" | ||
79 | + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D" | ||
80 | + BuildableName = "Demo.app" | ||
81 | + BlueprintName = "Demo" | ||
82 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
83 | + </BuildableReference> | ||
84 | + </BuildableProductRunnable> | ||
85 | + <AdditionalOptions> | ||
86 | + </AdditionalOptions> | ||
87 | + </LaunchAction> | ||
88 | + <ProfileAction | ||
89 | + shouldUseLaunchSchemeArgsEnv = "YES" | ||
90 | + savedToolIdentifier = "" | ||
91 | + useCustomWorkingDirectory = "NO" | ||
92 | + buildConfiguration = "Release" | ||
93 | + debugDocumentVersioning = "YES"> | ||
94 | + <BuildableProductRunnable | ||
95 | + runnableDebuggingMode = "0"> | ||
96 | + <BuildableReference | ||
97 | + BuildableIdentifier = "primary" | ||
98 | + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D" | ||
99 | + BuildableName = "Demo.app" | ||
100 | + BlueprintName = "Demo" | ||
101 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
102 | + </BuildableReference> | ||
103 | + </BuildableProductRunnable> | ||
104 | + </ProfileAction> | ||
105 | + <AnalyzeAction | ||
106 | + buildConfiguration = "Debug"> | ||
107 | + </AnalyzeAction> | ||
108 | + <ArchiveAction | ||
109 | + buildConfiguration = "Release" | ||
110 | + revealArchiveInOrganizer = "YES"> | ||
111 | + </ArchiveAction> | ||
112 | +</Scheme> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | +<plist version="1.0"> | ||
4 | +<dict> | ||
5 | + <key>SchemeUserState</key> | ||
6 | + <dict> | ||
7 | + <key>Demo.xcscheme</key> | ||
8 | + <dict> | ||
9 | + <key>orderHint</key> | ||
10 | + <integer>0</integer> | ||
11 | + </dict> | ||
12 | + </dict> | ||
13 | + <key>SuppressBuildableAutocreation</key> | ||
14 | + <dict> | ||
15 | + <key>BB5F3C871C1811BC00DA339D</key> | ||
16 | + <dict> | ||
17 | + <key>primary</key> | ||
18 | + <true/> | ||
19 | + </dict> | ||
20 | + <key>BB5F3CA01C1811BC00DA339D</key> | ||
21 | + <dict> | ||
22 | + <key>primary</key> | ||
23 | + <true/> | ||
24 | + </dict> | ||
25 | + </dict> | ||
26 | +</dict> | ||
27 | +</plist> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<Bucket | ||
3 | + type = "1" | ||
4 | + version = "2.0"> | ||
5 | + <Breakpoints> | ||
6 | + <BreakpointProxy | ||
7 | + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
8 | + <BreakpointContent | ||
9 | + shouldBeEnabled = "No" | ||
10 | + ignoreCount = "0" | ||
11 | + continueAfterRunningActions = "No" | ||
12 | + filePath = "Demo/SDKInterface.h" | ||
13 | + timestampString = "474775745.083759" | ||
14 | + startingColumnNumber = "9223372036854775807" | ||
15 | + endingColumnNumber = "9223372036854775807" | ||
16 | + startingLineNumber = "9" | ||
17 | + endingLineNumber = "9" | ||
18 | + landmarkName = "@interface SDKInterface" | ||
19 | + landmarkType = "2"> | ||
20 | + </BreakpointContent> | ||
21 | + </BreakpointProxy> | ||
22 | + </Breakpoints> | ||
23 | +</Bucket> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<Scheme | ||
3 | + LastUpgradeVersion = "0700" | ||
4 | + version = "1.3"> | ||
5 | + <BuildAction | ||
6 | + parallelizeBuildables = "YES" | ||
7 | + buildImplicitDependencies = "YES"> | ||
8 | + <BuildActionEntries> | ||
9 | + <BuildActionEntry | ||
10 | + buildForTesting = "YES" | ||
11 | + buildForRunning = "YES" | ||
12 | + buildForProfiling = "YES" | ||
13 | + buildForArchiving = "YES" | ||
14 | + buildForAnalyzing = "YES"> | ||
15 | + <BuildableReference | ||
16 | + BuildableIdentifier = "primary" | ||
17 | + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D" | ||
18 | + BuildableName = "Demo.app" | ||
19 | + BlueprintName = "Demo" | ||
20 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
21 | + </BuildableReference> | ||
22 | + </BuildActionEntry> | ||
23 | + </BuildActionEntries> | ||
24 | + </BuildAction> | ||
25 | + <TestAction | ||
26 | + buildConfiguration = "Debug" | ||
27 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
28 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
29 | + shouldUseLaunchSchemeArgsEnv = "YES"> | ||
30 | + <Testables> | ||
31 | + <TestableReference | ||
32 | + skipped = "NO"> | ||
33 | + <BuildableReference | ||
34 | + BuildableIdentifier = "primary" | ||
35 | + BlueprintIdentifier = "BB5F3CA01C1811BC00DA339D" | ||
36 | + BuildableName = "DemoTests.xctest" | ||
37 | + BlueprintName = "DemoTests" | ||
38 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
39 | + </BuildableReference> | ||
40 | + </TestableReference> | ||
41 | + </Testables> | ||
42 | + <MacroExpansion> | ||
43 | + <BuildableReference | ||
44 | + BuildableIdentifier = "primary" | ||
45 | + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D" | ||
46 | + BuildableName = "Demo.app" | ||
47 | + BlueprintName = "Demo" | ||
48 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
49 | + </BuildableReference> | ||
50 | + </MacroExpansion> | ||
51 | + <AdditionalOptions> | ||
52 | + </AdditionalOptions> | ||
53 | + </TestAction> | ||
54 | + <LaunchAction | ||
55 | + buildConfiguration = "Debug" | ||
56 | + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
57 | + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
58 | + launchStyle = "0" | ||
59 | + useCustomWorkingDirectory = "NO" | ||
60 | + ignoresPersistentStateOnLaunch = "NO" | ||
61 | + debugDocumentVersioning = "YES" | ||
62 | + debugServiceExtension = "internal" | ||
63 | + allowLocationSimulation = "YES"> | ||
64 | + <BuildableProductRunnable | ||
65 | + runnableDebuggingMode = "0"> | ||
66 | + <BuildableReference | ||
67 | + BuildableIdentifier = "primary" | ||
68 | + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D" | ||
69 | + BuildableName = "Demo.app" | ||
70 | + BlueprintName = "Demo" | ||
71 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
72 | + </BuildableReference> | ||
73 | + </BuildableProductRunnable> | ||
74 | + <AdditionalOptions> | ||
75 | + </AdditionalOptions> | ||
76 | + </LaunchAction> | ||
77 | + <ProfileAction | ||
78 | + buildConfiguration = "Release" | ||
79 | + shouldUseLaunchSchemeArgsEnv = "YES" | ||
80 | + savedToolIdentifier = "" | ||
81 | + useCustomWorkingDirectory = "NO" | ||
82 | + debugDocumentVersioning = "YES"> | ||
83 | + <BuildableProductRunnable | ||
84 | + runnableDebuggingMode = "0"> | ||
85 | + <BuildableReference | ||
86 | + BuildableIdentifier = "primary" | ||
87 | + BlueprintIdentifier = "BB5F3C871C1811BC00DA339D" | ||
88 | + BuildableName = "Demo.app" | ||
89 | + BlueprintName = "Demo" | ||
90 | + ReferencedContainer = "container:Demo.xcodeproj"> | ||
91 | + </BuildableReference> | ||
92 | + </BuildableProductRunnable> | ||
93 | + </ProfileAction> | ||
94 | + <AnalyzeAction | ||
95 | + buildConfiguration = "Debug"> | ||
96 | + </AnalyzeAction> | ||
97 | + <ArchiveAction | ||
98 | + buildConfiguration = "Release" | ||
99 | + revealArchiveInOrganizer = "YES"> | ||
100 | + </ArchiveAction> | ||
101 | +</Scheme> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | +<plist version="1.0"> | ||
4 | +<dict> | ||
5 | + <key>SchemeUserState</key> | ||
6 | + <dict> | ||
7 | + <key>Demo.xcscheme</key> | ||
8 | + <dict> | ||
9 | + <key>orderHint</key> | ||
10 | + <integer>0</integer> | ||
11 | + </dict> | ||
12 | + </dict> | ||
13 | + <key>SuppressBuildableAutocreation</key> | ||
14 | + <dict> | ||
15 | + <key>BB5F3C871C1811BC00DA339D</key> | ||
16 | + <dict> | ||
17 | + <key>primary</key> | ||
18 | + <true/> | ||
19 | + </dict> | ||
20 | + <key>BB5F3CA01C1811BC00DA339D</key> | ||
21 | + <dict> | ||
22 | + <key>primary</key> | ||
23 | + <true/> | ||
24 | + </dict> | ||
25 | + </dict> | ||
26 | +</dict> | ||
27 | +</plist> |
1 | +// | ||
2 | +// AppDelegate.h | ||
3 | +// publiDemo | ||
4 | +// | ||
5 | +// Created by winFan on 11/30/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <UIKit/UIKit.h> | ||
10 | + | ||
11 | +@interface AppDelegate : UIResponder <UIApplicationDelegate> | ||
12 | + | ||
13 | +@property (strong, nonatomic) UIWindow *window; | ||
14 | + | ||
15 | + | ||
16 | +@end | ||
17 | + |
1 | +// | ||
2 | +// AppDelegate.m | ||
3 | +// publiDemo | ||
4 | +// | ||
5 | +// Created by winFan on 11/30/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import "AppDelegate.h" | ||
10 | +#import "ViewController.h" | ||
11 | +#import "PoolSdk.h" | ||
12 | +@interface AppDelegate () | ||
13 | + | ||
14 | +@end | ||
15 | + | ||
16 | +@implementation AppDelegate | ||
17 | + | ||
18 | + | ||
19 | +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | ||
20 | + // Override point for customization after application launch. | ||
21 | + return YES; | ||
22 | +} | ||
23 | + | ||
24 | +- (void)applicationWillResignActive:(UIApplication *)application { | ||
25 | + // 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. | ||
26 | + // 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. | ||
27 | +} | ||
28 | + | ||
29 | +- (void)applicationDidEnterBackground:(UIApplication *)application { | ||
30 | + // 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. | ||
31 | + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | ||
32 | +} | ||
33 | + | ||
34 | +- (void)applicationWillEnterForeground:(UIApplication *)application { | ||
35 | + // 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. | ||
36 | +} | ||
37 | + | ||
38 | +- (void)applicationDidBecomeActive:(UIApplication *)application { | ||
39 | + // 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. | ||
40 | +} | ||
41 | + | ||
42 | +- (void)applicationWillTerminate:(UIApplication *)application { | ||
43 | + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | ||
44 | +} | ||
45 | + | ||
46 | +- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{ | ||
47 | + NSLog(@"hanldeOpenURL%@",url.path ); | ||
48 | + [[PoolSdk shareSDK] handleOpenurl:url]; | ||
49 | + return true; | ||
50 | +} | ||
51 | + | ||
52 | + | ||
53 | +@end |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | +<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"> | ||
3 | + <dependencies> | ||
4 | + <deployment identifier="iOS"/> | ||
5 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/> | ||
6 | + <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> | ||
7 | + </dependencies> | ||
8 | + <objects> | ||
9 | + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
10 | + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
11 | + <view contentMode="scaleToFill" id="iN0-l3-epB"> | ||
12 | + <rect key="frame" x="0.0" y="0.0" width="480" height="480"/> | ||
13 | + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
14 | + <subviews> | ||
15 | + <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"> | ||
16 | + <rect key="frame" x="20" y="439" width="441" height="21"/> | ||
17 | + <fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
18 | + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
19 | + <nil key="highlightedColor"/> | ||
20 | + </label> | ||
21 | + <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"> | ||
22 | + <rect key="frame" x="20" y="140" width="441" height="43"/> | ||
23 | + <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> | ||
24 | + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
25 | + <nil key="highlightedColor"/> | ||
26 | + </label> | ||
27 | + </subviews> | ||
28 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||
29 | + <constraints> | ||
30 | + <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> | ||
31 | + <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> | ||
32 | + <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/> | ||
33 | + <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/> | ||
34 | + <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/> | ||
35 | + <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> | ||
36 | + </constraints> | ||
37 | + <nil key="simulatedStatusBarMetrics"/> | ||
38 | + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
39 | + <point key="canvasLocation" x="548" y="455"/> | ||
40 | + </view> | ||
41 | + </objects> | ||
42 | +</document> |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | +<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"> | ||
3 | + <dependencies> | ||
4 | + <deployment identifier="iOS"/> | ||
5 | + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/> | ||
6 | + </dependencies> | ||
7 | + <scenes> | ||
8 | + <!--Main View Controller--> | ||
9 | + <scene sceneID="ufC-wZ-h7g"> | ||
10 | + <objects> | ||
11 | + <viewController id="vXZ-lx-hvc" customClass="MainViewController" sceneMemberID="viewController"> | ||
12 | + <layoutGuides> | ||
13 | + <viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/> | ||
14 | + <viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/> | ||
15 | + </layoutGuides> | ||
16 | + <view key="view" contentMode="scaleToFill" id="kh9-bI-dsS"> | ||
17 | + <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
18 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
19 | + <subviews> | ||
20 | + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GQW-et-jRb"> | ||
21 | + <rect key="frame" x="196" y="71" width="208" height="30"/> | ||
22 | + <state key="normal" title="初始化"/> | ||
23 | + <connections> | ||
24 | + <action selector="actionInit:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Srh-bu-gYD"/> | ||
25 | + </connections> | ||
26 | + </button> | ||
27 | + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s0O-FE-ge8"> | ||
28 | + <rect key="frame" x="213" y="123" width="175" height="30"/> | ||
29 | + <state key="normal" title="登录"/> | ||
30 | + <connections> | ||
31 | + <action selector="actionLogin:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="381-gB-ImA"/> | ||
32 | + </connections> | ||
33 | + </button> | ||
34 | + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JQY-uO-q36"> | ||
35 | + <rect key="frame" x="205" y="168" width="191" height="30"/> | ||
36 | + <state key="normal" title="充值"/> | ||
37 | + <connections> | ||
38 | + <action selector="actionPay:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="bvf-M4-rqy"/> | ||
39 | + </connections> | ||
40 | + </button> | ||
41 | + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5na-1c-IlO"> | ||
42 | + <rect key="frame" x="250" y="218" width="100" height="30"/> | ||
43 | + <state key="normal" title="数据"/> | ||
44 | + <connections> | ||
45 | + <action selector="actionSubmitRoleData:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="aNf-Iw-unv"/> | ||
46 | + </connections> | ||
47 | + </button> | ||
48 | + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Q9b-py-Nk0"> | ||
49 | + <rect key="frame" x="233" y="268" width="134" height="30"/> | ||
50 | + <state key="normal" title="注销"/> | ||
51 | + <connections> | ||
52 | + <action selector="actionLogout:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="t6e-7P-tJU"/> | ||
53 | + </connections> | ||
54 | + </button> | ||
55 | + </subviews> | ||
56 | + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
57 | + </view> | ||
58 | + </viewController> | ||
59 | + <placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/> | ||
60 | + </objects> | ||
61 | + <point key="canvasLocation" x="445" y="282"/> | ||
62 | + </scene> | ||
63 | + </scenes> | ||
64 | +</document> |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | +<plist version="1.0"> | ||
4 | +<dict> | ||
5 | + <key>CFBundleDevelopmentRegion</key> | ||
6 | + <string>en</string> | ||
7 | + <key>CFBundleExecutable</key> | ||
8 | + <string>$(EXECUTABLE_NAME)</string> | ||
9 | + <key>CFBundleIdentifier</key> | ||
10 | + <string>com.mango.ios.fytx</string> | ||
11 | + <key>CFBundleInfoDictionaryVersion</key> | ||
12 | + <string>6.0</string> | ||
13 | + <key>CFBundleName</key> | ||
14 | + <string>$(PRODUCT_NAME)</string> | ||
15 | + <key>CFBundlePackageType</key> | ||
16 | + <string>APPL</string> | ||
17 | + <key>CFBundleShortVersionString</key> | ||
18 | + <string>1.0</string> | ||
19 | + <key>CFBundleSignature</key> | ||
20 | + <string>????</string> | ||
21 | + <key>CFBundleVersion</key> | ||
22 | + <string>1</string> | ||
23 | + <key>LSRequiresIPhoneOS</key> | ||
24 | + <true/> | ||
25 | + <key>UILaunchStoryboardName</key> | ||
26 | + <string>LaunchScreen</string> | ||
27 | + <key>UIMainStoryboardFile</key> | ||
28 | + <string>Main</string> | ||
29 | + <key>UIRequiredDeviceCapabilities</key> | ||
30 | + <array> | ||
31 | + <string>armv7</string> | ||
32 | + </array> | ||
33 | + <key>UISupportedInterfaceOrientations</key> | ||
34 | + <array> | ||
35 | + <string>UIInterfaceOrientationPortrait</string> | ||
36 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
37 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
38 | + </array> | ||
39 | +</dict> | ||
40 | +</plist> |
1 | +// | ||
2 | +// MainViewController.m | ||
3 | +// Demo_qiyu | ||
4 | +// | ||
5 | +// Created by 许 on 17/6/7. | ||
6 | +// Copyright © 2017年 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import "MainViewController.h" | ||
10 | +#import "PoolSdk.h" | ||
11 | + | ||
12 | +@interface MainViewController () | ||
13 | + | ||
14 | +@end | ||
15 | + | ||
16 | +@implementation MainViewController | ||
17 | + | ||
18 | +- (void)viewDidLoad { | ||
19 | + [super viewDidLoad]; | ||
20 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:poolSDK_Notification object:nil]; | ||
21 | + // Do any additional setup after loading the view. | ||
22 | +} | ||
23 | + | ||
24 | +- (void)didReceiveMemoryWarning { | ||
25 | + [super didReceiveMemoryWarning]; | ||
26 | + // Dispose of any resources that can be recreated. | ||
27 | +} | ||
28 | + | ||
29 | +/* | ||
30 | +#pragma mark - Navigation | ||
31 | + | ||
32 | +// In a storyboard-based application, you will often want to do a little preparation before navigation | ||
33 | +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
34 | + // Get the new view controller using [segue destinationViewController]. | ||
35 | + // Pass the selected object to the new view controller. | ||
36 | +} | ||
37 | +*/ | ||
38 | + | ||
39 | +-(void)viewDidAppear:(BOOL)animated{ | ||
40 | + [super viewDidAppear:animated]; | ||
41 | + //[[PoolSdk shareSDK] viewDidAppear]; | ||
42 | +} | ||
43 | + | ||
44 | + | ||
45 | +- (void)receiveSDKMessage:(NSNotification *)notification | ||
46 | +{ | ||
47 | + PoolSDKResult *result = [notification object]; | ||
48 | + if (result) { | ||
49 | + NSLog(@"notiType:%d",result.notiType); | ||
50 | + switch (result.notiType) { | ||
51 | + | ||
52 | + case PoolSDKNotificationInitSDK: | ||
53 | + { | ||
54 | + NSLog(@"sdk初始化成功"); | ||
55 | + } | ||
56 | + | ||
57 | + break; | ||
58 | + case PoolSDKNotificationLogin: | ||
59 | + { | ||
60 | + NSLog(@"result state:%d",result.statusCode); | ||
61 | + if (result.statusCode == POOLSDK_NO_ERROR) { | ||
62 | + PoolLoginInfo *loginInfo = (PoolLoginInfo*)result.extendData; | ||
63 | + NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]); | ||
64 | + NSLog(@"收到登陆信息public token:%@", [loginInfo sign]); | ||
65 | + NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]); | ||
66 | + NSLog(@"userType:%@",[loginInfo userType]); | ||
67 | + }else{ | ||
68 | + NSLog(@"%@",[result description]); | ||
69 | + } | ||
70 | + } | ||
71 | + break; | ||
72 | + case PoolSDKNotificationLogout: | ||
73 | + { | ||
74 | + NSLog(@"sdk注销成功,游戏处理"); | ||
75 | + } | ||
76 | + break; | ||
77 | + default: | ||
78 | + break; | ||
79 | + } | ||
80 | + } | ||
81 | +} | ||
82 | + | ||
83 | +- (IBAction)actionInit:(id)sender { | ||
84 | + [[PoolSdk shareSDK]initSDK:self]; | ||
85 | +} | ||
86 | +- (IBAction)actionLogin:(id)sender { | ||
87 | + [[PoolSdk shareSDK] loginSDK]; | ||
88 | +} | ||
89 | + | ||
90 | +- (IBAction)actionPay:(id)sender { | ||
91 | + PoolCreateOrderInfo *payInfo = [[PoolCreateOrderInfo alloc]init]; | ||
92 | + [payInfo setServerId:@"111"]; | ||
93 | + [payInfo setPlayerName:@"roleName"]; | ||
94 | + [payInfo setPlayerLevel:@"10"]; | ||
95 | + [payInfo setPostAmount:@"6"]; | ||
96 | + [payInfo setProductId:@"com.fytx.6"]; | ||
97 | + [payInfo setPlayerId:@"1231241234"]; | ||
98 | + [payInfo setTimestamp:@"1232134"]; | ||
99 | + [payInfo setExchange:@"10"]; | ||
100 | + [payInfo setCustom:@"custom"]; | ||
101 | + NSLog(@"start pay"); | ||
102 | + [[PoolSdk shareSDK] payWithPaymentInfo:payInfo]; | ||
103 | +} | ||
104 | + | ||
105 | + | ||
106 | +/** | ||
107 | + serverid | ||
108 | + servername | ||
109 | + roleid | ||
110 | + rolename | ||
111 | + rolelevel | ||
112 | +*/ | ||
113 | +- (IBAction)actionSubmitRoleData:(id)sender { | ||
114 | + NSLog(@"数据接口"); | ||
115 | + PoolReportInfo *reportInfo = [[PoolReportInfo alloc]init]; | ||
116 | + [reportInfo setReportType:REPORT_ENTER]; | ||
117 | + //[reportInfo setReportType:REPORT_CREATEROLE]; | ||
118 | + //[reportInfo setReportType:REPORT_ROLEUPGRADE] | ||
119 | + [reportInfo setServerId:@"9133"]; | ||
120 | + [reportInfo setServerName:@"serverName"]; | ||
121 | + [reportInfo setPlayerId:@"123456"]; | ||
122 | + [reportInfo setPlayerName:@"playName"]; | ||
123 | + [reportInfo setPlayerLevel:@"100"]; | ||
124 | + [[PoolSdk shareSDK] reportSDK:reportInfo]; | ||
125 | +} | ||
126 | + | ||
127 | +- (IBAction)actionLogout:(id)sender { | ||
128 | + NSLog(@"注销"); | ||
129 | + [[PoolSdk shareSDK] logoutSDK]; | ||
130 | +} | ||
131 | + | ||
132 | + | ||
133 | +@end |
1 | +// | ||
2 | +// PGLogger.h | ||
3 | +// PanguCommonLib | ||
4 | +// | ||
5 | +// Created by ouyanghua on 14-2-22. | ||
6 | +// Copyright (c) 2014年 pangu. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | + | ||
11 | +void DGLog(NSString *fmt, ...); | ||
12 | + | ||
13 | +typedef NS_ENUM(NSInteger, DGLoggerLevel) | ||
14 | +{ | ||
15 | + ELogVerbose = 1, | ||
16 | + ELogDebug, | ||
17 | + ELogInfo, | ||
18 | + ELogWarn, | ||
19 | + ELogError | ||
20 | +}; | ||
21 | + | ||
22 | +@interface DGLogger : NSObject | ||
23 | + | ||
24 | ++ (void)showLog:(NSString *)fmt,...; | ||
25 | + | ||
26 | ++ (void)showLog:(DGLoggerLevel)level log:(NSString *)fmt,...; | ||
27 | + | ||
28 | ++ (void)isShowLog:(BOOL)flag; | ||
29 | + | ||
30 | +@end |
1 | +// | ||
2 | +// Interface.h | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 12/10/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | + | ||
10 | +#include "UnionInterface.h" | ||
11 | +#import <SafariServices/SafariServices.h> | ||
12 | +@interface Interface : NSObject <UnionInterface,SFSafariViewControllerDelegate> | ||
13 | +@property(nonatomic, strong)UIViewController *controller; | ||
14 | + | ||
15 | + | ||
16 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// NetCenter.h | ||
3 | +// public_i9133 | ||
4 | +// | ||
5 | +// Created by winFan on 12/2/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | + | ||
11 | +@interface NetCenter : NSObject | ||
12 | + | ||
13 | +@property(nonatomic,retain) NSMutableData *receiveData; | ||
14 | + | ||
15 | +@property(nonatomic,assign)int dataPackSerialNo; | ||
16 | + | ||
17 | + | ||
18 | ++ (NetCenter *)getInstance; | ||
19 | + | ||
20 | +- (NSString *)httpGetSyn:(NSString *) getUrl; | ||
21 | + | ||
22 | +- (NSString *)httpPostSyn:(NSString *) postUrl : (NSDictionary *) postData; | ||
23 | + | ||
24 | +- (void)httpGetNoSyn; | ||
25 | + | ||
26 | +- (void)httpPostNoSyn:(NSString *) postUrl :(NSDictionary *)postDict; | ||
27 | + | ||
28 | +- (void)httpPostAsync:(NSString*)postUrl :(NSDictionary*)postDict; | ||
29 | + | ||
30 | +- (void)httpPostAsyncOpen:(NSString*)postUrl :(NSDictionary*)postDict; | ||
31 | + | ||
32 | +- (NSString *)dicToString:(NSDictionary *) dict; | ||
33 | +@end |
1 | +// | ||
2 | +// OtherSetting.h | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 11/23/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#ifndef __PoolSdk__OtherSetting__ | ||
10 | +#define __PoolSdk__OtherSetting__ | ||
11 | + | ||
12 | + | ||
13 | +/** | ||
14 | + 应用支持的方向 | ||
15 | + */ | ||
16 | +typedef NS_ENUM(NSUInteger, ESDKOrientation) { | ||
17 | + ESDKOrientationPortrait = 1,//竖 | ||
18 | + ESDKOrientationLandscape,//横 | ||
19 | + ESDKOrientationNone//自动旋转 | ||
20 | +}; | ||
21 | + | ||
22 | +/** | ||
23 | + 应用支持的方向 | ||
24 | + */ | ||
25 | +typedef NS_ENUM(NSUInteger, REPORT_TYPE) { | ||
26 | + REPORT_TYPE_OPEN = 1,//竖 | ||
27 | + REPORT_TYPE_ENTER,//横 | ||
28 | + REPORT_TYPE_DEFINE//自动旋转 | ||
29 | +}; | ||
30 | + | ||
31 | +#endif /* defined(__PoolSdk__OtherSetting__) */ |
1 | +// | ||
2 | +// PoolBaseModel.h | ||
3 | +// public_i9133 | ||
4 | +// | ||
5 | +// Created by winFan on 12/2/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | + | ||
10 | +#import <Foundation/Foundation.h> | ||
11 | +#import "OtherSetting.h" | ||
12 | +@interface PoolBaseModel : NSObject | ||
13 | + | ||
14 | +- (NSString *)objectToJsonString; | ||
15 | +- (NSMutableString *)paramAddToString; | ||
16 | +- (id)initWithDiction:(NSDictionary *)diction; | ||
17 | + | ||
18 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// PoolLoginChecker.h | ||
3 | +// public_i9133 | ||
4 | +// | ||
5 | +// Created by winFan on 12/1/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | +#import <Foundation/Foundation.h> | ||
9 | +#import "PoolSdk/PoolLoginInfo.h" | ||
10 | +#import "PoolSdk/PoolNotification.h" | ||
11 | +#import "PoolSdk/PoolCreateOrderInfo.h" | ||
12 | +#import "PoolSdk/PoolPayInfo.h" | ||
13 | +#import "PoolReportInfo.h" | ||
14 | +#import "PoolSdkDelegate.h" | ||
15 | + | ||
16 | +@interface PoolChecker : NSObject<PoolSdkDelegate> | ||
17 | +@property(nonatomic, strong)NSString *userId; | ||
18 | +@property(nonatomic, strong)id<PoolSdkDelegate> mPoolSdkDelegate; | ||
19 | + | ||
20 | +@property bool onlyOneTimePay; | ||
21 | ++ (PoolChecker *)getInstance; | ||
22 | +- (void)initChecker; | ||
23 | +- (void)startCheck:(PoolLoginInfo *)loginInfo; | ||
24 | +- (void) createOrder:(PoolCreateOrderInfo *)payInfo; | ||
25 | +- (void) reportOpen; | ||
26 | +- (void) reportSDKOpen; | ||
27 | +- (void)handleFirstOpenApp:(NSString*) path; | ||
28 | +- (void) reportEnter:(PoolReportInfo *)reInfo; | ||
29 | +- (void) report:(NSString *)_action :(PoolReportInfo *)reInfo; | ||
30 | +- (void)sendNotice:(PoolSDKNotificationType)notiType | ||
31 | + notiName:(NSString *)notiName | ||
32 | + statusCode:(int)nCode | ||
33 | + description:(NSString *)szDescripton | ||
34 | + extendData:(NSObject *)extendData; | ||
35 | + | ||
36 | +- (void)startCheckDelegate:(PoolLoginInfo *)loginInfo; | ||
37 | +- (void)setPoolSdkDelegate:(nullable id<PoolSdkDelegate>)poolSdkDeletate; | ||
38 | +@end | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + |
1 | +// | ||
2 | +// PoolConfig.h | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 12/11/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | + | ||
11 | +@interface PoolConfig : NSObject | ||
12 | + | ||
13 | +@property(nonatomic, strong)NSString *gameSimpleName; | ||
14 | +@property(nonatomic, strong)NSString *sdkSimpleName; | ||
15 | +@property(nonatomic, strong)NSString *sdkVersionCode; | ||
16 | +@property(nonatomic, strong)NSString *loginCheckUrl; | ||
17 | +@property(nonatomic, strong)NSString *payOrderUrl; | ||
18 | +@property(nonatomic, strong)NSString *payCheckUrl; | ||
19 | +@property(nonatomic, strong)NSString *c1; | ||
20 | +@property(nonatomic, strong)NSString *c2; | ||
21 | +@property(nonatomic, strong)NSString *custom; | ||
22 | + | ||
23 | ++ (PoolConfig *)getInstance; | ||
24 | + | ||
25 | +- (void) loadFile:(NSString *) fileName; | ||
26 | + | ||
27 | +- (NSString *)getValueByKey:(NSString *) key; | ||
28 | + | ||
29 | +- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2; | ||
30 | + | ||
31 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// PayInfo.h | ||
3 | +// public_i9133 | ||
4 | +// | ||
5 | +// Created by winFan on 12/3/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | + | ||
10 | +#import "PoolSdk/PoolBaseModel.h" | ||
11 | +@interface PoolCreateOrderInfo : PoolBaseModel | ||
12 | + | ||
13 | +@property(nonatomic,strong)NSString *serverId;//服务器ID | ||
14 | +@property(nonatomic, strong)NSString *serverName;//角色名称 | ||
15 | +@property(nonatomic, strong)NSString *playerId;//玩家ID | ||
16 | +@property(nonatomic, strong)NSString *playerName;//玩家名称 | ||
17 | +@property(nonatomic, strong)NSString *playerLevel;//玩家等级 | ||
18 | +@property(nonatomic, strong)NSString *postAmount;//金额 | ||
19 | +@property(nonatomic, strong)NSString *productId;//产品ID | ||
20 | +@property(nonatomic, strong)NSString *productName;//产品名称 | ||
21 | +@property(nonatomic, strong)NSString *productDesc;//产品描述 | ||
22 | +@property(nonatomic, strong)NSString *custom;//透传参数 | ||
23 | +@property(nonatomic, strong)NSString *exchange;//兑换比例 | ||
24 | +@property(nonatomic, strong)NSString *otherInfo;//扩展参数 | ||
25 | +@property(nonatomic, strong)NSString *userId;//用户ID | ||
26 | +@property(nonatomic, strong)NSString *timestamp;//时间戳 | ||
27 | + | ||
28 | +- (NSString *) getTsign ; | ||
29 | +- (NSString *) getTimestamp ; | ||
30 | + | ||
31 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// PoolLoginInfo.h | ||
3 | +// public_i9133 | ||
4 | +// | ||
5 | +// Created by winFan on 12/1/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import "PoolSdk/PoolBaseModel.h" | ||
10 | +@interface PoolLoginInfo : PoolBaseModel | ||
11 | + | ||
12 | +@property(nonatomic,strong)NSString *timestamp; | ||
13 | +@property(nonatomic, strong)NSString *sign;//serverSign | ||
14 | +@property(nonatomic, strong)NSString *other;//透传 | ||
15 | +@property(nonatomic, strong)NSString *openId; | ||
16 | +@property(nonatomic, strong)NSString *userType; | ||
17 | + | ||
18 | + | ||
19 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// PoolNotification.h | ||
3 | +// public_i9133 | ||
4 | +// | ||
5 | +// Created by winFan on 12/1/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | + | ||
11 | +extern NSString * const poolSDK_Notification; /**< */ | ||
12 | +extern NSString * const _create_order_notification; /**< */ | ||
13 | + | ||
14 | + | ||
15 | +/** | ||
16 | + 应用支持的方向 | ||
17 | + */ | ||
18 | +typedef NS_ENUM(int, PoolSDKNotificationType) { | ||
19 | + PoolSDKNotificationLogin = 1,//登录 | ||
20 | + PoolSDKNotificationLogout,//注销 | ||
21 | + PoolSDKNotificationPay,//支付完成 | ||
22 | + PoolSDKNotificationPause,//暂停退出 | ||
23 | + PoolSDKNotificationRole,//创建角色 | ||
24 | + PoolSDKNotificationInitSDK//初始化SDK | ||
25 | +}; | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | +@interface PoolNotification : NSObject | ||
30 | + | ||
31 | +@end | ||
32 | + | ||
33 | + | ||
34 | +////////////////////////////////////////////////////////////////////// | ||
35 | +@interface PoolSDKResult : NSObject | ||
36 | +@property(nonatomic, assign)int statusCode;//请参照此文件下面状态标识 | ||
37 | +@property(nonatomic, strong)NSString *resultDescription; | ||
38 | +@property(nonatomic, strong)NSObject *extendData; | ||
39 | +//V1.2.0新增 | ||
40 | +@property(nonatomic, assign)PoolSDKNotificationType notiType;//消息类型 | ||
41 | +@property(nonatomic, strong)NSString *notiName;//消息名称 | ||
42 | +@end | ||
43 | +////////////////////////////////////////////////////////////////////// | ||
44 | + | ||
45 | +////////////////////////////////////////////////////////////////////// | ||
46 | +/* 状态标识 */ | ||
47 | +#define POOLSDK_NO_ERROR 0 /*操作成功*/ | ||
48 | + | ||
49 | +#define POOLSDK_ERROR_LOGIN_FAILED -100 /*登录失败*/ | ||
50 | +#define POOLSDK_ERROR_LOGIN_CANCEL -101 /*登录取消*/ | ||
51 | +#define POOLSDK_ERROR_LOGIN_GAMGEACCOUNT -102 /*游戏帐号登录,非平台账号*/ | ||
52 | + | ||
53 | +#define POOLSDK_ERROR_PAY_FAILED -200 /*支付失败*/ | ||
54 | +#define POOLSDK_ERROR_PAY_CANCEL -201 /*支付取消*/ | ||
55 | +#define POOLSDK_ERROR_PAY_VERSIGN -202 /*支付验签失败*/ | ||
56 | +#define POOLSDK_ERROR_CREATE_ORDER_FAILED -203 /*支付验签失败*/ | ||
57 | + | ||
58 | +#define POOLSDK_ERROR_ROLE_CREATE_FAILED -300 /*角色创建失败*/ | ||
59 | + | ||
60 | +#define POOLSDK_ERROR_INIT_FAILED -400 /*初始化失败*/ | ||
61 | + | ||
62 | +////////////////////////////////////////////////////////////////////// |
1 | +// | ||
2 | +// PoolPayInfo.h | ||
3 | +// public_i9133 | ||
4 | +// | ||
5 | +// Created by winFan on 12/3/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | + | ||
10 | +#import "PoolSdk/PoolBaseModel.h" | ||
11 | +@interface PoolPayInfo : PoolBaseModel | ||
12 | + | ||
13 | +@property(nonatomic, strong)NSString *serverId; | ||
14 | +@property(nonatomic, strong)NSString *queryId; | ||
15 | +@property(nonatomic, strong)NSString *playerId; | ||
16 | +@property(nonatomic, strong)NSString *playerName; | ||
17 | +@property(nonatomic, strong)NSString *postAmount; | ||
18 | +@property(nonatomic, strong)NSString *productId; | ||
19 | +@property(nonatomic, strong)NSString *products; | ||
20 | +@property(nonatomic, strong)NSString *custom; | ||
21 | +@property(nonatomic, strong)NSString *postTime; | ||
22 | +@property(nonatomic, strong)NSString *other; | ||
23 | +@property(nonatomic, strong)NSString *isOpenThirdPay;//是否开启第三方充值 | ||
24 | + | ||
25 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// PoolReportInfo.h | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 12/21/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import "PoolSdk/PoolBaseModel.h" | ||
10 | +@interface PoolReportInfo : PoolBaseModel | ||
11 | + | ||
12 | +@property(nonatomic, strong)NSString *serverId;//服务器ID | ||
13 | +@property(nonatomic, strong)NSString *serverName;//服务器名称 | ||
14 | +@property(nonatomic, strong)NSString *playerId;//玩家ID | ||
15 | +@property(nonatomic, strong)NSString *playerName;//玩家名称 | ||
16 | +@property(nonatomic, strong)NSString *playerLevel;//玩家等级 | ||
17 | +@property(nonatomic, strong)NSString *custom;//透传参数 | ||
18 | +@property(nonatomic, strong)NSString *reportType;//类型 | ||
19 | + | ||
20 | + | ||
21 | +@property(nonatomic, strong)NSString *openId; | ||
22 | + | ||
23 | +#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"// | ||
24 | +#define REPORT_OPEN @"open" | ||
25 | +#define REPORT_ENTER @"enter" | ||
26 | +#define REPORT_CREATEROLE @"createrole" | ||
27 | +#define REPORT_ROLEUPGRADE @"roleupgrade" | ||
28 | +#define REPORT_SDK_OPEN @"opensdk" | ||
29 | + | ||
30 | +@end |
1 | +// | ||
2 | +// PoolSdk.h | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 11/23/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | +#import <PoolSdk/PoolSdk2.h> | ||
11 | +#import <UIKit/UIKit.h> | ||
12 | +#import "TrackingIO.h" | ||
13 | + | ||
14 | +@interface PoolSdk : NSObject | ||
15 | +/** | ||
16 | + * 当前SDK的版本 | ||
17 | + */ | ||
18 | +@property(nonatomic, strong, readonly)NSString *sdkVersion; | ||
19 | + | ||
20 | +/** | ||
21 | + * 用于设置url types schemes 默认为工程名 | ||
22 | + */ | ||
23 | +@property(nonatomic, strong)NSString *urlSchemes; | ||
24 | + | ||
25 | +/** | ||
26 | + 获取SDK实例对象 | ||
27 | + */ | ||
28 | ++ (PoolSdk *)shareSDK; | ||
29 | + | ||
30 | +/** | ||
31 | + 初始化SDK | ||
32 | + */ | ||
33 | +- (void)initSDK:(UIViewController *) control; | ||
34 | + | ||
35 | + | ||
36 | +-(void)viewDidAppear; | ||
37 | + | ||
38 | +/** | ||
39 | + 登录SDK | ||
40 | + */ | ||
41 | +- (void)loginSDK; | ||
42 | + | ||
43 | +/** | ||
44 | + 进行支付 | ||
45 | + */ | ||
46 | +- (void)payWithPaymentInfo:(PoolCreateOrderInfo *)payInfo; | ||
47 | + | ||
48 | +/** | ||
49 | + 用户中心 | ||
50 | + */ | ||
51 | +- (void)gotoUserCenter; | ||
52 | + | ||
53 | +/** | ||
54 | + report | ||
55 | + */ | ||
56 | +- (void)reportSDK:(PoolReportInfo *)reportInfo; | ||
57 | + | ||
58 | +/** | ||
59 | + 注销 | ||
60 | + */ | ||
61 | +- (void)logoutSDK; | ||
62 | + | ||
63 | +/** | ||
64 | + 退出 | ||
65 | + */ | ||
66 | +- (void)exitSDK; | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | +/** | ||
71 | + 显示/隐藏浮标 | ||
72 | + */ | ||
73 | +//- (void)showFloatIcon:(BOOL)bFlag; | ||
74 | + | ||
75 | + | ||
76 | +/** | ||
77 | + // called in - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url | ||
78 | + */ | ||
79 | +- (void)handleOpenurl:(NSURL *)url; | ||
80 | + | ||
81 | +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window; | ||
82 | +/** | ||
83 | + 应用 appid | ||
84 | + */ | ||
85 | + | ||
86 | +/** | ||
87 | + 应用支持的方向 默认为 EDreamSDKOrientationLandscape | ||
88 | + */ | ||
89 | +@property(nonatomic, assign)ESDKOrientation sdkOrientation; | ||
90 | + | ||
91 | +/** | ||
92 | + 浮标是否已经显示,默认为NO | ||
93 | + */ | ||
94 | +@property(nonatomic, assign)BOOL bShowedFloat; | ||
95 | + | ||
96 | + | ||
97 | +/** | ||
98 | + serverId | ||
99 | + */ | ||
100 | +@property(nonatomic, assign)int serverId; | ||
101 | + | ||
102 | +/** | ||
103 | + 获取gamechannelid | ||
104 | + */ | ||
105 | +-(NSString *) getGameChannelId; | ||
106 | + | ||
107 | +/** | ||
108 | + 获取Custom | ||
109 | + */ | ||
110 | +- (NSString *) getCustomValue; | ||
111 | + | ||
112 | +/** | ||
113 | + 获取ChannelParameter1 | ||
114 | + */ | ||
115 | +- (NSString *) getChannelParameter1; | ||
116 | + | ||
117 | +/** | ||
118 | + 获取ChannelParameter2 | ||
119 | + */ | ||
120 | +- (NSString *) getChannelParameter2; | ||
121 | + | ||
122 | + | ||
123 | +@end |
1 | +// | ||
2 | +// PoolSdk.h | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by 许 on 16/1/15. | ||
6 | +// Copyright © 2016年 许. All rights reserved. | ||
7 | +// | ||
8 | +// In this header, you should import all the public headers of your framework using statements like #import <PoolSdk/PublicHeader.h> | ||
9 | + | ||
10 | +#import <UIKit/UIKit.h> | ||
11 | +#import "PoolChecker.h" | ||
12 | +#import "Interface.h" | ||
13 | +#import "PoolReportInfo.h" | ||
14 | +#import "PoolLoginInfo.h" | ||
15 | +#import "PoolNotification.h" | ||
16 | +#import "PoolPayInfo.h" | ||
17 | +#import "UnionInterface.h" | ||
18 | +#import "PoolCreateOrderInfo.h" | ||
19 | +#import "PoolConfig.h" | ||
20 | +#import "TrackingIO.h" | ||
21 | +#import "PoolUtils.h" | ||
22 | +#import "NetCenter.h" | ||
23 | +#import "PoolSdkDelegate.h" | ||
24 | + |
1 | +// | ||
2 | +// PoolSdkDelegate.h | ||
3 | +// PoolSdk_i9133 | ||
4 | +// | ||
5 | +// Created by 许 on 17/6/30. | ||
6 | +// Copyright © 2017年 许. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | + | ||
11 | +@protocol PoolSdkDelegate <NSObject> | ||
12 | +@optional | ||
13 | +-(void)PoolSdkLoginSuccess:(PoolLoginInfo*)loginInfo; | ||
14 | +-(void)PoolSdkLoginFail:(NSString*)msg; | ||
15 | +@end |
1 | +// | ||
2 | +// PoolUtils.h | ||
3 | +// public_i9133 | ||
4 | +// | ||
5 | +// Created by winFan on 12/3/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | + | ||
10 | +#import <Foundation/Foundation.h> | ||
11 | +@interface PoolUtils : NSObject | ||
12 | + | ||
13 | ++(NSString *)md5:(NSString *)str; | ||
14 | ++ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString; | ||
15 | ++(NSString *)createPayOrderUrl; | ||
16 | +//*充值回调地址 | ||
17 | ++(NSString *)createPayUrl; | ||
18 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// NewTtack.h | ||
3 | +// NewTtack | ||
4 | +// | ||
5 | +// Created by yun on 16/1/11. | ||
6 | +// Copyright © 2016年 yun. All rights reserved. | ||
7 | +// | ||
8 | +#define TRACK_VERSION @"1.0.1" | ||
9 | + | ||
10 | +#import <Foundation/Foundation.h> | ||
11 | +#import <UIKit/UIKit.h> | ||
12 | + | ||
13 | + | ||
14 | +/* | ||
15 | + 热云移动广告效果监测 平台 api 请选择对应的api进行使用 | ||
16 | + */ | ||
17 | +NS_ASSUME_NONNULL_BEGIN | ||
18 | +@interface TrackingIO : NSObject | ||
19 | +//开启打印日志 正式上线包请关掉 | ||
20 | ++(void) setPrintLog :(BOOL)print; | ||
21 | +// 开启数据统计 | ||
22 | ++ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId; | ||
23 | +//注册成功后调用 | ||
24 | ++ (void)setRegisterWithAccountID:(NSString *)account; | ||
25 | +//登陆成功后调用 | ||
26 | ++ (void)setLoginWithAccountID:(NSString *)account; | ||
27 | +//开始付费时 调用(人民币单位是元) | ||
28 | ++(void)setPaymentStart:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount; | ||
29 | +// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元) | ||
30 | ++(void)setPayment:(NSString *)transactionId paymentType:(NSString*)paymentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount; | ||
31 | +//自定义事件 | ||
32 | ++(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra; | ||
33 | +//标准接口 | ||
34 | ++(void)setProfile:(NSDictionary *)dataDic; | ||
35 | +//获取设备信息 | ||
36 | ++(NSString*)getDeviceId; | ||
37 | +@end | ||
38 | +NS_ASSUME_NONNULL_END |
1 | +// | ||
2 | +// UnionInterface.h | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 11/23/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | +#import <Foundation/Foundation.h> | ||
9 | +#import <UIKit/UIKit.h> | ||
10 | +#import "PoolCreateOrderInfo.h" | ||
11 | +#import "PoolReportInfo.h" | ||
12 | +@protocol UnionInterface | ||
13 | +/** | ||
14 | + 初始化SDK | ||
15 | + */ | ||
16 | + | ||
17 | +//[[PoolChecker getInstance] sendNotice:PoolSDKNotificationPay notiName:@"" statusCode:POOLSDK_NO_ERROR description:@"" extendData:order_id]; | ||
18 | + | ||
19 | +- (void)SDKinit:(UIViewController *) control; | ||
20 | + | ||
21 | +/** | ||
22 | + 登录SDK | ||
23 | + */ | ||
24 | +- (void)SDKloginSDK; | ||
25 | + | ||
26 | +/** | ||
27 | + 注销 | ||
28 | + */ | ||
29 | +- (void)SDKlogoutSDK; | ||
30 | + | ||
31 | +/** | ||
32 | + 退出 | ||
33 | + */ | ||
34 | +- (void)SDKexitSDK; | ||
35 | + | ||
36 | +/** | ||
37 | + 用户中心 | ||
38 | + */ | ||
39 | +- (void)SDKgotoUserCenter; | ||
40 | + | ||
41 | +- (void)viewDidAppear; | ||
42 | + | ||
43 | +/** | ||
44 | + 提交数据 | ||
45 | + */ | ||
46 | +- (void)SDKreport:(PoolReportInfo *) reportInfo; | ||
47 | + | ||
48 | +/** | ||
49 | + 进行支付 | ||
50 | + */ | ||
51 | + | ||
52 | +- (void)SDKpayWithPaymentInfo:(PoolCreateOrderInfo *)payInfo; | ||
53 | +- (void)receiveCreateOrder: (NSNotification *)notification; | ||
54 | + | ||
55 | +- (void)handleOpenurl:(NSURL *)url; | ||
56 | +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window; | ||
57 | + | ||
58 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// ViewController.h | ||
3 | +// publiDemo | ||
4 | +// | ||
5 | +// Created by winFan on 11/30/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <UIKit/UIKit.h> | ||
10 | + | ||
11 | +@interface ViewController : UIViewController | ||
12 | + | ||
13 | +- (void)receiveSDKMessage : (NSNotification *)notification; | ||
14 | + | ||
15 | +@end | ||
16 | + |
1 | + | ||
2 | +#import "ViewController.h" | ||
3 | +#import "PoolSdk.h" | ||
4 | + | ||
5 | +@interface ViewController () | ||
6 | + | ||
7 | +@end | ||
8 | + | ||
9 | +@implementation ViewController | ||
10 | + | ||
11 | + | ||
12 | +- (void)viewDidLoad { | ||
13 | + [super viewDidLoad]; | ||
14 | + // Do any additional setup after loading the view, typically from a nib. | ||
15 | + UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
16 | + [button1 setTitle:@"登陆" forState:UIControlStateNormal]; | ||
17 | + button1.frame = CGRectMake(50.0f, 100.0f, 50.0f, 40.0f); | ||
18 | + button1.tag = 1; | ||
19 | + [button1 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside]; | ||
20 | + [self.view addSubview:button1]; | ||
21 | + | ||
22 | + UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
23 | + [button2 setTitle:@"数据" forState:UIControlStateNormal]; | ||
24 | + button2.frame = CGRectMake(150.0f, 100.0f, 50.0f, 40.0f); | ||
25 | + button2.tag = 2; | ||
26 | + [button2 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside]; | ||
27 | + [self.view addSubview:button2]; | ||
28 | + | ||
29 | + UIButton *button4 = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
30 | + [button4 setTitle:@"充值" forState:UIControlStateNormal]; | ||
31 | + button4.frame = CGRectMake(150.0f, 50.0f, 50.0f, 40.0f); | ||
32 | + button4.tag = 4; | ||
33 | + [button4 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside]; | ||
34 | + [self.view addSubview:button4]; | ||
35 | + | ||
36 | + | ||
37 | + UIButton *button6 = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
38 | + [button6 setTitle:@"获取配置参数" forState:UIControlStateNormal]; | ||
39 | + button6.frame = CGRectMake(10.0f, 50.0f, 150.0f, 40.0f); | ||
40 | + button6.tag = 6; | ||
41 | + [button6 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside]; | ||
42 | + [self.view addSubview:button6]; | ||
43 | + | ||
44 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:poolSDK_Notification object:nil]; | ||
45 | + | ||
46 | + [[PoolSdk shareSDK]initSDK:self]; | ||
47 | +} | ||
48 | + | ||
49 | +-(void)viewDidAppear:(BOOL)animated{ | ||
50 | + [super viewDidAppear:animated]; | ||
51 | + //[[PoolSdk shareSDK] viewDidAppear]; | ||
52 | +} | ||
53 | + | ||
54 | + | ||
55 | +- (void) toggleButton: (UIButton *) button | ||
56 | +{ | ||
57 | + int tag = (int)button.tag; | ||
58 | + if (tag == 1) { | ||
59 | + [[PoolSdk shareSDK] loginSDK]; | ||
60 | + } | ||
61 | + else if (tag == 2) | ||
62 | + { | ||
63 | + NSLog(@"数据接口"); | ||
64 | + PoolReportInfo *reportInfo = [[PoolReportInfo alloc]init]; | ||
65 | + [reportInfo setReportType:REPORT_ENTER]; | ||
66 | + //[reportInfo setReportType:REPORT_CREATEROLE]; | ||
67 | + //[reportInfo setReportType:REPORT_ROLEUPGRADE] | ||
68 | + [reportInfo setServerId:@"9133"]; | ||
69 | + [reportInfo setPlayerName:@"roleName"]; | ||
70 | + [reportInfo setPlayerId:@"pserverName"]; | ||
71 | + [[PoolSdk shareSDK] reportSDK:reportInfo]; | ||
72 | + } | ||
73 | + else if (tag == 4) | ||
74 | + { | ||
75 | + PoolCreateOrderInfo *payInfo = [[PoolCreateOrderInfo alloc]init]; | ||
76 | + [payInfo setServerId:@"111"]; | ||
77 | + [payInfo setPostAmount:@"6"]; | ||
78 | + [payInfo setPlayerId:@"1231241234"]; | ||
79 | + [payInfo setTimestamp:@"1232134"]; | ||
80 | + [payInfo setExchange:@"10"]; | ||
81 | + [payInfo setCustom:@"custom"]; | ||
82 | + NSLog(@"start pay"); | ||
83 | + [[PoolSdk shareSDK] payWithPaymentInfo:payInfo]; | ||
84 | + } | ||
85 | + else if(tag == 6){ | ||
86 | + PoolSdk *poolSdk = [PoolSdk shareSDK]; | ||
87 | + NSLog(@"channelId:%@parame1:%@parame2:%@custom:%@",[poolSdk getGameChannelId],[poolSdk getChannelParameter1],[poolSdk getChannelParameter2],[poolSdk getCustomValue]); | ||
88 | + } | ||
89 | +} | ||
90 | + | ||
91 | + | ||
92 | +- (void)didReceiveMemoryWarning { | ||
93 | + [super didReceiveMemoryWarning]; | ||
94 | +} | ||
95 | + | ||
96 | +- (void)receiveSDKMessage:(NSNotification *)notification | ||
97 | +{ | ||
98 | + NSLog(@"receiveSDKMessage"); | ||
99 | + [[PoolConfig getInstance] getValueByKey:@"gamechannelid"]; | ||
100 | + PoolSDKResult *result = [notification object]; | ||
101 | + if (result == nil ) { | ||
102 | + return; | ||
103 | + } | ||
104 | + switch (result.notiType) { | ||
105 | + | ||
106 | + case PoolSDKNotificationInitSDK: | ||
107 | + { | ||
108 | + NSLog(@"收到PoolSDKNotificationInitSDK"); | ||
109 | + } | ||
110 | + | ||
111 | + break; | ||
112 | + case PoolSDKNotificationLogin: | ||
113 | + { | ||
114 | + NSLog(@"result state:%d",result.statusCode); | ||
115 | + if (result.statusCode == POOLSDK_NO_ERROR) { | ||
116 | + PoolLoginInfo *loginInfo = (PoolLoginInfo*)result.extendData; | ||
117 | + NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]); | ||
118 | + NSLog(@"收到登陆信息public token:%@", [loginInfo sign]); | ||
119 | + NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]); | ||
120 | + NSLog(@"userType:%@",[loginInfo userType]); | ||
121 | + }else{ | ||
122 | + NSLog(@"%@",[result description]); | ||
123 | + } | ||
124 | + } | ||
125 | + break; | ||
126 | + case PoolSDKNotificationPay: | ||
127 | + { | ||
128 | + NSLog(@"收到登陆信息PoolSDKNotificationPay"); | ||
129 | + } | ||
130 | + break; | ||
131 | + default: | ||
132 | + break; | ||
133 | + } | ||
134 | +} | ||
135 | + | ||
136 | +@end |
1 | +// | ||
2 | +// main.m | ||
3 | +// Demo | ||
4 | +// | ||
5 | +// Created by winFan on 12/9/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <UIKit/UIKit.h> | ||
10 | +#import "AppDelegate.h" | ||
11 | + | ||
12 | +int main(int argc, char * argv[]) { | ||
13 | + @autoreleasepool { | ||
14 | + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); | ||
15 | + } | ||
16 | +} |
1 | +// | ||
2 | +// DemoTests.m | ||
3 | +// DemoTests | ||
4 | +// | ||
5 | +// Created by winFan on 12/9/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <UIKit/UIKit.h> | ||
10 | +#import <XCTest/XCTest.h> | ||
11 | + | ||
12 | +@interface DemoTests : XCTestCase | ||
13 | + | ||
14 | +@end | ||
15 | + | ||
16 | +@implementation DemoTests | ||
17 | + | ||
18 | +- (void)setUp { | ||
19 | + [super setUp]; | ||
20 | + // Put setup code here. This method is called before the invocation of each test method in the class. | ||
21 | +} | ||
22 | + | ||
23 | +- (void)tearDown { | ||
24 | + // Put teardown code here. This method is called after the invocation of each test method in the class. | ||
25 | + [super tearDown]; | ||
26 | +} | ||
27 | + | ||
28 | +- (void)testExample { | ||
29 | + // This is an example of a functional test case. | ||
30 | + XCTAssert(YES, @"Pass"); | ||
31 | +} | ||
32 | + | ||
33 | +- (void)testPerformanceExample { | ||
34 | + // This is an example of a performance test case. | ||
35 | + [self measureBlock:^{ | ||
36 | + // Put the code you want to measure the time of here. | ||
37 | + }]; | ||
38 | +} | ||
39 | + | ||
40 | +@end |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | +<plist version="1.0"> | ||
4 | +<dict> | ||
5 | + <key>CFBundleDevelopmentRegion</key> | ||
6 | + <string>en</string> | ||
7 | + <key>CFBundleExecutable</key> | ||
8 | + <string>$(EXECUTABLE_NAME)</string> | ||
9 | + <key>CFBundleIdentifier</key> | ||
10 | + <string>com.mango.ios.fytx.$(PRODUCT_NAME:rfc1034identifier)</string> | ||
11 | + <key>CFBundleInfoDictionaryVersion</key> | ||
12 | + <string>6.0</string> | ||
13 | + <key>CFBundleName</key> | ||
14 | + <string>$(PRODUCT_NAME)</string> | ||
15 | + <key>CFBundlePackageType</key> | ||
16 | + <string>BNDL</string> | ||
17 | + <key>CFBundleShortVersionString</key> | ||
18 | + <string>1.0</string> | ||
19 | + <key>CFBundleSignature</key> | ||
20 | + <string>????</string> | ||
21 | + <key>CFBundleVersion</key> | ||
22 | + <string>1</string> | ||
23 | +</dict> | ||
24 | +</plist> |
1 | +import shutil | ||
2 | +import os | ||
3 | +import plistlib | ||
4 | + | ||
5 | +import config | ||
6 | +import json | ||
7 | +import packageProj | ||
8 | + | ||
9 | +from mod_pbxproj import XcodeProject | ||
10 | + | ||
11 | + | ||
12 | +gameProjName = config.gameProjName | ||
13 | +channelName = "linyou" | ||
14 | +#copy dir xcodeproj | ||
15 | +copyNewDirName = gameProjName + '_' + channelName + '.xcodeproj' | ||
16 | +currentPath = os.path.abspath('.') | ||
17 | +currentPath += '/' + copyNewDirName | ||
18 | + | ||
19 | + | ||
20 | +if os.path.exists(currentPath): | ||
21 | + shutil.rmtree(currentPath) | ||
22 | + | ||
23 | +shutil.copytree(gameProjName + '.xcodeproj',currentPath) | ||
24 | + | ||
25 | +project = XcodeProject.Load(copyNewDirName + '/project.pbxproj') | ||
26 | + | ||
27 | +#project.add_other_ldflags('-ObjC') | ||
28 | +#frameworks = project.add_folder('poolsdk_file/poolsdk_itools') | ||
29 | +#print(frameworks); | ||
30 | +#add search path | ||
31 | + | ||
32 | +channelRootPath = config.channelRootPath#'poolsdk_file' | ||
33 | + | ||
34 | +frameworksPath = '$(PROJECT_DIR)/' + channelRootPath + '/poolsdk_' + channelName + '/SDK' | ||
35 | +print(frameworksPath); | ||
36 | +#add header search path | ||
37 | +project.add_header_search_paths(frameworksPath, recursive=False) | ||
38 | +#add framework search path | ||
39 | +project.add_framework_search_paths(frameworksPath, recursive=False) | ||
40 | +#add library search path | ||
41 | +project.add_library_search_paths(frameworksPath, recursive=False) | ||
42 | + | ||
43 | +#add poolsdk_xy dir all file into project | ||
44 | +project.remove_group_by_name('poolsdk') | ||
45 | +frameworkRelativePath = project.add_folder(channelRootPath + '/poolsdk_' + channelName + '/SDK') | ||
46 | + | ||
47 | +project.add_file_if_doesnt_exist('pool_setting',parent=frameworkRelativePath, weak=True,ignore_unknown_type=True) | ||
48 | + | ||
49 | + | ||
50 | +systemFrameworks = project.get_or_create_group('Frameworks') | ||
51 | +#add system framework | ||
52 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreTelephony.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
53 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/Security.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
54 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/QuartzCore.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
55 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/SystemConfiguration.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
56 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/AdSupport.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
57 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/StoreKit.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
58 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreText.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
59 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/CoreMotion.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
60 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/CFNetwork.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
61 | + | ||
62 | +#add system dylib | ||
63 | +systemLibs = project.get_or_create_group('Libraries') | ||
64 | +project.add_file_if_doesnt_exist('/usr/lib/libsqlite3.dylib',parent=systemLibs, weak=True, tree='<absolute>')#absolute path | ||
65 | +project.add_file_if_doesnt_exist('/usr/lib/libz.1.dylib',parent=systemLibs, weak=True, tree='<absolute>') | ||
66 | +project.add_file_if_doesnt_exist('/usr/lib/libc++.1.dylib',parent=systemLibs, weak=True, tree='<absolute>') | ||
67 | + | ||
68 | +#modify info.plist reference path | ||
69 | +project.add_single_valued_flag('INFOPLIST_FILE',channelRootPath + '/poolsdk_' + channelName + '/Info.plist') | ||
70 | + | ||
71 | +project.add_single_valued_flag('ENABLE_BITCODE', 'NO') | ||
72 | + | ||
73 | +readInfoPlistFilePath = channelRootPath + '/poolsdk/Info.plist' | ||
74 | +writeInfoFilePath = channelRootPath + '/poolsdk_' + channelName + '/Info.plist' | ||
75 | +infoContent = plistlib.readPlist(readInfoPlistFilePath) | ||
76 | + | ||
77 | +xyInfoPath = channelRootPath + '/poolsdk_' + channelName + '/Info_' + channelName + '.plist' | ||
78 | +xyInfoContent = plistlib.readPlist(xyInfoPath) | ||
79 | + | ||
80 | +#read pool_setting file | ||
81 | +settingFile = open(channelRootPath + '/poolsdk_' + channelName + '/SDK/pool_setting','rw') | ||
82 | +try: | ||
83 | + settingFileContent = settingFile.read( ) | ||
84 | +finally: | ||
85 | + settingFile.close( ) | ||
86 | +#json op | ||
87 | +jsonStr = json.loads(settingFileContent) | ||
88 | + | ||
89 | +#modify bundle id | ||
90 | +project.add_single_valued_flag('PRODUCT_BUNDLE_IDENTIFIER',jsonStr["appScheme"]) | ||
91 | + | ||
92 | +#update and add info.plist content | ||
93 | +infoContent.update(xyInfoContent) | ||
94 | +#write | ||
95 | +plistlib.writePlist(infoContent,writeInfoFilePath) | ||
96 | + | ||
97 | +project.save() | ||
98 | + | ||
99 | + | ||
100 | +packageProj.buildProjName = gameProjName + '_' + channelName | ||
101 | +packageProj.targetName = gameProjName | ||
102 | +packageProj.buildProj() |
1 | +import os | ||
2 | + | ||
3 | +import commands | ||
4 | + | ||
5 | + | ||
6 | +buildProjName = '' | ||
7 | +targetName = '' | ||
8 | +import shutil | ||
9 | +import os | ||
10 | + | ||
11 | +def buildProj(): | ||
12 | + | ||
13 | + if buildProjName == '': | ||
14 | + print('buildProjName is not define') | ||
15 | + | ||
16 | + else: | ||
17 | + #build project | ||
18 | + commands.getstatusoutput('xcodebuild -project ' + buildProjName + '.xcodeproj') | ||
19 | + releaseDir = os.path.abspath('.') + '/Release' | ||
20 | + if not os.path.exists(releaseDir): | ||
21 | + os.mkdir(releaseDir) | ||
22 | + | ||
23 | + ipaPath = releaseDir + '/' + buildProjName + '-Release.ipa' | ||
24 | + buildPath = os.path.abspath('.') + '/build' | ||
25 | + if os.path.exists(ipaPath): | ||
26 | + os.remove(ipaPath) | ||
27 | + | ||
28 | + resultStr = commands.getstatusoutput('xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/' + targetName + '.app -o ' +ipaPath) | ||
29 | + #print(resultStr) | ||
30 | + | ||
31 | + if os.path.exists(buildPath): | ||
32 | + shutil.rmtree(buildPath) | ||
33 | + |
1 | +{ | ||
2 | + "images" : [ | ||
3 | + { | ||
4 | + "idiom" : "iphone", | ||
5 | + "size" : "29x29", | ||
6 | + "scale" : "2x" | ||
7 | + }, | ||
8 | + { | ||
9 | + "idiom" : "iphone", | ||
10 | + "size" : "29x29", | ||
11 | + "scale" : "3x" | ||
12 | + }, | ||
13 | + { | ||
14 | + "idiom" : "iphone", | ||
15 | + "size" : "40x40", | ||
16 | + "scale" : "2x" | ||
17 | + }, | ||
18 | + { | ||
19 | + "idiom" : "iphone", | ||
20 | + "size" : "40x40", | ||
21 | + "scale" : "3x" | ||
22 | + }, | ||
23 | + { | ||
24 | + "idiom" : "iphone", | ||
25 | + "size" : "60x60", | ||
26 | + "scale" : "2x" | ||
27 | + }, | ||
28 | + { | ||
29 | + "idiom" : "iphone", | ||
30 | + "size" : "60x60", | ||
31 | + "scale" : "3x" | ||
32 | + } | ||
33 | + ], | ||
34 | + "info" : { | ||
35 | + "version" : 1, | ||
36 | + "author" : "xcode" | ||
37 | + } | ||
38 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +{ | ||
2 | + "images" : [ | ||
3 | + { | ||
4 | + "orientation" : "portrait", | ||
5 | + "idiom" : "iphone", | ||
6 | + "minimum-system-version" : "7.0", | ||
7 | + "scale" : "2x" | ||
8 | + }, | ||
9 | + { | ||
10 | + "orientation" : "portrait", | ||
11 | + "idiom" : "iphone", | ||
12 | + "minimum-system-version" : "7.0", | ||
13 | + "subtype" : "retina4", | ||
14 | + "scale" : "2x" | ||
15 | + } | ||
16 | + ], | ||
17 | + "info" : { | ||
18 | + "version" : 1, | ||
19 | + "author" : "xcode" | ||
20 | + } | ||
21 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | +<plist version="1.0"> | ||
4 | +<dict> | ||
5 | + <key>CFBundleDevelopmentRegion</key> | ||
6 | + <string>en</string> | ||
7 | + <key>CFBundleExecutable</key> | ||
8 | + <string>$(EXECUTABLE_NAME)</string> | ||
9 | + <key>CFBundleIdentifier</key> | ||
10 | + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
11 | + <key>CFBundleInfoDictionaryVersion</key> | ||
12 | + <string>6.0</string> | ||
13 | + <key>CFBundleName</key> | ||
14 | + <string>$(PRODUCT_NAME)</string> | ||
15 | + <key>CFBundlePackageType</key> | ||
16 | + <string>APPL</string> | ||
17 | + <key>CFBundleShortVersionString</key> | ||
18 | + <string>1.0</string> | ||
19 | + <key>CFBundleSignature</key> | ||
20 | + <string>????</string> | ||
21 | + <key>CFBundleURLTypes</key> | ||
22 | + <array> | ||
23 | + <dict> | ||
24 | + <key>CFBundleTypeRole</key> | ||
25 | + <string>Editor</string> | ||
26 | + <key>CFBundleURLSchemes</key> | ||
27 | + <array> | ||
28 | + <string>com.youai.sdk</string> | ||
29 | + </array> | ||
30 | + </dict> | ||
31 | + </array> | ||
32 | + <key>CFBundleVersion</key> | ||
33 | + <string>1</string> | ||
34 | + <key>LSRequiresIPhoneOS</key> | ||
35 | + <true/> | ||
36 | + <key>UILaunchStoryboardName</key> | ||
37 | + <string>LaunchScreen</string> | ||
38 | + <key>UIMainStoryboardFile</key> | ||
39 | + <string>Main</string> | ||
40 | + <key>UIRequiredDeviceCapabilities</key> | ||
41 | + <array> | ||
42 | + <string>armv7</string> | ||
43 | + </array> | ||
44 | + <key>UISupportedInterfaceOrientations</key> | ||
45 | + <array> | ||
46 | + <string>UIInterfaceOrientationLandscapeLeft</string> | ||
47 | + <string>UIInterfaceOrientationLandscapeRight</string> | ||
48 | + </array> | ||
49 | +</dict> | ||
50 | +</plist> |
1 | +// | ||
2 | +// PoolSdk.h | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 11/23/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | +#import <PoolSdk/PoolSdk2.h> | ||
11 | +#import <UIKit/UIKit.h> | ||
12 | + | ||
13 | +@interface PoolSdk : NSObject | ||
14 | +/** | ||
15 | + * 当前SDK的版本 | ||
16 | + */ | ||
17 | +@property(nonatomic, strong, readonly)NSString *sdkVersion; | ||
18 | + | ||
19 | +/** | ||
20 | + * 用于设置url types schemes 默认为工程名 | ||
21 | + */ | ||
22 | +@property(nonatomic, strong)NSString *urlSchemes; | ||
23 | + | ||
24 | +/** | ||
25 | + 获取SDK实例对象 | ||
26 | + */ | ||
27 | ++ (PoolSdk *)shareSDK; | ||
28 | + | ||
29 | +/** | ||
30 | + 初始化SDK | ||
31 | + */ | ||
32 | +- (void)initSDK:(UIViewController *) control; | ||
33 | + | ||
34 | + | ||
35 | +-(void)viewDidAppear; | ||
36 | + | ||
37 | +/** | ||
38 | + 登录SDK | ||
39 | + */ | ||
40 | +- (void)loginSDK; | ||
41 | + | ||
42 | +/** | ||
43 | + 进行支付 | ||
44 | + */ | ||
45 | +- (void)payWithPaymentInfo:(PoolCreateOrderInfo *)payInfo; | ||
46 | + | ||
47 | +/** | ||
48 | + 用户中心 | ||
49 | + */ | ||
50 | +- (void)gotoUserCenter; | ||
51 | + | ||
52 | +/** | ||
53 | + report | ||
54 | + */ | ||
55 | +- (void)reportSDK:(PoolReportInfo *)reportInfo; | ||
56 | + | ||
57 | +/** | ||
58 | + 注销 | ||
59 | + */ | ||
60 | +- (void)logoutSDK; | ||
61 | + | ||
62 | +/** | ||
63 | + 退出 | ||
64 | + */ | ||
65 | +- (void)exitSDK; | ||
66 | + | ||
67 | + | ||
68 | + | ||
69 | +/** | ||
70 | + 显示/隐藏浮标 | ||
71 | + */ | ||
72 | +//- (void)showFloatIcon:(BOOL)bFlag; | ||
73 | + | ||
74 | + | ||
75 | +/** | ||
76 | + // called in - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url | ||
77 | + */ | ||
78 | +- (void)handleOpenurl:(NSURL *)url; | ||
79 | + | ||
80 | +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window; | ||
81 | +/** | ||
82 | + 应用 appid | ||
83 | + */ | ||
84 | + | ||
85 | +/** | ||
86 | + 应用支持的方向 默认为 EDreamSDKOrientationLandscape | ||
87 | + */ | ||
88 | +@property(nonatomic, assign)ESDKOrientation sdkOrientation; | ||
89 | + | ||
90 | +/** | ||
91 | + 浮标是否已经显示,默认为NO | ||
92 | + */ | ||
93 | +@property(nonatomic, assign)BOOL bShowedFloat; | ||
94 | + | ||
95 | + | ||
96 | +/** | ||
97 | + serverId | ||
98 | + */ | ||
99 | +@property(nonatomic, assign)int serverId; | ||
100 | + | ||
101 | +/** | ||
102 | + 获取gamechannelid | ||
103 | + */ | ||
104 | +-(NSString *) getGameChannelId; | ||
105 | + | ||
106 | +/** | ||
107 | + 获取Custom | ||
108 | + */ | ||
109 | +- (NSString *) getCustomValue; | ||
110 | + | ||
111 | +/** | ||
112 | + 获取ChannelParameter1 | ||
113 | + */ | ||
114 | +- (NSString *) getChannelParameter1; | ||
115 | + | ||
116 | +/** | ||
117 | + 获取ChannelParameter2 | ||
118 | + */ | ||
119 | +- (NSString *) getChannelParameter2; | ||
120 | + | ||
121 | + | ||
122 | +@end |
1 | +// | ||
2 | +// PoolSdk.m | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 11/23/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import "PoolSdk.h" | ||
10 | +#import "SDKInterface.h" | ||
11 | + | ||
12 | +static PoolSdk *s_PoolSdkCerterInstance = nil; | ||
13 | +static id<UnionInterface> _interface = nil; | ||
14 | +@implementation PoolSdk : NSObject | ||
15 | + | ||
16 | +- (id)init | ||
17 | +{ | ||
18 | + if(self = [super init]) | ||
19 | + { | ||
20 | + _sdkVersion = [NSString stringWithFormat:@"%@ - %@",[[PoolConfig getInstance] gameSimpleName], [[PoolConfig getInstance] sdkSimpleName]]; | ||
21 | + _interface = [[SDKInterface alloc] init]; | ||
22 | + self.urlSchemes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]; | ||
23 | + } | ||
24 | + return self; | ||
25 | +} | ||
26 | + | ||
27 | +- (void)initSDK :(UIViewController *) control | ||
28 | +{ | ||
29 | + if (![[NSUserDefaults standardUserDefaults] boolForKey:@"pool_everLaunched"]) { | ||
30 | + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"pool_everLaunched"]; | ||
31 | + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"pool_firstLaunch"]; | ||
32 | + } | ||
33 | + else{ | ||
34 | + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"pool_firstLaunch"]; | ||
35 | + } | ||
36 | + | ||
37 | + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]) { | ||
38 | + | ||
39 | + } | ||
40 | + [_interface SDKinit:control]; | ||
41 | + | ||
42 | + [[PoolChecker getInstance] reportSDKOpen]; | ||
43 | + | ||
44 | + NSString* channelId = [[PoolConfig getInstance] getValueByKey:@"gamechannelid"]; | ||
45 | + [TrackingIO initWithappKey:[[PoolConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId]; | ||
46 | +} | ||
47 | + | ||
48 | +/** | ||
49 | + 获取SDK实例对象 | ||
50 | + */ | ||
51 | ++ (PoolSdk *)shareSDK | ||
52 | +{ | ||
53 | + static dispatch_once_t dgonceToken; | ||
54 | + dispatch_once(&dgonceToken, ^{ | ||
55 | + s_PoolSdkCerterInstance = [[PoolSdk alloc] init]; | ||
56 | + s_PoolSdkCerterInstance.sdkOrientation = ESDKOrientationLandscape; | ||
57 | + s_PoolSdkCerterInstance.bShowedFloat = NO; | ||
58 | + }); | ||
59 | + | ||
60 | + return s_PoolSdkCerterInstance; | ||
61 | +} | ||
62 | + | ||
63 | +-(void)viewDidAppear{ | ||
64 | + [_interface viewDidAppear]; | ||
65 | +} | ||
66 | + | ||
67 | +- (void)loginSDK | ||
68 | +{ | ||
69 | + [[PoolChecker getInstance] reportOpen]; | ||
70 | + [_interface SDKloginSDK]; | ||
71 | +} | ||
72 | + | ||
73 | +- (void)payWithPaymentInfo:(PoolCreateOrderInfo *)payInfo | ||
74 | +{ | ||
75 | + [_interface SDKpayWithPaymentInfo:payInfo]; | ||
76 | +} | ||
77 | + | ||
78 | +- (void)reportSDK:(PoolReportInfo *)reportInfo | ||
79 | +{ | ||
80 | + NSString *reportT = [reportInfo reportType]; | ||
81 | + reportInfo.openId = [[PoolChecker getInstance] userId]; | ||
82 | + if ([reportT isEqualToString:REPORT_ENTER]) { | ||
83 | + [[PoolChecker getInstance] reportEnter:reportInfo]; | ||
84 | + NSLog(@"reportSDK enter"); | ||
85 | + [TrackingIO setLoginWithAccountID:[reportInfo playerId]]; | ||
86 | + }else if ([reportT isEqualToString:REPORT_ROLEUPGRADE]){ | ||
87 | + | ||
88 | + }else if ([reportT isEqualToString:REPORT_CREATEROLE]){ | ||
89 | + NSLog(@"reportSDK createRole"); | ||
90 | + [TrackingIO setRegisterWithAccountID:[reportInfo playerId]]; | ||
91 | + } | ||
92 | +// [[PoolChecker getInstance] reportOpen]; | ||
93 | + [_interface SDKreport:reportInfo]; | ||
94 | + | ||
95 | +} | ||
96 | + | ||
97 | +- (void)gotoUserCenter | ||
98 | +{ | ||
99 | + [_interface SDKgotoUserCenter]; | ||
100 | +} | ||
101 | + | ||
102 | +- (void)logoutSDK | ||
103 | +{ | ||
104 | + [_interface SDKlogoutSDK]; | ||
105 | +} | ||
106 | + | ||
107 | +- (void)exitSDK | ||
108 | +{ | ||
109 | + [_interface SDKexitSDK]; | ||
110 | +} | ||
111 | + | ||
112 | +- (void)handleOpenurl:(NSURL *)url | ||
113 | +{ | ||
114 | + NSLog(@"handleOpenurl%@",url); | ||
115 | + if([[url host] isEqualToString:@"c_code"]){ | ||
116 | + NSString* path = url.path; | ||
117 | + NSString* codeValue = [path substringFromIndex:1]; | ||
118 | + [[PoolChecker getInstance] handleFirstOpenApp:codeValue]; | ||
119 | + } | ||
120 | + [_interface handleOpenurl:url]; | ||
121 | +} | ||
122 | + | ||
123 | +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window | ||
124 | +{ | ||
125 | + return [_interface application:application supportedInterfaceOrientationsForWindow:window]; | ||
126 | +} | ||
127 | + | ||
128 | +- (NSString *)getGameChannelId{ | ||
129 | + return [[PoolConfig getInstance]getValueByKey:@"gamechannelid"]; | ||
130 | +} | ||
131 | + | ||
132 | +- (NSString *)getCustomValue{ | ||
133 | + return [[PoolConfig getInstance]getValueByKey:@"custom"]; | ||
134 | +} | ||
135 | + | ||
136 | +- (NSString *)getChannelParameter1{ | ||
137 | + return [[PoolConfig getInstance]getValueByKey:@"c1"]; | ||
138 | +} | ||
139 | + | ||
140 | +- (NSString *)getChannelParameter2{ | ||
141 | + return [[PoolConfig getInstance]getValueByKey:@"c2"]; | ||
142 | +} | ||
143 | + | ||
144 | +@end |
1 | +// | ||
2 | +// UnionInterface.m | ||
3 | +// PoolSdk | ||
4 | +// | ||
5 | +// Created by winFan on 11/23/15. | ||
6 | +// Copyright (c) 2015 winFan. All rights reserved. | ||
7 | +// | ||
8 | +#include "SDKInterface.h" | ||
9 | +#import <UIKit/UIKit.h> | ||
10 | + | ||
11 | +#import "YouaiSDK/YouaiSDKMgr.h" | ||
12 | +#import "YouaiSDK/YouaiNotifications.h" | ||
13 | +#import "YouaiSDK/YouaiLoginInfo.h" | ||
14 | + | ||
15 | + | ||
16 | +//SDK | ||
17 | + | ||
18 | + | ||
19 | +@implementation SDKInterface : Interface | ||
20 | + | ||
21 | + | ||
22 | +int mExchange; | ||
23 | + | ||
24 | + | ||
25 | +/** | ||
26 | + 初始化SDK | ||
27 | +*/ | ||
28 | +- (void)SDKinit:(UIViewController *) control | ||
29 | +{ | ||
30 | + //必须继承 | ||
31 | + [super SDKinit:control]; | ||
32 | + | ||
33 | + [PoolConfig getInstance]; | ||
34 | + [[YouaiSDKMgr getInstance]initSDK]; | ||
35 | + [[YouaiSDKMgr getInstance]setStyleName:@"sdk"]; | ||
36 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:youaiLoginNotification object:nil]; | ||
37 | + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applePayCallBack:) name:@"applePayCallBack" object:nil]; | ||
38 | + | ||
39 | + [[PoolChecker getInstance] sendNotice:PoolSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:POOLSDK_NO_ERROR description:@"initSuccess" extendData:nil]; | ||
40 | +} | ||
41 | + | ||
42 | +/** | ||
43 | + 登录SDK | ||
44 | + */ | ||
45 | +- (void)SDKloginSDK | ||
46 | +{ | ||
47 | + NSLog(@"调用了LoginSDK"); | ||
48 | + NSString *appId = [[PoolConfig getInstance] getValueByKey:@"APP_ID"]; | ||
49 | + NSString *appKey =[[PoolConfig getInstance] getValueByKey:@"APP_KEY"]; | ||
50 | + [[YouaiSDKMgr getInstance]openLogin:appId :appKey :self.controller]; | ||
51 | + | ||
52 | +} | ||
53 | + | ||
54 | +/** | ||
55 | + loginCheck | ||
56 | + */ | ||
57 | +- (void)receiveLoginMessage:(NSNotification *)notification | ||
58 | +{ | ||
59 | + NSLog(@"loginchek"); | ||
60 | + PoolLoginInfo *loginInfo = [PoolLoginInfo alloc]; | ||
61 | + loginInfo.openId = [[YouaiLoginInfo getInstance]openId]; | ||
62 | + loginInfo.sign = [[YouaiLoginInfo getInstance] token]; | ||
63 | + loginInfo.timestamp = [YouaiLoginInfo getInstance].timestamp; | ||
64 | + | ||
65 | + dispatch_async(dispatch_get_global_queue(0, 0), ^{ | ||
66 | + [[PoolChecker getInstance] startCheck:loginInfo]; | ||
67 | + }); | ||
68 | + | ||
69 | +} | ||
70 | + | ||
71 | + | ||
72 | +-(NSString*)DataTojsonString:(id)object | ||
73 | +{ | ||
74 | + NSString *jsonString = nil; | ||
75 | + NSError *error; | ||
76 | + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object | ||
77 | + options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string | ||
78 | + error:&error]; | ||
79 | + jsonString = [jsonData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; | ||
80 | + return jsonString; | ||
81 | +} | ||
82 | + | ||
83 | +/** | ||
84 | + 苹果支付结果回调 | ||
85 | + */ | ||
86 | + | ||
87 | +- (void)applePayCallBack:(NSNotification *)notification | ||
88 | +{ | ||
89 | + NSDictionary* payResultDic = notification.object; | ||
90 | + | ||
91 | + NSString* receiptStr = [payResultDic objectForKey:@"payResult"]; | ||
92 | + NSString* queryId = [payResultDic objectForKey:@"query_id"]; | ||
93 | + | ||
94 | + NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil]; | ||
95 | + NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic]; | ||
96 | + | ||
97 | + | ||
98 | + if([@"success" isEqualToString:result]){//确认订单成功 | ||
99 | + }else{//失败 | ||
100 | + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; | ||
101 | + NSMutableArray* queryIdArray = [userDefaults objectForKey:@"queryIds"]; | ||
102 | + | ||
103 | + NSMutableArray* tempQueryIdArray = [[NSMutableArray alloc] initWithCapacity:10]; | ||
104 | + | ||
105 | + if (queryIdArray) { | ||
106 | + }else{ | ||
107 | + queryIdArray = [[NSMutableArray alloc]initWithCapacity:10]; | ||
108 | + } | ||
109 | + | ||
110 | + for (NSString* arrayQueryId in queryIdArray) { | ||
111 | + [tempQueryIdArray addObject:arrayQueryId]; | ||
112 | + } | ||
113 | + | ||
114 | + [tempQueryIdArray addObject:queryId]; | ||
115 | + [userDefaults setObject:tempQueryIdArray forKey:@"queryIds"]; | ||
116 | + [userDefaults setObject:receiptStr forKey:queryId]; | ||
117 | + [userDefaults synchronize]; | ||
118 | + } | ||
119 | +} | ||
120 | + | ||
121 | +/** | ||
122 | + 支付 创建订单 | ||
123 | + */ | ||
124 | +- (void)SDKpayWithPaymentInfo:(PoolCreateOrderInfo *)payInfo | ||
125 | +{ | ||
126 | + mExchange = [payInfo exchange].intValue; | ||
127 | + [super SDKpayWithPaymentInfo:payInfo]; | ||
128 | +} | ||
129 | + | ||
130 | +/** | ||
131 | + SDK | ||
132 | + */ | ||
133 | +- (void)SDKgotoUserCenter | ||
134 | +{ | ||
135 | +} | ||
136 | + | ||
137 | +- (void)SDKreport:(PoolReportInfo *)reportInfo | ||
138 | +{ | ||
139 | + NSLog(@"reportInfo"); | ||
140 | + NSString* reportType = [reportInfo reportType]; | ||
141 | + if (reportInfo) { | ||
142 | + if ([reportType isEqualToString:REPORT_ENTER]) { | ||
143 | + dispatch_async(dispatch_get_global_queue(0, 0), ^{ | ||
144 | + [self handlerLeakOrder]; | ||
145 | + }); | ||
146 | + } | ||
147 | + } | ||
148 | +} | ||
149 | + | ||
150 | +/** | ||
151 | + SDK | ||
152 | + */ | ||
153 | +- (void)SDKexitSDK | ||
154 | +{ | ||
155 | + | ||
156 | +} | ||
157 | + | ||
158 | +- (void)SDKlogoutSDK | ||
159 | +{ | ||
160 | + NSLog(@"切换账号"); | ||
161 | +} | ||
162 | + | ||
163 | +- (void)handleOpenurl:(NSURL *)url | ||
164 | +{ | ||
165 | +} | ||
166 | + | ||
167 | +- (void)receivePayMessage : (NSNotification *)notification; | ||
168 | +{ | ||
169 | + NSString *order_id = [notification object]; | ||
170 | + NSLog(@"订单ID:%@", order_id); | ||
171 | +} | ||
172 | + | ||
173 | +//补单处理 | ||
174 | +- (void) handlerLeakOrder{ | ||
175 | + NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults]; | ||
176 | + NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"]; | ||
177 | + | ||
178 | + NSLog(@"orderDic%@",queryIdArray); | ||
179 | + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults]; | ||
180 | + NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];//补单失败的queryid集合 | ||
181 | + | ||
182 | + if(queryIdArray){ | ||
183 | + for (NSString* queryId in queryIdArray) { | ||
184 | + NSString* receiptStr = [userDefaults valueForKey:queryId]; | ||
185 | + NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil]; | ||
186 | + NSString* result = [[NetCenter getInstance] httpPostSyn:[PoolUtils createPayUrl] :receiptDic]; | ||
187 | + if([@"success" isEqualToString:result]){//成功 | ||
188 | + [userDefaults removeObjectForKey:queryId]; | ||
189 | + }else{//补单失败 | ||
190 | + [failQueryIdArray addObject:queryId]; | ||
191 | + } | ||
192 | + } | ||
193 | + | ||
194 | + NSLog(@"order count:%lu",(unsigned long)[failQueryIdArray count]); | ||
195 | + if([failQueryIdArray count] > 0){//含有补单失败项 | ||
196 | + [userDefaults setObject:failQueryIdArray forKey:@"queryIds"]; | ||
197 | + }else{//全部补单成功 | ||
198 | + [userDefaults removeObjectForKey:@"queryIds"]; | ||
199 | + } | ||
200 | + [userDefaults synchronize]; | ||
201 | + } | ||
202 | +} | ||
203 | + | ||
204 | + | ||
205 | +- (void)receiveCreateOrder:(NSNotification *)notification | ||
206 | +{ | ||
207 | + NSLog(@"创建订单成功"); | ||
208 | + PoolPayInfo *payInfo = [notification object]; | ||
209 | + | ||
210 | + NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange); | ||
211 | + NSString *serverId = [payInfo serverId]; | ||
212 | + NSString *roleName = [payInfo playerName]; | ||
213 | + NSString *queryId = [payInfo queryId]; | ||
214 | + | ||
215 | + dispatch_async(dispatch_get_global_queue(0, 0), ^{ | ||
216 | + [self handlerLeakOrder]; | ||
217 | + }); | ||
218 | + | ||
219 | + NSString *isOpenThirdPay = [payInfo isOpenThirdPay]; | ||
220 | + NSLog(@"custom%@",[payInfo custom]); | ||
221 | + if([isOpenThirdPay isEqualToString:@"false"]){ | ||
222 | + NSString* products = [payInfo products]; | ||
223 | + //NSLog(@"products:%@",products); | ||
224 | + [[YouaiSDKMgr getInstance] openApplePay:self.controller products:products amount:[payInfo postAmount] queryId:queryId]; | ||
225 | + }else{ | ||
226 | + [[YouaiSDKMgr getInstance] openPay:serverId :roleName :amount :[payInfo queryId] :self.controller]; | ||
227 | + } | ||
228 | + | ||
229 | + int64_t delayInSeconds = 5.0; // 延迟的时间 | ||
230 | + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); | ||
231 | + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ | ||
232 | + NSLog(@"chage state"); | ||
233 | + [[PoolChecker getInstance] setOnlyOneTimePay:false]; | ||
234 | + }); | ||
235 | +} | ||
236 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// IapController.h | ||
3 | +// mangosanguo | ||
4 | +// | ||
5 | +// Created by Gino on 12-11-6. | ||
6 | +// Copyright (c) 2012年 private. All rights reserved. | ||
7 | +// | ||
8 | +#if applepay | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | +#import "StoreKit/StoreKit.h" | ||
11 | + | ||
12 | +@interface IapController : NSObject<SKProductsRequestDelegate,SKPaymentTransactionObserver> | ||
13 | +{ | ||
14 | + bool isRequestedBuy; | ||
15 | + SKPaymentTransaction *PayTransaction; | ||
16 | + | ||
17 | + NSMutableArray *payArray; | ||
18 | + SKPaymentTransaction *curTransaction; | ||
19 | +} | ||
20 | + | ||
21 | ++ (IapController *)sharedController; | ||
22 | +- (id)init; | ||
23 | +- (void)removeIt; | ||
24 | +- (void)requestProductData; | ||
25 | +- (void)requestBuyProduct:(NSString *)identifier; | ||
26 | + | ||
27 | +- (void)requestProductInfoById:(NSString *)str; | ||
28 | +- (void)comfireTransactions:(bool)isSuessPosted; | ||
29 | +- (void)checkReceiptIsFail; | ||
30 | + | ||
31 | +- (void)addItemToPayArray:(SKPaymentTransaction *)transaction; | ||
32 | +- (bool)checkPayArrayIsEmpty; | ||
33 | +- (void)checkReceiptForArray; | ||
34 | + | ||
35 | +- (void)setAppleCallBack: (NSString*)url; | ||
36 | +@end | ||
37 | +#endif | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// YouaiLoginInfo.h | ||
3 | +// YouaiSDK | ||
4 | +// | ||
5 | +// Created by 莫 东荣 on 13-4-10. | ||
6 | +// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | + | ||
11 | +@interface YouaiLoginInfo : NSObject //用户uid | ||
12 | +{ | ||
13 | +// | ||
14 | +NSString *openId; | ||
15 | +//token | ||
16 | +NSString *token; | ||
17 | +//时间戳 | ||
18 | +NSString *timestamp; | ||
19 | + | ||
20 | +} | ||
21 | + | ||
22 | +@property(retain,nonatomic) NSString *openId; | ||
23 | +@property(retain,nonatomic) NSString *token; | ||
24 | +@property(retain,nonatomic) NSString *timestamp; | ||
25 | ++ (YouaiLoginInfo *)getInstance; | ||
26 | +@end | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +// | ||
2 | +// YouaiNotifications.h | ||
3 | +// YouaiSDK | ||
4 | +// | ||
5 | +// Created by 莫 东荣 on 13-4-10. | ||
6 | +// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <Foundation/Foundation.h> | ||
10 | + | ||
11 | +extern NSString * const youaiExitNotification; /**< 退出 */ | ||
12 | +extern NSString * const youaiLoginNotification; /**< 登录完成的通知*/ | ||
13 | +extern NSString * const youaiPaytNotification; /**< 支付通知 */ | ||
14 | +extern NSString * const youaiShareNotification; /**< 分享通知 */ | ||
15 | +extern NSString * const youaiCenterNotification; /**< 用户中心通知 */ | ||
16 | +extern NSString * const youaiErrorNotification; /**< 出错 */ | ||
17 | + | ||
18 | + | ||
19 | +@interface YouaiNotifications : NSObject | ||
20 | + | ||
21 | +@end |
1 | +// | ||
2 | +// YouaiSDKMgr.h | ||
3 | +// YouaiSDK | ||
4 | +// | ||
5 | +// Created by 莫 东荣 on 13-4-9. | ||
6 | +// Copyright (c) 2013年 莫 东荣. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <UIKit/UIKit.h> | ||
10 | +#import "StoreKit/StoreKit.h" | ||
11 | + | ||
12 | +@interface YouaiSDKMgr : NSObject | ||
13 | +{ | ||
14 | + NSString* appId_; | ||
15 | + NSString* appKey_; | ||
16 | + | ||
17 | + NSString* inviterCode_; | ||
18 | + | ||
19 | +// NSString* openId; | ||
20 | +// NSString* loginKey; | ||
21 | +} | ||
22 | + | ||
23 | ++ (YouaiSDKMgr *)getInstance; | ||
24 | +- (void)initSDK; | ||
25 | +- (void)initSDK:(NSString *)weixinId; | ||
26 | + | ||
27 | +- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller; | ||
28 | +- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *) inviterCode; | ||
29 | +- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *) inviterCode : (NSString *)userName : (NSString *)passWord; | ||
30 | +- (void)setStyleName:(NSString*)styleName; | ||
31 | +- (void)openLogin:(NSString *)appId : (NSString *)appKey : (UIViewController *)controller : (NSString *)userName : (NSString *)passWord; | ||
32 | + | ||
33 | +- (void)openCenter: (UIViewController *)controller; | ||
34 | +- (void)openPay: (NSString *)serverId : (NSString *)nickName : (NSString *)callBack : (UIViewController *)controller; | ||
35 | +- (void)openPay: (NSString *)serverId : (NSString *)nickName : (NSNumber *)payAmount : (NSString *)callBack : (UIViewController *)controller; | ||
36 | +- (void)openShare: (UIViewController *)controller; | ||
37 | +- (void)log: (NSString*)log_key : (NSInteger)log_data: (NSString*)log_remark; | ||
38 | + | ||
39 | +- (void)openApplePay:(UIViewController*)controll products:(NSString*)products amount:(NSString*)amount queryId:(NSString*) queryId; | ||
40 | + | ||
41 | + | ||
42 | +- (void)checkAilpay: (NSURL *)url : (UIViewController *)controller; | ||
43 | + | ||
44 | +- (void)applePayCallBack:(NSString *)url :(SKPaymentTransaction *)transaction :(NSString *)resultStr; | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | +@end |
1 | +// | ||
2 | +// YouaiViewController.h | ||
3 | +// newYouaiSDK | ||
4 | +// | ||
5 | +// Created by Mog90 on 14-9-28. | ||
6 | +// Copyright (c) 2014年 东荣 莫. All rights reserved. | ||
7 | +// | ||
8 | + | ||
9 | +#import <UIKit/UIKit.h> | ||
10 | +#import "YouaiLoginInfo.h" | ||
11 | + | ||
12 | +@interface YouaiViewController : UIViewController<UIWebViewDelegate,UIAlertViewDelegate> | ||
13 | +{ | ||
14 | + UIWebView *webView_; | ||
15 | + UIActivityIndicatorView *activityIndicator; | ||
16 | +} | ||
17 | + | ||
18 | + | ||
19 | +//@property(assign) int webViewWidth; | ||
20 | +//@property(assign) int webViewHeight; | ||
21 | +//@property(assign) int screenwidth; | ||
22 | +//@property(assign) int screenHeight; | ||
23 | + | ||
24 | +@property(assign) BOOL hasCorner; | ||
25 | + | ||
26 | +-(void)setView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight; | ||
27 | +- (void)initWebView; | ||
28 | +- (void)loadWebPageWithString:(NSString *)url; | ||
29 | +- (void)loadWebPageWithJs:(NSString *)content; | ||
30 | +- (void)postNotification:(NSString *)name : (NSString *)code; | ||
31 | +- (void)receiveIap:(NSNotification *)notification; | ||
32 | + | ||
33 | +@end |
1 | +{ | ||
2 | +"APP_ID": "58fd78a9834e7246b8dc0eac", | ||
3 | +"APP_KEY":"b06b86b79c25774ec758657a7203bae6", | ||
4 | +"renyunAppKey":"7ca554a6f94f5477c6592f4e484bb49d", | ||
5 | + | ||
6 | +"appScheme": "com.qyj.ios.xw", | ||
7 | + | ||
8 | +"gameSimpleName": "fytx_test", | ||
9 | +"sdkSimpleName": "apple_youyu", | ||
10 | +"sdkVersionCode":"V1_0", | ||
11 | + | ||
12 | +"gamechannelid": "123456", | ||
13 | +"custom": "", | ||
14 | +"c2": "", | ||
15 | +"c1": "", | ||
16 | +"loginCheckUrl": "https://public.sdk.gzyouai.com/logincheck/check/", | ||
17 | +"payorderurl": "https://public.sdk.gzyouai.com/paycheck/create", | ||
18 | +"paycheckurl": "https://public.sdk.gzyouai.com/paycheck/confirm" | ||
19 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +import shutil | ||
2 | +import os | ||
3 | +import plistlib | ||
4 | + | ||
5 | +import config | ||
6 | +import json | ||
7 | +import packageProj | ||
8 | + | ||
9 | +from mod_pbxproj import XcodeProject | ||
10 | + | ||
11 | + | ||
12 | +gameProjName = config.gameProjName | ||
13 | +#copy dir xcodeproj | ||
14 | +copyNewDirName = gameProjName + '_youdian.xcodeproj' | ||
15 | +currentPath = os.path.abspath('.') | ||
16 | +currentPath += '/' + copyNewDirName | ||
17 | + | ||
18 | + | ||
19 | +if os.path.exists(currentPath): | ||
20 | + shutil.rmtree(currentPath) | ||
21 | + | ||
22 | +shutil.copytree(gameProjName + '.xcodeproj',currentPath) | ||
23 | + | ||
24 | +project = XcodeProject.Load(copyNewDirName + '/project.pbxproj') | ||
25 | + | ||
26 | +project.add_other_ldflags('-ObjC') | ||
27 | +#frameworks = project.add_folder('poolsdk_file/poolsdk_itools') | ||
28 | +#print(frameworks); | ||
29 | +#add search path | ||
30 | + | ||
31 | +channelRootPath = config.channelRootPath#'poolsdk_file' | ||
32 | + | ||
33 | +frameworksPath = '$(PROJECT_DIR)/' + channelRootPath + '/poolsdk_youdian/SDK' | ||
34 | +print(frameworksPath); | ||
35 | +#add header search path | ||
36 | +project.add_header_search_paths(frameworksPath, recursive=False) | ||
37 | +#add framework search path | ||
38 | +project.add_framework_search_paths(frameworksPath, recursive=False) | ||
39 | +#add library search path | ||
40 | +project.add_library_search_paths(frameworksPath, recursive=False) | ||
41 | + | ||
42 | +#add poolsdk_xy dir all file into project | ||
43 | +project.remove_group_by_name('poolsdk') | ||
44 | +frameworkRelativePath = project.add_folder(channelRootPath + '/poolsdk_youdian/SDK') | ||
45 | + | ||
46 | +#ignore_unknown_type | ||
47 | +project.add_file_if_doesnt_exist('pool_setting',parent=frameworkRelativePath, weak=True,ignore_unknown_type=True) | ||
48 | + | ||
49 | + | ||
50 | +systemFrameworks = project.get_or_create_group('Frameworks') | ||
51 | +#add system framework | ||
52 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/MobileCoreServices.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
53 | +project.add_file_if_doesnt_exist('System/Library/Frameworks/WebKit.framework',parent=systemFrameworks, weak=True, tree='SDKROOT') | ||
54 | + | ||
55 | +#add system dylib | ||
56 | +systemLibs = project.get_or_create_group('Libraries') | ||
57 | +project.add_file_if_doesnt_exist('/usr/lib/libz.1.dylib',parent=systemLibs, weak=True, tree='<absolute>') | ||
58 | + | ||
59 | +#modify info.plist reference path | ||
60 | +project.add_single_valued_flag('INFOPLIST_FILE',channelRootPath + '/poolsdk_youdian/Info.plist') | ||
61 | + | ||
62 | +project.add_single_valued_flag('ENABLE_BITCODE', 'NO') | ||
63 | + | ||
64 | +readInfoPlistFilePath = channelRootPath + '/poolsdk/Info.plist' | ||
65 | +writeInfoFilePath = channelRootPath + '/poolsdk_youdian/Info.plist' | ||
66 | +infoContent = plistlib.readPlist(readInfoPlistFilePath) | ||
67 | + | ||
68 | +xyInfoPath = channelRootPath + '/poolsdk_youdian/Info_youdian.plist' | ||
69 | +xyInfoContent = plistlib.readPlist(xyInfoPath) | ||
70 | + | ||
71 | +#read pool_setting file | ||
72 | +settingFile = open(channelRootPath + '/poolsdk_youdian/SDK/pool_setting','rw') | ||
73 | +try: | ||
74 | + settingFileContent = settingFile.read( ) | ||
75 | +finally: | ||
76 | + settingFile.close( ) | ||
77 | +#json op | ||
78 | +jsonStr = json.loads(settingFileContent) | ||
79 | + | ||
80 | +#modify bundle id | ||
81 | +project.add_single_valued_flag('PRODUCT_BUNDLE_IDENTIFIER',jsonStr["appScheme"]) | ||
82 | + | ||
83 | +#update and add info.plist content | ||
84 | +infoContent.update(xyInfoContent) | ||
85 | +#write | ||
86 | +plistlib.writePlist(infoContent,writeInfoFilePath) | ||
87 | + | ||
88 | +project.save() | ||
89 | + | ||
90 | + | ||
91 | +packageProj.buildProjName = gameProjName + '_youdian' | ||
92 | +packageProj.targetName = gameProjName | ||
93 | +packageProj.buildProj() |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | +<plist version="1.0"> | ||
4 | +<dict> | ||
5 | + <key>NSAppTransportSecurity</key> | ||
6 | + <dict> | ||
7 | + <key>NSAllowsArbitraryLoads</key> | ||
8 | + <true/> | ||
9 | + </dict> | ||
10 | +</dict> | ||
11 | +</plist> |

4.93 KB

1.81 KB

3.63 KB

3.82 KB

1.61 KB

3.09 KB

2.57 KB

6.25 KB

6.3 KB

2.59 KB

2.76 KB

1.28 KB

1.52 KB

1.45 KB

2.55 KB

4.94 KB

4.38 KB

6.16 KB

1.65 KB

1.56 KB

2.76 KB

2.42 KB

1.21 KB

8.92 KB

8.31 KB

6.25 KB

19 KB

19.8 KB

17.4 KB

2.46 KB

2.61 KB

2.49 KB

2.46 KB

1.14 KB

1.16 KB

1.26 KB

1.46 KB

1.52 KB

1.56 KB

1.49 KB

1.59 KB

1.61 KB

1.63 KB

1.74 KB

1.59 KB

8.4 KB

4.65 KB

1.58 KB

938 Bytes

1.62 KB

7.68 KB

23.1 KB

9.42 KB

8.45 KB

2.13 KB

2.18 KB

2.83 KB

3.79 KB

3.76 KB

2.94 KB

2.01 KB

1.85 KB

2.73 KB

2.89 KB

5.28 KB

3.15 KB

5.3 KB

5.21 KB

5.31 KB

1.57 KB

3.94 KB

4.25 KB

8.89 KB

5.58 KB

3.04 KB

3.42 KB

3.63 KB

7.03 KB

22.5 KB

7.06 KB

1.52 KB

1.56 KB

1.48 KB

1.1 KB

3.1 KB

3.73 KB

4.08 KB

2.51 KB

8.17 KB

3.61 KB

9.62 KB

9.8 KB

4.46 KB

8.65 KB

8.81 KB

3.76 KB

3.93 KB

1.6 KB

1.72 KB

1.87 KB

3.36 KB

3.42 KB

2.47 KB

4.23 KB

2.22 KB

3.36 KB

8.01 KB

14.8 KB

1.14 KB

1.69 KB

1.59 KB

1.19 KB

1.32 KB

1.14 KB

497 Bytes

4.87 KB

4.87 KB

7.97 KB

1.31 KB

3.26 KB

1.33 KB

1.61 KB

1.36 KB

3.16 KB

1.65 KB

2.05 KB

9.18 KB

33.1 KB

396 Bytes

557 Bytes

588 Bytes

922 Bytes

1.45 KB

2.18 KB

513 Bytes

771 Bytes

524 Bytes

793 Bytes

6.88 KB

10.6 KB

1.72 KB
-
Please register or login to post a comment