lizhihui

海南游爱 iOS SDK

Showing 141 changed files with 2593 additions and 0 deletions
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Workspace
3 + version = "1.0">
4 + <FileRef
5 + location = "self:Demo.xcodeproj">
6 + </FileRef>
7 +</Workspace>
1 +{
2 + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "D1584AEF25B5C21395F515B62C90B71E0ACB26B2",
3 + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
4 + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : {
5 +
6 + }
7 + },
8 + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
9 + "D1584AEF25B5C21395F515B62C90B71E0ACB26B2" : 0,
10 + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : 0
11 + },
12 + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "8119CC7B-EDC1-4646-9378-8ECAC2EEB94B",
13 + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
14 + "D1584AEF25B5C21395F515B62C90B71E0ACB26B2" : "public_sdk_ios\/",
15 + "5b13317c-0110-4367-8746-06bc6aadd3cd++2397" : "youai_foolsdk_ios\/"
16 + },
17 + "DVTSourceControlWorkspaceBlueprintNameKey" : "Demo",
18 + "DVTSourceControlWorkspaceBlueprintVersion" : 204,
19 + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "PoolSdk_Demo\/Demo.xcodeproj",
20 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
21 + {
22 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "svn:\/\/10.21.210.99",
23 + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
24 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5b13317c-0110-4367-8746-06bc6aadd3cd++2397"
25 + },
26 + {
27 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "ssh:\/\/106.75.192.252:10022\/public_service\/public_sdk_ios.git",
28 + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
29 + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D1584AEF25B5C21395F515B62C90B71E0ACB26B2"
30 + }
31 + ]
32 +}
...\ 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>IDEDidComputeMac32BitWarning</key>
6 + <true/>
7 +</dict>
8 +</plist>
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 +<array/>
5 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Bucket
3 + type = "1"
4 + version = "2.0">
5 +</Bucket>
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 +</dict>
14 +</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 = "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>
No preview for this file type
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 <HaiBaoJuheSDK/HaiBaoJuheSDK2.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 + NSLog(@"didFinishLaunchingWithOptions");
22 +
23 +
24 + [[HaiBaoJuheSDK shareSDK]application:application didFinishLaunchingWithOptions:launchOptions];
25 + return YES;
26 +}
27 +
28 +- (void)applicationWillResignActive:(UIApplication *)application {
29 + // 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.
30 + // 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.
31 + [[HaiBaoJuheSDK shareSDK]applicationWillResignActive:application];
32 +}
33 +
34 +- (void)applicationDidEnterBackground:(UIApplication *)application {
35 + // 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.
36 + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
37 + [[HaiBaoJuheSDK shareSDK]applicationDidEnterBackground:application];
38 +}
39 +
40 +
41 +
42 +- (void)applicationDidBecomeActive:(UIApplication *)application {
43 + // 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.
44 + [[HaiBaoJuheSDK shareSDK]applicationDidBecomeActive:application];
45 +}
46 +
47 +- (void)applicationWillTerminate:(UIApplication *)application {
48 + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
49 +}
50 +
51 +- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
52 + NSLog(@"hanldeOpenURL%@",url.path );
53 + [[HaiBaoJuheSDK shareSDK] handleOpenurl:url];
54 + return true;
55 +}
56 +
57 +-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options
58 +{
59 + [[HaiBaoJuheSDK shareSDK]application:app openURL:url options:options];
60 + return YES;
61 +}
62 +
63 +-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
64 +{
65 + [[HaiBaoJuheSDK shareSDK] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
66 + return YES;
67 +}
68 +
69 +- (void)applicationWillEnterForeground:(UIApplication *)application {
70 + // 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.
71 + [[HaiBaoJuheSDK shareSDK] applicationWillEnterForeground:application];
72 +}
73 +
74 +
75 +@end
No preview for this file type
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
3 + <device id="retina4_7" orientation="portrait">
4 + <adaptation id="fullscreen"/>
5 + </device>
6 + <dependencies>
7 + <deployment identifier="iOS"/>
8 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
9 + <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
10 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
11 + </dependencies>
12 + <objects>
13 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
14 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
15 + <view contentMode="scaleToFill" id="iN0-l3-epB">
16 + <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
17 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18 + <subviews>
19 + <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">
20 + <rect key="frame" x="20" y="439" width="441" height="21"/>
21 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
22 + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
23 + <nil key="highlightedColor"/>
24 + </label>
25 + <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">
26 + <rect key="frame" x="20" y="140" width="441" height="43"/>
27 + <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
28 + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
29 + <nil key="highlightedColor"/>
30 + </label>
31 + </subviews>
32 + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
33 + <constraints>
34 + <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
35 + <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
36 + <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
37 + <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
38 + <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
39 + <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
40 + </constraints>
41 + <nil key="simulatedStatusBarMetrics"/>
42 + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
43 + <point key="canvasLocation" x="548" y="455"/>
44 + </view>
45 + </objects>
46 +</document>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
3 + <device id="retina4_7" orientation="portrait">
4 + <adaptation id="fullscreen"/>
5 + </device>
6 + <dependencies>
7 + <deployment identifier="iOS"/>
8 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
9 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 + </dependencies>
11 + <scenes>
12 + <!--Main View Controller-->
13 + <scene sceneID="ufC-wZ-h7g">
14 + <objects>
15 + <viewController id="vXZ-lx-hvc" customClass="MainViewController" sceneMemberID="viewController">
16 + <layoutGuides>
17 + <viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
18 + <viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
19 + </layoutGuides>
20 + <view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
21 + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
22 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
23 + <subviews>
24 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GQW-et-jRb">
25 + <rect key="frame" x="44" y="85" width="208" height="30"/>
26 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
27 + <state key="normal" title="初始化"/>
28 + <connections>
29 + <action selector="actionInit:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Srh-bu-gYD"/>
30 + </connections>
31 + </button>
32 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s0O-FE-ge8">
33 + <rect key="frame" x="61" y="123" width="175" height="30"/>
34 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
35 + <state key="normal" title="登录"/>
36 + <connections>
37 + <action selector="actionLogin:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="381-gB-ImA"/>
38 + </connections>
39 + </button>
40 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JQY-uO-q36">
41 + <rect key="frame" x="53" y="166" width="191" height="30"/>
42 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
43 + <state key="normal" title="充值"/>
44 + <connections>
45 + <action selector="actionPay:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="bvf-M4-rqy"/>
46 + </connections>
47 + </button>
48 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5na-1c-IlO">
49 + <rect key="frame" x="357" y="85" width="100" height="30"/>
50 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
51 + <state key="normal" title="数据"/>
52 + <connections>
53 + <action selector="actionSubmitRoleData:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="aNf-Iw-unv"/>
54 + </connections>
55 + </button>
56 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jcX-L1-JB6">
57 + <rect key="frame" x="377" y="166" width="60" height="30"/>
58 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
59 + <state key="normal" title="切换账号"/>
60 + <connections>
61 + <action selector="actionSwitchAccount:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="miU-Hm-8cm"/>
62 + </connections>
63 + </button>
64 + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Q9b-py-Nk0">
65 + <rect key="frame" x="340" y="123" width="134" height="30"/>
66 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
67 + <state key="normal" title="注销"/>
68 + <connections>
69 + <action selector="actionLogout:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="t6e-7P-tJU"/>
70 + </connections>
71 + </button>
72 + </subviews>
73 + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
74 + </view>
75 + </viewController>
76 + <placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
77 + </objects>
78 + <point key="canvasLocation" x="445" y="282"/>
79 + </scene>
80 + </scenes>
81 +</document>
1 +#import <Foundation/Foundation.h>
2 +#import "HaiBaoJuheSDK/HaiBaoJuheLoginInfo.h"
3 +#import "HaiBaoJuheSDK/HaiBaoJuheNotification.h"
4 +#import "HaiBaoJuheSDK/HaiBaoJuheCreateOrderInfo.h"
5 +#import "HaiBaoJuheSDK/HaiBaoJuheGzyazfInfo.h"
6 +#import "HaiBaoJuheReportInfo.h"
7 +#import "HaiBaoJuheSDKDelegate.h"
8 +
9 +@interface HaiBaoJuheChecker : NSObject<HaiBaoJuheSDKDelegate>
10 +@property(nonatomic, strong)NSString *userId;
11 +@property(nonatomic, strong)id<HaiBaoJuheSDKDelegate> mHaiBaoJuheSDKDelegate;
12 +
13 +@property bool onlyOneTimeGzyazf;
14 ++ (HaiBaoJuheChecker *)getInstance;
15 +- (void)initChecker;
16 +- (void)startCheck:(HaiBaoJuheLoginInfo *)loginInfo;
17 +- (void) createOrder:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
18 +- (void) RailwayHaiBaoJuhereportOpen;
19 +- (void) RailwayHaiBaoJuhereportSDKOpen;
20 +- (void)RailwayHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
21 +- (void) reportEnter:(HaiBaoJuheReportInfo *)reInfo;
22 +- (void) RailwayHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
23 +- (void)sendNotice:(HaiBaoJuheSDKNotificationType)notiType
24 + notiName:(NSString *)notiName
25 + statusCode:(int)nCode
26 + description:(NSString *)szDescripton
27 + extendData:(NSObject *)extendData;
28 +
29 +- (void)startCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo;
30 +
31 +- (void)RailwayHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
32 +
33 +/*
34 + *初始化时调用
35 + */
36 +- (void)setHaiBaoJuheSDKDelegate:(nullable id<HaiBaoJuheSDKDelegate>)HaiBaoJuheSDKDeletate;
37 +@end
38 +
39 +
40 +
41 +
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HaiBaoJuheConfig : NSObject
4 +
5 +@property(nonatomic, strong)NSString *gameSimpleName;
6 +@property(nonatomic, strong)NSString *sdkSimpleName;
7 +@property(nonatomic, strong)NSString *sdkVersionCode;
8 +@property(nonatomic, strong)NSString *loginCheckUrl;
9 +@property(nonatomic, strong)NSString *gzyazfOrderUrl;
10 +@property(nonatomic, strong)NSString *gzyazfCheckUrl;
11 +@property(nonatomic, strong)NSString *c1;
12 +@property(nonatomic, strong)NSString *c2;
13 +@property(nonatomic, strong)NSString *custom;
14 +
15 ++ (HaiBaoJuheConfig *)getInstance;
16 +
17 +- (void) loadFile:(NSString *) fileName;
18 +
19 +- (NSString *)getValueByKey:(NSString *) key;
20 +
21 +- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
22 +
23 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheCreateOrderInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic,strong)NSString *serverId;//服务器ID
5 +@property(nonatomic, strong)NSString *serverName;//服务器名称
6 +@property(nonatomic, strong)NSString *playerId;//玩家ID
7 +@property(nonatomic, strong)NSString *playerName;//玩家名称
8 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
9 +@property(nonatomic, strong)NSString *postAmount;//金额
10 +@property(nonatomic, strong)NSString *productId;//产品ID
11 +@property(nonatomic, strong)NSString *productName;//产品名称
12 +@property(nonatomic, strong)NSString *productDesc;//产品描述
13 +@property(nonatomic, strong)NSString *custom;//透传参数
14 +@property(nonatomic, strong)NSString *exchange;//兑换比例
15 +@property(nonatomic, strong)NSString *otherInfo;//扩展参数
16 +@property(nonatomic, strong)NSString *userId;//用户ID
17 +@property(nonatomic, strong)NSString *timestamp;//时间戳
18 +
19 +- (NSString *) RailwayHaiBaoJuheGetTsign ;
20 +- (NSString *) RailwayHaiBaoJuheGetTimestamp ;
21 +
22 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheGzyazfInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic, strong)NSString *serverId;
5 +@property(nonatomic, strong)NSString *queryId;
6 +@property(nonatomic, strong)NSString *playerId;
7 +@property(nonatomic, strong)NSString *playerName;
8 +@property(nonatomic, strong)NSString *postAmount;
9 +@property(nonatomic, strong)NSString *productId;
10 +@property(nonatomic, strong)NSString *products;
11 +@property(nonatomic, strong)NSString *custom;
12 +@property(nonatomic, strong)NSString *postTime;
13 +@property(nonatomic, strong)NSString *other;
14 +
15 +//游戏传递过来的原值
16 +@property(nonatomic, strong)NSString *serverName;//服务器名称
17 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
18 +@property(nonatomic, strong)NSString *productName;//产品名称
19 +@property(nonatomic, strong)NSString *productDesc;//产品描述
20 +@property(nonatomic, strong)NSString *exchange;//兑换比例
21 +
22 +@end
1 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
2 +@interface HaiBaoJuheLoginInfo : RailwayHaiBaoJuheBaseModel
3 +
4 +@property(nonatomic,strong)NSString *timestamp;
5 +@property(nonatomic, strong)NSString *sign;
6 +@property(nonatomic, strong)NSString *other;
7 +@property(nonatomic, strong)NSString *openId;
8 +@property(nonatomic, strong)NSString *userType;
9 +
10 +
11 +@end
1 +//
2 +// HaiBaoJuheNotification.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 HaiBaoJuheSDK_Notification; /**< */
12 +extern NSString * const _create_order_notification; /**< */
13 +
14 +
15 +/**
16 + 应用支持的方向
17 + */
18 +typedef NS_ENUM(int, HaiBaoJuheSDKNotificationType) {
19 + HaiBaoJuheSDKNotificationLogin = 1,//登录
20 + HaiBaoJuheSDKNotificationLogout,//注销
21 + HaiBaoJuheSDKNotificationGzyazf,//支付完成
22 + HaiBaoJuheSDKNotificationPause,//暂停退出
23 + HaiBaoJuheSDKNotificationRole,//创建角色
24 + HaiBaoJuheSDKNotificationInitSDK,//初始化SDK
25 + HaiBaoJuheSDKNotificationSwitchAccount,//切换账号
26 + HaiBaoJuheSDKNotificationExit//退出游戏
27 +};
28 +
29 +
30 +
31 +@interface HaiBaoJuheNotification : NSObject
32 +
33 +@end
34 +
35 +
36 +//////////////////////////////////////////////////////////////////////
37 +@interface HaiBaoJuheSDKResult : NSObject
38 +@property(nonatomic, assign)int statusCode;//请参照此文件下面状态标识
39 +@property(nonatomic, strong)NSString *resultDescription;
40 +@property(nonatomic, strong)NSObject *extendData;
41 +//V1.2.0新增
42 +@property(nonatomic, assign)HaiBaoJuheSDKNotificationType notiType;//消息类型
43 +@property(nonatomic, strong)NSString *notiName;//消息名称
44 +@end
45 +//////////////////////////////////////////////////////////////////////
46 +
47 +//////////////////////////////////////////////////////////////////////
48 +/* 状态标识 */
49 +#define HaiBaoJuheSDK_NO_ERROR 0 /*操作成功*/
50 +
51 +#define HaiBaoJuheSDK_ERROR_LOGIN_FAILED -100 /*登录失败*/
52 +#define HaiBaoJuheSDK_ERROR_LOGIN_CANCEL -101 /*登录取消*/
53 +#define HaiBaoJuheSDK_ERROR_LOGIN_GAMGEACCOUNT -102 /*游戏帐号登录,非平台账号*/
54 +
55 +#define HaiBaoJuheSDK_ERROR_PAY_FAILED -200 /*支付失败*/
56 +#define HaiBaoJuheSDK_ERROR_PAY_CANCEL -201 /*支付取消*/
57 +#define HaiBaoJuheSDK_ERROR_PAY_VERSIGN -202 /*支付验签失败*/
58 +#define HaiBaoJuheSDK_ERROR_CREATE_ORDER_FAILED -203 /*支付验签失败*/
59 +
60 +#define HaiBaoJuheSDK_ERROR_ROLE_CREATE_FAILED -300 /*角色创建失败*/
61 +
62 +#define HaiBaoJuheSDK_ERROR_INIT_FAILED -400 /*初始化失败*/
63 +
64 +#define HaiBaoJuheSDK_ERROR_SWICHT_ACCOUNT_FAILED -500 /*切换账号失败*/
65 +
66 +#define HaiBaoJuheSDK_ERROR_EXIT_CANCEL -600 /*退出取消*/
67 +
68 +//////////////////////////////////////////////////////////////////////
1 +//
2 +// RailwayHaiBaoJuheReportInfo.h
3 +// HaiBaoJuheSDK
4 +//
5 +// Created by winFan on 12/21/15.
6 +// Copyright (c) 2015 winFan. All rights reserved.
7 +//
8 +
9 +#import "HaiBaoJuheSDK/RailwayHaiBaoJuheBaseModel.h"
10 +@interface HaiBaoJuheReportInfo : RailwayHaiBaoJuheBaseModel
11 +
12 +@property(nonatomic, strong)NSString *reportType;//类型
13 +@property(nonatomic, strong)NSString *playerId;//玩家ID
14 +@property(nonatomic, strong)NSString *playerName;//玩家名称
15 +@property(nonatomic, strong)NSString *playerLevel;//玩家等级
16 +@property(nonatomic, strong)NSString *roleSex;//角色性别(1男0女)
17 +
18 +@property(nonatomic, strong)NSString *serverId;//服务器ID
19 +@property(nonatomic, strong)NSString *serverName;//服务器名称
20 +@property(nonatomic, strong)NSNumber *roleCTime;//创建角色时间(秒)
21 +@property(nonatomic, strong)NSString *partyName;//工会名称
22 +@property(nonatomic, strong)NSString *roleType;//角色类型
23 +@property(nonatomic, strong)NSNumber *roleChangeTime;//角色等级更新时间(秒)
24 +@property(nonatomic, strong)NSString *vipLevel;//vip等级
25 +@property(nonatomic, strong)NSNumber *diamond;//余额
26 +@property(nonatomic, strong)NSString *moneyType;//商品单位(元宝,金币)
27 +
28 +@property(nonatomic, strong)NSString *custom;//透传参数
29 +
30 +
31 +@property(nonatomic, strong)NSString *openId;
32 +
33 +#define REPORT_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/statistic"
34 +
35 +#define REPORT_IDFA_URL @"https://statistic.public.sdk.haibaoyouxi.com/sdk/last_channel?idfa=%@&sdkSimpleName=%@&gameSimpleName=%@"
36 +
37 +#define REPORT_OPEN @"open"
38 +#define REPORT_ENTER @"enter"
39 +#define REPORT_CREATEROLE @"createrole"
40 +#define REPORT_ROLEUPGRADE @"roleupgrade"
41 +#define REPORT_SDK_OPEN @"opensdk"
42 +#define REPORT_EXIT @"exit"
43 +#define REPORT_SELECT_SERVER @"selectserver"
44 +
45 +@end
1 +#import <Foundation/Foundation.h>
2 +#import "HaiBaoJuheSDK2.h"
3 +
4 +#import <UIKit/UIKit.h>
5 +
6 +@interface HaiBaoJuheSDK : NSObject
7 +
8 +@property(nonatomic, strong, readonly)NSString *sdkVersion;
9 +
10 +
11 +@property(nonatomic, strong)NSString *urlSchemes;
12 +
13 +@property BOOL isAppleGzyazfing;
14 +
15 ++ (HaiBaoJuheSDK *)shareSDK;
16 +
17 +
18 +- (void)initSDK:(UIViewController *) control;
19 +
20 +
21 +-(void)viewDidAppear;
22 +
23 +- (void)setViewController:(UIViewController *)viewController;
24 +
25 +
26 +- (void)loginSDK;
27 +
28 +- (void)loginSDK:(UIViewController *)viewController;
29 +
30 +
31 +- (void)gzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
32 +
33 +
34 +- (BOOL)hasUserCenter;
35 +
36 +
37 +- (void)gotoUserCenter;
38 +
39 +
40 +- (void)reportSDK:(HaiBaoJuheReportInfo *)reportInfo;
41 +
42 +
43 +- (BOOL)hasLogout;
44 +
45 +
46 +- (void)logoutSDK;
47 +
48 +
49 +- (BOOL)hasSwitchAccount;
50 +
51 +
52 +- (void)switchAccount;
53 +
54 +
55 +- (BOOL)hasExit;
56 +
57 +
58 +- (void)exitSDK;
59 +
60 +- (void)destroySDK;
61 +
62 +@property(nonatomic, assign)ESDKOrientation sdkOrientation;
63 +
64 +@property(nonatomic, assign)BOOL bShowedFloat;
65 +
66 +
67 +@property(nonatomic, assign)int serverId;
68 +
69 +
70 +-(NSString *) getGameChannelId;
71 +
72 +- (NSString *) getCustomValue;
73 +
74 +- (NSString *) getChannelParameter1;
75 +
76 +- (NSString *) getChannelParameter2;
77 +
78 +-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray*)customArray;
79 +
80 +
81 +- (void)handleOpenurl:(NSURL *)url;
82 +
83 +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
84 +
85 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
86 +
87 +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
88 +
89 +
90 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
91 +
92 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
93 +
94 +
95 +- (void)applicationDidEnterBackground:(UIApplication *)application;
96 +
97 +- (void)applicationDidBecomeActive:(UIApplication *)application;
98 +
99 +- (void)applicationWillEnterForeground:(UIApplication *)application;
100 +
101 +- (void)applicationWillResignActive:(UIApplication *)application;
102 +
103 +-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
104 +
105 +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
106 +
107 +@end
1 +#import <UIKit/UIKit.h>
2 +#import "HaiBaoJuheChecker.h"
3 +#import "HaiBaoJuheReportInfo.h"
4 +#import "HaiBaoJuheLoginInfo.h"
5 +#import "Interface.h"
6 +#import "HaiBaoJuheNotification.h"
7 +#import "HaiBaoJuheGzyazfInfo.h"
8 +#import "UnionInterface.h"
9 +#import "HaiBaoJuheCreateOrderInfo.h"
10 +#import "HaiBaoJuheConfig.h"
11 +#import "HaiBaoJuheUtils.h"
12 +#import "NetCenter.h"
13 +#import "HaiBaoJuheSDK.h"
14 +#import "HaiBaoJuheSDKDelegate.h"
1 +#import <Foundation/Foundation.h>
2 +
3 +@protocol HaiBaoJuheSDKDelegate <NSObject>
4 +@optional
5 +-(void)HaiBaoJuheSDKLoginSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
6 +-(void)HaiBaoJuheSDKLoginFail:(NSString*)msg;
7 +
8 +-(void)HaiBaoJuheSDKSwitchAccountSuccess:(HaiBaoJuheLoginInfo*)loginInfo;
9 +-(void)HaiBaoJuheSDKSwitchAccountFail:(NSString*)msg;
10 +@end
1 +#import <Foundation/Foundation.h>
2 +#import <UIKit/UIKit.h>
3 +
4 +@interface HaiBaoJuheUtils : NSObject
5 +
6 ++(NSString *)md5:(NSString *)str;
7 ++ (NSDictionary *)RailwayHaiBaoJuheDictionaryWithJsonString:(NSString *)jsonString;
8 ++(NSString *)createGzyazfOrderUrl;
9 +//*充值回调地址
10 ++(NSString *)createGzyazfUrl;
11 +
12 ++(UIActivityIndicatorView *)showLoadingDialog:(UIView*)parentView;
13 ++(void)dismissLoadingDialog:(UIActivityIndicatorView*)indicatorView;
14 +
15 +@end
1 +//
2 +// Interface.h
3 +// HaiBaoJuheSDK
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>
13 +@property(nonatomic, strong)UIViewController *controller;
14 +
15 +
16 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface NetCenter : NSObject
4 +
5 +@property(nonatomic,retain) NSMutableData *receiveData;
6 +
7 +@property(nonatomic,assign)int dataPackSerialNo;
8 +
9 +
10 ++ (NetCenter *)getInstance;
11 +
12 +- (NSString *)httpGetSyn:(NSString *) getUrl;
13 +
14 +- (NSString *)httpPostSyn:(NSString *) postUrl : (NSDictionary *) postData;
15 +
16 +- (void)httpGetNoSyn;
17 +
18 +- (void)httpPostNoSyn:(NSString *) postUrl :(NSDictionary *)postDict;
19 +
20 +- (void)httpPostAsync:(NSString*)postUrl :(NSDictionary*)postDict;
21 +
22 +- (void)httpPostAsyncOpen:(NSString*)postUrl :(NSDictionary*)postDict;
23 +
24 +-(void)httpGetAsync:(NSString *)url completionHandler:(void (^ __nullable)(NSURLResponse* __nullable response, NSData* __nullable data, NSError* __nullable connectionError)) handler;
25 +
26 +- (NSString * __nullable)dicToString:(NSDictionary * __nullable) dict;
27 +@end
1 +#ifndef __HaiBaoJuheSDK__OtherSetting__
2 +#define __HaiBaoJuheSDK__OtherSetting__
3 +
4 +
5 +/**
6 + 应用支持的方向
7 + */
8 +typedef NS_ENUM(NSUInteger, ESDKOrientation) {
9 + ESDKOrientationPortrait = 1,//竖
10 + ESDKOrientationLandscape,//横
11 + ESDKOrientationNone//自动旋转
12 +};
13 +
14 +/**
15 + 应用支持的方向
16 + */
17 +typedef NS_ENUM(NSUInteger, REPORT_TYPE) {
18 + REPORT_TYPE_OPEN = 1,//竖
19 + REPORT_TYPE_ENTER,//横
20 + REPORT_TYPE_DEFINE//自动旋转
21 +};
22 +
23 +#endif /* defined(__HaiBaoJuheSDK__OtherSetting__) */
1 +#import <Foundation/Foundation.h>
2 +#import "OtherSetting.h"
3 +
4 +@interface RailwayHaiBaoJuheBaseModel : NSObject
5 +
6 +- (NSString *)RailwayHaiBaoJuheObjectToJsonString;
7 +- (NSMutableString *)paramAddToString;
8 +- (id)initWithDiction:(NSDictionary *)diction;
9 +
10 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +void DGLog(NSString *fmt, ...);
4 +
5 +typedef NS_ENUM(NSInteger, DGLoggerLevel)
6 +{
7 + ELogVerbose = 1,
8 + ELogDebug,
9 + ELogInfo,
10 + ELogWarn,
11 + ELogError
12 +};
13 +
14 +@interface RailwayHaiBaoJuheDGLogger : NSObject
15 +
16 ++ (void)showLog:(NSString *)fmt,...;
17 +
18 ++ (void)showLog:(DGLoggerLevel)level log:(NSString *)fmt,...;
19 +
20 ++ (void)isShowLog:(BOOL)flag;
21 +
22 +@end
1 +#define TRACK_VERSION @"1.0.1"
2 +#import <Foundation/Foundation.h>
3 +#import <UIKit/UIKit.h>
4 +
5 +NS_ASSUME_NONNULL_BEGIN
6 +@interface TrackingIO : NSObject
7 ++(void) setPrintLog :(BOOL)print;
8 ++ (void)initWithappKey:(NSString *)appKey withChannelId:(NSString *)channelId;
9 ++ (void)setRegisterWithAccountID:(NSString *)account;
10 ++ (void)setLoginWithAccountID:(NSString *)account;
11 ++(void)setGzyazfmentStart:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
12 ++(void)setGzyazfment:(NSString *)transactionId gzyazfmentType:(NSString*)gzyazfmentType currentType:(NSString*)currencyType currencyAmount:(float)currencyAmount;
13 ++(void)setEvent:(NSString *)eventName andExtra:(nullable NSDictionary *)extra;
14 ++(void)setProfile:(NSDictionary *)dataDic;
15 ++(NSString*)getDeviceId;
16 +@end
17 +NS_ASSUME_NONNULL_END
1 +#import <Foundation/Foundation.h>
2 +#import <UIKit/UIKit.h>
3 +#import "HaiBaoJuheSDK2.h"
4 +
5 +@protocol UnionInterface
6 +/**
7 + 初始化SDK
8 + */
9 +
10 +//[[PoolChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationGzyazf notiName:@"" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"" extendData:order_id];
11 +
12 +- (void)SDKinit:(UIViewController *) control;
13 +
14 +
15 +- (void)setViewController:(UIViewController *) viewController;
16 +
17 +/**
18 + 登录SDK
19 + */
20 +- (void)SDKloginSDK;
21 +
22 +
23 +- (void)SDKloginSDK:(UIViewController *) control;
24 +
25 +/**
26 + *是否含有注销接口
27 + */
28 +- (BOOL)hasLogout;
29 +
30 +/**
31 + 注销
32 + */
33 +- (void)SDKlogoutSDK;
34 +
35 +
36 +/**
37 + *是否含有退出接口
38 + **/
39 +- (BOOL)hasExit;
40 +
41 +/**
42 + 退出接口
43 + */
44 +- (void)SDKexitSDK;
45 +
46 +
47 +/**
48 + *SDK销毁操作(游戏退出时调用)
49 + */
50 +
51 +- (void)destroySDK;
52 +
53 +
54 +/**
55 + *是否含有用户中心接口
56 + **/
57 +- (BOOL)hasUserCenter;
58 +
59 +/**
60 + 用户中心
61 + */
62 +- (void)SDKgotoUserCenter;
63 +
64 +/**
65 + *是否含有切换账号接口
66 + **/
67 +- (BOOL)hasSwitchAccount;
68 +
69 +/**
70 + *切换账号
71 + **/
72 +- (void)switchAccount;
73 +
74 +
75 +- (void)viewDidAppear;
76 +
77 +/**
78 + 提交数据
79 + */
80 +- (void)SDKreport:(HaiBaoJuheReportInfo *) reportInfo;
81 +
82 +/**
83 + 进行支付
84 + */
85 +
86 +- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
87 +- (void)receiveCreateOrder: (NSNotification *)notification;
88 +
89 +/**
90 + *充值统计参数
91 + *accountId 账号ID,必填项, 和登陆、注册使用的accountId保持一致即可。
92 + *orderId 订单Id,必填项,请保证该值的全局唯一,系统会使用订单Id进行付费订单排重。
93 + *currencyAmount 货币金额,单位为元,支持小数
94 + *currencyType 货币类型
95 + *gzyazfType 支付类型(渠道)
96 + */
97 +-(void)gzyazfmentSuccess:(NSString*)accountId orderId:(NSString*)orderId currencyAmount:(double)amount currencyType:(NSString*)currencyType gzyazfType:(NSString*)gzyazfType custom:(NSArray *)customArray;
98 +
99 +- (void)handleOpenurl:(NSURL *)url;
100 +- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;
101 +
102 +
103 +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
104 +
105 +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
106 +
107 +//推送
108 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
109 +//推送
110 +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
111 +
112 +
113 +- (void)applicationDidEnterBackground:(UIApplication *)application;
114 +
115 +- (void)applicationDidBecomeActive:(UIApplication *)application;
116 +
117 +- (void)applicationWillEnterForeground:(UIApplication *)application;
118 +
119 +- (void)applicationWillResignActive:(UIApplication *)application;
120 +
121 +-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options;
122 +
123 +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
124 +@end
1 +framework module HaiBaoJuheSDK {
2 + umbrella header "HaiBaoJuheSDK.h"
3 +
4 + export *
5 + module * { export * }
6 +}
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.h
3 +// Demo_qiyu
4 +//
5 +// Created by 许 on 17/6/7.
6 +// Copyright © 2017年 winFan. All rights reserved.
7 +//
8 +
9 +#import <UIKit/UIKit.h>
10 +#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
11 +
12 +@interface MainViewController : UIViewController
13 +
14 +@end
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 <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
11 +
12 +@interface MainViewController ()
13 +
14 +@end
15 +
16 +NSString* sdkUserId = @"";
17 +
18 +@implementation MainViewController
19 +
20 +
21 +- (void)viewDidLoad {
22 + [super viewDidLoad];
23 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:HaiBaoJuheSDK_Notification object:nil];
24 + // Do any additional setup after loading the view.
25 + NSLog(@"viewDidLoad");
26 +}
27 +
28 +- (void)didReceiveMemoryWarning {
29 + [super didReceiveMemoryWarning];
30 + // Dispose of any resources that can be recreated.
31 +}
32 +
33 +/*
34 +#pragma mark - Navigation
35 +
36 +// In a storyboard-based application, you will often want to do a little preparation before navigation
37 +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
38 + // Get the new view controller using [segue destinationViewController].
39 + // Pass the selected object to the new view controller.
40 +}
41 +*/
42 +
43 +- (void)receiveSDKMessage:(NSNotification *)notification
44 +{
45 + HaiBaoJuheSDKResult *result = [notification object];
46 + if (result) {
47 + NSLog(@"notiType:%d",result.notiType);
48 + switch (result.notiType) {
49 +
50 + case HaiBaoJuheSDKNotificationInitSDK:
51 + {
52 + NSLog(@"sdk初始化成功");
53 + }
54 +
55 + break;
56 + case HaiBaoJuheSDKNotificationLogin:
57 + {
58 + NSLog(@"result state:%d",result.statusCode);
59 + if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
60 + HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
61 + sdkUserId = [loginInfo openId];
62 + NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
63 + NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
64 + NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
65 + NSLog(@"userType:%@",[loginInfo userType]);
66 + }else{
67 + NSLog(@"登录失败:%@",[result description]);
68 + }
69 + }
70 + break;
71 + case HaiBaoJuheSDKNotificationLogout:
72 + {
73 + NSLog(@"sdk注销成功,游戏处理");
74 + }
75 + break;
76 + case HaiBaoJuheSDKNotificationSwitchAccount:
77 + NSLog(@"切换账号通知");
78 + if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
79 + HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
80 + NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
81 + NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
82 + NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
83 + NSLog(@"userType:%@",[loginInfo userType]);
84 + }else{
85 + NSLog(@"%@",[result description]);
86 + }
87 + break;
88 + default:
89 + break;
90 + }
91 + }
92 +}
93 +
94 +- (IBAction)actionInit:(id)sender {
95 + [[HaiBaoJuheSDK shareSDK]initSDK:self];
96 +}
97 +- (IBAction)actionLogin:(id)sender {
98 + [[HaiBaoJuheSDK shareSDK] loginSDK];
99 +}
100 +
101 +- (IBAction)actionPay:(id)sender {
102 + HaiBaoJuheCreateOrderInfo *payInfo = [[HaiBaoJuheCreateOrderInfo alloc]init];
103 + [payInfo setServerId:@"99887766"];
104 + [payInfo setPlayerName:@"iamrolename"];
105 + [payInfo setPlayerLevel:@"10"];
106 + [payInfo setUserId:sdkUserId];
107 + [payInfo setPostAmount:@"1"];
108 + [payInfo setProductId:@"com.xiongdi.xunqinji.6"];
109 + [payInfo setPlayerId:@"1231241234"];
110 + [payInfo setProductName:@"com.xiongdi.xunqinji.6"];
111 + [payInfo setProductDesc:@"productDes"];
112 + [payInfo setTimestamp:@"1232134"];
113 + [payInfo setExchange:@"1"];
114 + [payInfo setServerName:@"servername"];
115 + [payInfo setCustom:@"custom"];
116 + [[HaiBaoJuheSDK shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
117 +}
118 +
119 +-(NSString*)getCurrentTimestamp{
120 + // 时间戳转时间
121 + NSTimeInterval interval = [[NSDate date] timeIntervalSince1970] * 1000;
122 + NSString* timeStr = [[NSString alloc]initWithFormat:@"%.f",interval];
123 + return timeStr;
124 +}
125 +
126 +/**
127 + serverid
128 + servername
129 + roleid
130 + rolename
131 + rolelevel
132 +*/
133 +- (IBAction)actionSubmitRoleData:(id)sender {
134 + NSLog(@"数据接口");
135 + HaiBaoJuheReportInfo *reportInfo = [[HaiBaoJuheReportInfo alloc]init];
136 + [reportInfo setReportType:REPORT_ENTER];
137 + //[reportInfo setReportType:REPORT_CREATEROLE];
138 + //[reportInfo setReportType:REPORT_ROLEUPGRADE]
139 + [reportInfo setServerId:@"28"];
140 + [reportInfo setServerName:@"serverName"];
141 + [reportInfo setPlayerId:@"1231241234"];
142 + [reportInfo setPlayerName:@"playName"];
143 + [reportInfo setPlayerLevel:@"10"];
144 + [reportInfo setPartyName:@"1345"];
145 + [reportInfo setRoleCTime:[[NSNumber alloc]initWithLong:[self getCurrentTimestamp].longLongValue]];
146 + [reportInfo setRoleChangeTime:[[NSNumber alloc]initWithLong:[self getCurrentTimestamp].longLongValue]];
147 + [[HaiBaoJuheSDK shareSDK] reportSDK:reportInfo];
148 +}
149 +
150 +- (IBAction)actionLogout:(id)sender {
151 + NSLog(@"注销");
152 + if ([[HaiBaoJuheSDK shareSDK] hasLogout]) {
153 + [[HaiBaoJuheSDK shareSDK] logoutSDK];
154 + }
155 +}
156 +
157 +- (IBAction)actionSwitchAccount:(id)sender {
158 + if([[HaiBaoJuheSDK shareSDK] hasSwitchAccount]){
159 + [[HaiBaoJuheSDK shareSDK] switchAccount];
160 + }
161 +}
162 +
163 +
164 +
165 +#pragma mark - 截屏
166 +- (void)screenShot:(UIView *)view{
167 + UIImage* image = nil;
168 + UIGraphicsBeginImageContext(view.bounds.size);
169 + [view.layer renderInContext:UIGraphicsGetCurrentContext()];
170 + image = UIGraphicsGetImageFromCurrentImageContext();
171 + UIGraphicsEndImageContext();
172 + UIGraphicsEndImageContext();
173 + if (image != nil) {
174 + NSLog(@"截图成功!");
175 + UIImageWriteToSavedPhotosAlbum(image,self,@selector(image:didFinishSavingWithError:contextInfo:),NULL);
176 + }
177 +}
178 +
179 +
180 +#pragma mark - 保存到相册
181 +-(void)image:(UIImage *)image didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo
182 +{
183 + if(!error){
184 + NSLog(@"存到相册");
185 + }else{
186 + NSLog(@"存储失败");
187 +
188 + }
189 +}
190 +
191 +//获取渠道参数
192 +-(void)getChannel{
193 + //获取channelId值
194 + [[HaiBaoJuheSDK shareSDK]getGameChannelId];
195 + //获取渠道参数1
196 + [[HaiBaoJuheSDK shareSDK]getChannelParameter1];
197 + //获取渠道参数2
198 + [[HaiBaoJuheSDK shareSDK]getChannelParameter2];
199 + //获取自定义参数
200 + [[HaiBaoJuheSDK shareSDK]getCustomValue];
201 +}
202 +
203 +
204 +@end
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 +#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
11 +@interface ViewController : UIViewController
12 +
13 +- (void)receiveSDKMessage : (NSNotification *)notification;
14 +
15 +@end
16 +
1 +
2 +#import "ViewController.h"
3 +
4 +@interface ViewController ()
5 +
6 +@end
7 +
8 +@implementation ViewController
9 +
10 +
11 +- (void)viewDidLoad {
12 + [super viewDidLoad];
13 + // Do any additional setup after loading the view, typically from a nib.
14 + UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
15 + [button1 setTitle:@"登陆" forState:UIControlStateNormal];
16 + button1.frame = CGRectMake(50.0f, 100.0f, 50.0f, 40.0f);
17 + button1.tag = 1;
18 + [button1 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
19 + [self.view addSubview:button1];
20 +
21 + UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
22 + [button2 setTitle:@"数据" forState:UIControlStateNormal];
23 + button2.frame = CGRectMake(150.0f, 100.0f, 50.0f, 40.0f);
24 + button2.tag = 2;
25 + [button2 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
26 + [self.view addSubview:button2];
27 +
28 + UIButton *button4 = [UIButton buttonWithType:UIButtonTypeCustom];
29 + [button4 setTitle:@"充值" forState:UIControlStateNormal];
30 + button4.frame = CGRectMake(150.0f, 50.0f, 50.0f, 40.0f);
31 + button4.tag = 4;
32 + [button4 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
33 + [self.view addSubview:button4];
34 +
35 +
36 + UIButton *button6 = [UIButton buttonWithType:UIButtonTypeCustom];
37 + [button6 setTitle:@"获取配置参数" forState:UIControlStateNormal];
38 + button6.frame = CGRectMake(10.0f, 50.0f, 150.0f, 40.0f);
39 + button6.tag = 6;
40 + [button6 addTarget:self action:@selector(toggleButton:) forControlEvents: UIControlEventTouchUpInside];
41 + [self.view addSubview:button6];
42 +
43 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSDKMessage:) name:HaiBaoJuheSDK_Notification object:nil];
44 +
45 + [[HaiBaoJuheSDK shareSDK]initSDK:self];
46 +}
47 +
48 +-(void)viewDidAppear:(BOOL)animated{
49 + [super viewDidAppear:animated];
50 + //[[HaiBaoJuheSDK shareSDK] viewDidAppear];
51 +}
52 +
53 +
54 +- (void) toggleButton: (UIButton *) button
55 +{
56 + int tag = (int)button.tag;
57 + if (tag == 1) {
58 + [[HaiBaoJuheSDK shareSDK] loginSDK];
59 + }
60 + else if (tag == 2)
61 + {
62 + NSLog(@"数据接口");
63 + HaiBaoJuheReportInfo *reportInfo = [[HaiBaoJuheReportInfo alloc]init];
64 + [reportInfo setReportType:REPORT_ENTER];
65 + //[reportInfo setReportType:REPORT_CREATEROLE];
66 + //[reportInfo setReportType:REPORT_ROLEUPGRADE]
67 + [reportInfo setServerId:@"9133"];
68 + [reportInfo setPlayerName:@"roleName"];
69 + [reportInfo setPlayerId:@"pserverName"];
70 + [[HaiBaoJuheSDK shareSDK] reportSDK:reportInfo];
71 + }
72 + else if (tag == 4)
73 + {
74 + HaiBaoJuheCreateOrderInfo *payInfo = [[HaiBaoJuheCreateOrderInfo alloc]init];
75 + [payInfo setServerId:@"111"];
76 + [payInfo setPostAmount:@"6"];
77 + [payInfo setPlayerId:@"1231241234"];
78 + [payInfo setTimestamp:@"1232134"];
79 + [payInfo setExchange:@"10"];
80 + [payInfo setCustom:@"custom"];
81 + NSLog(@"start pay");
82 + [[HaiBaoJuheSDK shareSDK] gzyazfWithGzyazfmentInfo:payInfo];
83 + }
84 + else if(tag == 6){
85 + HaiBaoJuheSDK *haiBaoJuheSDK = [HaiBaoJuheSDK shareSDK];
86 + NSLog(@"channelId:%@parame1:%@parame2:%@custom:%@",[haiBaoJuheSDK getGameChannelId],[haiBaoJuheSDK getChannelParameter1],[haiBaoJuheSDK getChannelParameter2],[haiBaoJuheSDK getCustomValue]);
87 + }
88 +}
89 +
90 +
91 +- (void)didReceiveMemoryWarning {
92 + [super didReceiveMemoryWarning];
93 +}
94 +
95 +- (void)receiveSDKMessage:(NSNotification *)notification
96 +{
97 + NSLog(@"receiveSDKMessage");
98 + [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
99 + HaiBaoJuheSDKResult *result = [notification object];
100 + if (result == nil ) {
101 + return;
102 + }
103 + switch (result.notiType) {
104 +
105 + case HaiBaoJuheSDKNotificationInitSDK:
106 + {
107 + NSLog(@"收到HaiBaoJuheSDKNotificationInitSDK");
108 + }
109 +
110 + break;
111 + case HaiBaoJuheSDKNotificationLogin:
112 + {
113 + NSLog(@"result state:%d",result.statusCode);
114 + if (result.statusCode == HaiBaoJuheSDK_NO_ERROR) {
115 + HaiBaoJuheLoginInfo *loginInfo = (HaiBaoJuheLoginInfo*)result.extendData;
116 + NSLog(@"收到登陆信息public openid:%@", [loginInfo openId]);
117 + NSLog(@"收到登陆信息public token:%@", [loginInfo sign]);
118 + NSLog(@"收到登陆信息public timestamp:%@", [loginInfo timestamp]);
119 + NSLog(@"userType:%@",[loginInfo userType]);
120 + }else{
121 + NSLog(@"%@",[result description]);
122 + }
123 + }
124 + break;
125 + case HaiBaoJuheSDKNotificationGzyazf:
126 + {
127 + NSLog(@"收到登陆信息HaiBaoJuheSDKNotificationPay");
128 + }
129 + break;
130 + default:
131 + break;
132 + }
133 +}
134 +
135 +@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 +}
No preview for this file type
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>
No preview for this file type
1 +#import <UIKit/UIKit.h>
2 +
3 +@interface HNYouaiIAPHelperControl : NSObject<UITableViewDelegate, UITableViewDataSource>
4 +
5 +@property(nonatomic,strong) NSString* HNYouaiDingDanHao;
6 +@property(nonatomic,strong) NSDictionary* HNYouaiHuoWuLieBiao;
7 +@property(nonatomic,strong) NSMutableArray* HNYouaiHuoWuIDLieBiao;
8 +@property(nonatomic, strong) UITableView *HNYouaiHuoWuLieBiaoView;
9 +
10 +- (void)HNYouaiHuaQianView:(UIViewController*)controller HNYouaiHuoWuD:(NSString*)products HNYouaiQian:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*)DingDanHao;
11 +
12 +@end
1 +#import <UIKit/UIKit.h>
2 +#import "StoreKit/StoreKit.h"
3 +
4 +@interface HNYouaiAllManager : NSObject
5 +{
6 + NSString* HNYouaiAPPID_;
7 + NSString* HNYouaiAPPKEY_;
8 +
9 + NSString* HNYouaiInviterCode_;
10 +}
11 +
12 +@property bool HNYouaiGeiWoHuaQianBa;
13 +
14 ++ (HNYouaiAllManager *)HNYouaiInstance;
15 +
16 +- (void)HNYouaiChuShiHua;
17 +
18 +- (void)HNYouaiDengLu:(NSString *)HNYouaiAPPID : (NSString *)HNYouaiAPPKEY : (UIViewController *)controller;
19 +
20 +- (void)HNYouaiYangShi:(NSString*)HNYouaiLeiXing;
21 +
22 +- (void)HNYouaiQuery: (NSString *)HNYouaiFuWuQiID : (NSString *)HNYouaiNickName : (NSNumber *)HNYouaiAmount : (NSString *)HNYouaiCallBack : (UIViewController *)controller : (NSString *)HNYouaiServerName;
23 +
24 +- (void)HNYouaiQueryOperation:(UIViewController*)controll HNYouaiHuoWuID:(NSString*)products HNYouaiJiaGe:(NSString*)amount HNYouaiHuoWuMing:(NSString*)productName HNYouaiDingDanHao:(NSString*) DingDanHao;
25 +
26 +
27 +
28 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +extern NSString * const HNYouaiExitNotification;
4 +extern NSString * const HNYouaiLoginNotification;
5 +extern NSString * const HNYouaiErrorNotification;
6 +
7 +
8 +@interface HNYouaiHuiTiaoNotification : NSObject
9 +
10 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HNYouaiInformation : NSObject
4 +{
5 +//
6 +NSString *openId;
7 +NSString *token;
8 +NSString *timestamp;
9 +
10 +}
11 +
12 +@property(retain,nonatomic) NSString *openId;
13 +@property(retain,nonatomic) NSString *token;
14 +@property(retain,nonatomic) NSString *timestamp;
15 ++ (HNYouaiInformation *)getInstance;
16 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HNYouaiInformationJM : NSObject
4 +
5 ++(NSString *)HNYouaiJM:(NSString *)jm;
6 +
7 +@end
1 +#import <UIKit/UIKit.h>
2 +
3 +@interface HNYouaiLocation : NSObject
4 +
5 ++ (NSString *)HNYouaiSKCloudServiceSetupOptionsKey;
6 +@end
7 +
1 +#import <UIKit/UIKit.h>
2 +#import "HNYouaiInformation.h"
3 +#import <JavaScriptCore/JavaScriptCore.h>
4 +
5 +@interface HNYouaiMain : UIViewController<UIWebViewDelegate,UIAlertViewDelegate>
6 +{
7 + UIWebView *webView_;
8 + UIActivityIndicatorView *activityIndicator;
9 +}
10 +
11 +@property(assign) BOOL HNYouaiYouYuanJiao;
12 +
13 +- (void)HNYouaiSettingCKAssetsView:(int)webViewWidth :(int) webViewHeight :(int) screenwidth :(int) screenHeight;
14 +- (void)HNYouaiChuShiHuaWebView;
15 +- (void)loadWebPageWithString:(NSString *)url;
16 +- (void)loadWebPageWithJs:(NSString *)content;
17 +- (void)postNotification:(NSString *)name : (NSString *)code;
18 +- (void)receiveIap:(NSNotification *)notification;
19 +
20 +@end
1 +//
2 +// IAPHelper.h
3 +//
4 +// Original Created by Ray Wenderlich on 2/28/11.
5 +// Created by saturngod on 7/9/12.
6 +// Copyright 2011 Ray Wenderlich. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +#import "StoreKit/StoreKit.h"
11 +
12 +
13 +typedef void (^IAPProductsResponseBlock)(SKProductsRequest* request , SKProductsResponse* response);
14 +
15 +typedef void (^IAPbuyProductCompleteResponseBlock)(SKPaymentTransaction* transcation);
16 +
17 +typedef void (^checkReceiptCompleteResponseBlock)(NSString* response,NSError* error);
18 +
19 +typedef void (^resoreProductsCompleteResponseBlock) (SKPaymentQueue* payment,NSError* error);
20 +
21 +@interface IAPHelper : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver>
22 +
23 +@property (nonatomic,strong) NSSet *productIdentifiers;
24 +@property (nonatomic,strong) NSArray * products;
25 +@property (nonatomic,strong) NSMutableSet *purchasedProducts;
26 +@property (nonatomic,strong) SKProductsRequest *request;
27 +@property (nonatomic) BOOL production;
28 +
29 +//init With Product Identifiers
30 +- (id)initWithProductIdentifiers:(NSSet *)productIdentifiers;
31 +
32 +//get Products List
33 +- (void)requestProductsWithCompletion:(IAPProductsResponseBlock)completion;
34 +
35 +
36 +//Buy Product
37 +- (void)buyProduct:(SKProduct *)productIdentifier onCompletion:(IAPbuyProductCompleteResponseBlock)completion;
38 +
39 +//restore Products
40 +- (void)restoreProductsWithCompletion:(resoreProductsCompleteResponseBlock)completion;
41 +
42 +//check isPurchased or not
43 +- (BOOL)isPurchasedProductsIdentifier:(NSString*)productID;
44 +
45 +//check receipt but recommend to use in server side instead of using this function
46 +- (void)checkReceipt:(NSData*)receiptData onCompletion:(checkReceiptCompleteResponseBlock)completion;
47 +
48 +- (void)checkReceipt:(NSData*)receiptData AndSharedSecret:(NSString*)secretKey onCompletion:(checkReceiptCompleteResponseBlock)completion;
49 +
50 +
51 +//saved purchased product
52 +- (void)provideContentWithTransaction:(SKPaymentTransaction *)transaction;
53 +
54 +- (void)provideContent:(NSString *)productIdentifier __deprecated_msg("use provideContentWithTransaction: instead.");
55 +
56 +//clear the saved products
57 +- (void)clearSavedPurchasedProducts;
58 +- (void)clearSavedPurchasedProductByID:(NSString*)productIdentifier;
59 +
60 +
61 +//Get The Price with local currency
62 +- (NSString *)getLocalePrice:(SKProduct *)product;
63 +
64 +@end
1 +//
2 +// IAPShare.h
3 +// ;
4 +//
5 +// Created by Htain Lin Shwe on 10/7/12.
6 +// Copyright (c) 2012 Edenpod. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +#import "IAPHelper.h"
11 +@interface IAPShare : NSObject
12 +@property (nonatomic,strong) IAPHelper *iap;
13 +
14 ++ (IAPShare *) sharedHelper;
15 +
16 ++(id)toJSON:(NSString*)json;
17 +@end
1 +//
2 +// NSString+Base64.h
3 +// Newsstand
4 +//
5 +// Created by Carlo Vigiani on 29/Oct/11.
6 +// Copyright (c) 2011 viggiosoft. All rights reserved.
7 +//
8 +
9 +#import <Foundation/Foundation.h>
10 +
11 +@interface NSString (Base64)
12 +
13 ++ (NSString *) base64StringFromData:(NSData *)data length:(long)length;
14 +
15 +@end
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface NSURLRequest (SSL)
4 ++(BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
5 +
6 ++(void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
7 +@end
1 +//
2 +// SFHFKeychainUtils.h
3 +//
4 +// Created by Buzz Andersen on 10/20/08.
5 +// Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone.
6 +// Copyright 2008 Sci-Fi Hi-Fi. All rights reserved.
7 +//
8 +// Permission is hereby granted, free of charge, to any person
9 +// obtaining a copy of this software and associated documentation
10 +// files (the "Software"), to deal in the Software without
11 +// restriction, including without limitation the rights to use,
12 +// copy, modify, merge, publish, distribute, sublicense, and/or sell
13 +// copies of the Software, and to permit persons to whom the
14 +// Software is furnished to do so, subject to the following
15 +// conditions:
16 +//
17 +// The above copyright notice and this permission notice shall be
18 +// included in all copies or substantial portions of the Software.
19 +//
20 +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22 +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25 +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27 +// OTHER DEALINGS IN THE SOFTWARE.
28 +//
29 +
30 +#import <UIKit/UIKit.h>
31 +
32 +
33 +@interface SFHFKeychainUtils : NSObject {
34 +
35 +}
36 +
37 ++ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
38 ++ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error;
39 ++ (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
40 +
41 +@end
...\ No newline at end of file ...\ No newline at end of file
No preview for this file type
1 +channelRootPath = "poolsdk_file"
2 +gameProjName = 'Demo'
...\ No newline at end of file ...\ No newline at end of file
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
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 + print('start build proj')
19 + commands.getstatusoutput('xcodebuild -project ' + buildProjName + '.xcodeproj')
20 + releaseDir = os.path.abspath('.') + '/Release'
21 + if not os.path.exists(releaseDir):
22 + os.mkdir(releaseDir)
23 +
24 + ipaPath = releaseDir + '/' + buildProjName + '-Release.ipa'
25 + buildPath = os.path.abspath('.') + '/build'
26 + if os.path.exists(ipaPath):
27 + os.remove(ipaPath)
28 +
29 + resultStr = commands.getstatusoutput('xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/' + targetName + '.app -o ' +ipaPath)
30 + #print(resultStr)
31 +
32 + if os.path.exists(buildPath):
33 + shutil.rmtree(buildPath)
34 +
No preview for this file type
No preview for this file type
No preview for this file type
1 +{
2 + "images" : [
3 + {
4 + "idiom" : "iphone",
5 + "size" : "20x20",
6 + "scale" : "2x"
7 + },
8 + {
9 + "idiom" : "iphone",
10 + "size" : "20x20",
11 + "scale" : "3x"
12 + },
13 + {
14 + "idiom" : "iphone",
15 + "size" : "29x29",
16 + "scale" : "2x"
17 + },
18 + {
19 + "idiom" : "iphone",
20 + "size" : "29x29",
21 + "scale" : "3x"
22 + },
23 + {
24 + "idiom" : "iphone",
25 + "size" : "40x40",
26 + "scale" : "2x"
27 + },
28 + {
29 + "idiom" : "iphone",
30 + "size" : "40x40",
31 + "scale" : "3x"
32 + },
33 + {
34 + "idiom" : "iphone",
35 + "size" : "60x60",
36 + "scale" : "2x"
37 + },
38 + {
39 + "idiom" : "iphone",
40 + "size" : "60x60",
41 + "scale" : "3x"
42 + },
43 + {
44 + "idiom" : "ios-marketing",
45 + "size" : "1024x1024",
46 + "scale" : "1x"
47 + }
48 + ],
49 + "info" : {
50 + "version" : 1,
51 + "author" : "xcode"
52 + }
53 +}
...\ 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 +{
2 + "info" : {
3 + "version" : 1,
4 + "author" : "xcode"
5 + }
6 +}
...\ 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>CFBundleDisplayName</key>
8 + <string>海豹DEMO</string>
9 + <key>CFBundleExecutable</key>
10 + <string>$(EXECUTABLE_NAME)</string>
11 + <key>CFBundleIdentifier</key>
12 + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13 + <key>CFBundleInfoDictionaryVersion</key>
14 + <string>6.0</string>
15 + <key>CFBundleName</key>
16 + <string>$(PRODUCT_NAME)</string>
17 + <key>CFBundlePackageType</key>
18 + <string>APPL</string>
19 + <key>CFBundleShortVersionString</key>
20 + <string>1.1.408</string>
21 + <key>CFBundleSignature</key>
22 + <string>????</string>
23 + <key>CFBundleURLTypes</key>
24 + <array>
25 + <dict>
26 + <key>CFBundleTypeRole</key>
27 + <string>Editor</string>
28 + <key>CFBundleURLSchemes</key>
29 + <array>
30 + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
31 + </array>
32 + </dict>
33 + <dict>
34 + <key>CFBundleTypeRole</key>
35 + <string>Editor</string>
36 + <key>CFBundleURLSchemes</key>
37 + <array>
38 + <string>sdk.uuufish.com</string>
39 + </array>
40 + </dict>
41 + </array>
42 + <key>CFBundleVersion</key>
43 + <string>1</string>
44 + <key>LSRequiresIPhoneOS</key>
45 + <true/>
46 + <key>NSAppTransportSecurity</key>
47 + <dict>
48 + <key>NSAllowsArbitraryLoads</key>
49 + <true/>
50 + </dict>
51 + <key>UIMainStoryboardFile</key>
52 + <string>Main</string>
53 + <key>UIRequiredDeviceCapabilities</key>
54 + <array>
55 + <string>armv7</string>
56 + </array>
57 + <key>UISupportedInterfaceOrientations</key>
58 + <array>
59 + <string>UIInterfaceOrientationPortrait</string>
60 + <string>UIInterfaceOrientationPortraitUpsideDown</string>
61 + </array>
62 +</dict>
63 +</plist>
1 +#import <HaiBaoJuheSDK/HaiBaoJuheSDK2.h>
2 +@interface SDKInterface : Interface
3 +
4 +@end
1 +#include "SDKInterface.h"
2 +#import <UIKit/UIKit.h>
3 +
4 +#import "HNYouai/HNYouaiAllManager.h"
5 +#import "HNYouai/HNYouaiHuiTiaoNotification.h"
6 +#import "HNYouai/HNYouaiInformation.h"
7 +
8 +#import "TrackingIO.h"
9 +
10 +@implementation SDKInterface : Interface
11 +
12 +int mExchange;
13 +NSString *HNYouaiAppId;
14 +NSString *HNYouaiAppKey;
15 +
16 +- (void)SDKinit:(UIViewController *) control
17 +{
18 +
19 + [super SDKinit:control];
20 +
21 + [HaiBaoJuheConfig getInstance];
22 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiChuShiHua];
23 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiYangShi:@"sdk"];
24 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLoginMessage:) name:HNYouaiLoginNotification object:nil];
25 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(HCKAssetsToolCallBack:) name:@"HNYouaiToolCallBack" object:nil];
26 +
27 + [[HaiBaoJuheChecker getInstance] sendNotice:HaiBaoJuheSDKNotificationInitSDK notiName:@"InitSuccess" statusCode:HaiBaoJuheSDK_NO_ERROR description:@"initSuccess" extendData:nil];
28 +
29 + NSString* channelId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"gamechannelid"];
30 + if(channelId == nil || [channelId length] <= 0){
31 + channelId = @"unknown";
32 + }
33 + [TrackingIO initWithappKey:[[HaiBaoJuheConfig getInstance] getValueByKey:@"renyunAppKey"] withChannelId:channelId];
34 +}
35 +
36 +/**
37 + 登录SDK
38 + */
39 +- (void)SDKloginSDK
40 +{
41 + //APPID APPKEY
42 + HNYouaiAppId = [[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_ID"];
43 + HNYouaiAppKey =[[HaiBaoJuheConfig getInstance] getValueByKey:@"APP_KEY"];
44 + [[HNYouaiAllManager HNYouaiInstance]HNYouaiDengLu:HNYouaiAppId :HNYouaiAppKey :self.controller];
45 +
46 +}
47 +
48 +/**
49 + loginCheck
50 + */
51 +- (void)receiveLoginMessage:(NSNotification *)notification
52 +{
53 + NSLog(@"loginchek");
54 + HaiBaoJuheLoginInfo *loginInfo = [HaiBaoJuheLoginInfo alloc];
55 + loginInfo.openId = [[HNYouaiInformation getInstance]openId];
56 + loginInfo.sign = [[HNYouaiInformation getInstance] token];
57 + loginInfo.timestamp = [[HNYouaiInformation getInstance] timestamp];
58 +
59 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
60 + [[HaiBaoJuheChecker getInstance] startCheck:loginInfo];
61 + });
62 +
63 +}
64 +
65 +
66 +-(NSString*)DataTojsonString:(id)object
67 +{
68 + NSString *jsonString = nil;
69 + NSError *error;
70 + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object
71 + options:NSJSONWritingPrettyPrinted // Pass 0 if you don't care about the readability of the generated string
72 + error:&error];
73 + jsonString = [jsonData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
74 + return jsonString;
75 +}
76 +
77 +/**
78 + 苹果支付结果回调
79 + */
80 +
81 +- (void)HCKAssetsToolCallBack:(NSNotification *)notification
82 +{
83 + NSDictionary* payResultDic = notification.object;
84 +
85 + NSString* receiptStr = [payResultDic objectForKey:@"HNYouaiToolResult"];
86 + NSString* queryId = [payResultDic objectForKey:@"query_id"];
87 +
88 + NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
89 + NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
90 +
91 +
92 + if([@"success" isEqualToString:result]){//确认订单成功
93 + }else{//失败
94 + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
95 + NSMutableArray* queryIdArray = [userDefaults objectForKey:@"queryIds"];
96 +
97 + NSMutableArray* tempQueryIdArray = [[NSMutableArray alloc] initWithCapacity:10];
98 +
99 + if (queryIdArray) {
100 + }else{
101 + queryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
102 + }
103 +
104 + for (NSString* arrayQueryId in queryIdArray) {
105 + [tempQueryIdArray addObject:arrayQueryId];
106 + }
107 +
108 + [tempQueryIdArray addObject:queryId];
109 + [userDefaults setObject:tempQueryIdArray forKey:@"queryIds"];
110 + [userDefaults setObject:receiptStr forKey:queryId];
111 + [userDefaults synchronize];
112 + }
113 +}
114 +
115 +/**
116 + 支付 创建订单
117 + */
118 +- (void)SDKgzyazfWithGzyazfmentInfo:(HaiBaoJuheCreateOrderInfo *)payInfo
119 +{
120 + mExchange = [payInfo exchange].intValue;
121 + [super SDKgzyazfWithGzyazfmentInfo:payInfo];
122 +}
123 +
124 +/**
125 + SDK
126 + */
127 +- (void)SDKgotoUserCenter
128 +{
129 +}
130 +
131 +- (void)SDKreport:(HaiBaoJuheReportInfo *)reportInfo
132 +{
133 + NSLog(@"reportInfo");
134 + NSString* reportType = [reportInfo reportType];
135 + if (reportInfo) {
136 + if ([reportType isEqualToString:REPORT_ENTER]) {
137 + [TrackingIO setLoginWithAccountID:[reportInfo playerId]];
138 +
139 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
140 + [self handlerLeakOrder];
141 + });
142 + }else if ([reportType isEqualToString:REPORT_CREATEROLE]){
143 + [TrackingIO setRegisterWithAccountID:[reportInfo playerId]];
144 + }
145 + }
146 +}
147 +
148 +/**
149 + SDK
150 + */
151 +- (void)SDKexitSDK
152 +{
153 +
154 +}
155 +
156 +- (void)SDKlogoutSDK
157 +{
158 + NSLog(@"切换账号");
159 +}
160 +
161 +- (void)handleOpenurl:(NSURL *)url
162 +{
163 +}
164 +
165 +- (void)receivePayMessage : (NSNotification *)notification;
166 +{
167 + NSString *order_id = [notification object];
168 + NSLog(@"订单ID:%@", order_id);
169 +}
170 +
171 +//补单处理
172 +- (void) handlerLeakOrder{
173 + NSUserDefaults* userDefaults2 = [NSUserDefaults standardUserDefaults];
174 + NSMutableArray* queryIdArray = [userDefaults2 objectForKey:@"queryIds"];
175 +
176 + NSLog(@"orderDic%@",queryIdArray);
177 + NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
178 + NSMutableArray* failQueryIdArray = [[NSMutableArray alloc]initWithCapacity:10];
179 +
180 + if(queryIdArray){
181 + for (NSString* queryId in queryIdArray) {
182 + NSString* receiptStr = [userDefaults valueForKey:queryId];
183 + NSDictionary* receiptDic = [NSDictionary dictionaryWithObjectsAndKeys:receiptStr,@"receipt",queryId,@"query_id", nil];
184 + NSString* result = [[NetCenter getInstance] httpPostSyn:[HaiBaoJuheUtils createGzyazfUrl] :receiptDic];
185 + if([@"success" isEqualToString:result]){//成功
186 + [userDefaults removeObjectForKey:queryId];
187 + }else{//补单失败
188 + [failQueryIdArray addObject:queryId];
189 + }
190 + }
191 +
192 + if([failQueryIdArray count] > 0){//含有补单失败项
193 + [userDefaults setObject:failQueryIdArray forKey:@"queryIds"];
194 + }else{//全部补单成功
195 + [userDefaults removeObjectForKey:@"queryIds"];
196 + }
197 + [userDefaults synchronize];
198 + }
199 +}
200 +
201 +
202 +- (void)receiveCreateOrder:(NSNotification *)notification
203 +{
204 + NSLog(@"创建订单成功");
205 + HaiBaoJuheGzyazfInfo *payInfo = [notification object];
206 +
207 + NSNumber *amount = @([[payInfo postAmount] integerValue] * mExchange);
208 + NSString *serverId = [payInfo serverId];
209 + NSString *roleName = [payInfo playerName];
210 + NSString *queryId = [payInfo queryId];
211 +
212 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
213 + [self handlerLeakOrder];
214 + });
215 +
216 + NSString *other = [payInfo other];
217 +
218 + if (other && [other length] > 0) {
219 + [[HNYouaiAllManager HNYouaiInstance] HNYouaiQuery:serverId :roleName :amount :[payInfo queryId] :self.controller :[payInfo serverName]];
220 + }else{
221 + NSString* products = [payInfo products];
222 + [[HNYouaiAllManager HNYouaiInstance] HNYouaiQueryOperation:self.controller HNYouaiHuoWuID:products HNYouaiJiaGe:[payInfo postAmount] HNYouaiHuoWuMing:[payInfo productName] HNYouaiDingDanHao:queryId];
223 + }
224 +}
225 +
226 +-(void)paymentSuccess:(NSString *)accountId orderId:(NSString *)orderId currencyAmount:(double)amount currencyType:(NSString *)currencyType payType:(NSString *)payType custom:(NSArray *)customArray
227 +{
228 + [TrackingIO setPayment:orderId paymentType:payType currentType:currencyType currencyAmount:amount];
229 +}
230 +
231 +@end
232 +
No preview for this file type
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 +{"renyunAppKey": "false", "payorderurl": "https://public.sdk.haibaoyouxi.com/paycheck/create", "usertype": 150, "sdkSimpleName": "apple_youyu", "gamechannelid": "", "APP_KEY": "736b4d81e2f7da30faea1eaa90afa522", "custom": "{}", "sdkVersionCode": "V1_1", "loginCheckUrl": "https://public.sdk.haibaoyouxi.com/logincheck/check", "appScheme": "com.jghb.xinqinji", "c2": "", "c1": "", "APP_ID": "5c3eb15b48d88d102762a7e5", "paycheckurl": "https://public.sdk.haibaoyouxi.com/paycheck/confirm", "gameSimpleName": "testest"}
1 +新接入请参考对接文档和demo<br>
2 +
3 +曾接入公共SDK的快速更新海豹聚合SDK 2018年12月05日版本<br>
4 +1、``` 删除poolsdk_file文件夹中原来framework ``` <br>
5 +2、``` 引入poolsdk_file文件夹中Sprite.framework ``` <br>
6 +3、``` 替换SDKInterface.m文件 ``` <br>
7 +4、``` 删除 PoolSdk.framework ``` <br>
8 +5、``` 引入HaiBaoJuheSDK.framework ``` <br>
9 +6、``` 原pool_setting文件 替换成新 haibao_setting文件 ``` <br>
10 +7、``` 所有接口PoolSdk 替换成 HaiBaoJuheSDK(如不理解可以参考demo或者详细文档) ``` <br>
11 +
12 +
13 +已更新 海豹聚合SDK 2018年12月05日版本 快速更新到 2019年01月25日版本方法<br>
14 +1、``` 删除poolsdk_file文件夹中原来framework ``` <br>
15 +2、``` 引入poolsdk_file文件夹中Railway.framework ``` <br>
16 +3、``` 替换SDKInterface.m文件 ``` <br>
17 +4、``` 替换HaiBaoJuheSDK.framework ``` <br>
18 +5、``` 原 URL Schemes 中的 i9133public 改为 sdk.uuufish.com (可参考demo中info设置) ``` <br>
...\ No newline at end of file ...\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
1 +# 公共SDK服务端接入文档
2 +
3 +### 1.登录验证
4 + 客户端发送请求参数给服务端,服务端对参数进行 MD5 加密,如果加密结果和serverSign 一致,则验证通过,否则不通过
5 +参数 | 类型 | 描述
6 +------------ | ------------- | ------------
7 +userType | int | 用户类型 ID(渠道类型,兼容以 前帐号体系)
8 +openId | string | 平台渠道方返回用户ID
9 +timestamp | string | 时间戳,公共SDK发送到客户端的参数timestamp, 服务端可以判断 timestamp 是否 在有效的登录时间内
10 +serverSign | string | 验证密钥,公共 SDK 发送到 客户端的参数 serverSign,加密串:gameAppkey=%s&userType=% s&openId=%s&timestamp=%s注意:(改为游戏本身的gameAppkey值)
11 +
12 +验证方式:
13 +serverSign=MD5(gameAppkey=%s&userType=%s&openId=%s&timestamp=%s) 如:
14 +md5("gameAppkey=xxxx&userType=1&openId=123&timestamp=111111111111")
15 +gameAppkey : 在公共SDK后台的 Md5加密的KEY
16 +
17 +`注意!CP必须要以userType+openId保证帐号唯一性`
18 +
19 +### 2. 充值验证(通知游戏方发货)
20 + 公共SDK服务器接收到渠道服务器充值回调,对回调进行 MD5 验证,如果验证通过, 则采用Post方式马上回调给游戏充值服务器,否则不会回调充值服务器,然后再返回 信息给渠道服务器。回调参数如下:
21 +参数 | 类型 | 描述
22 +------------ | -------------| ------------
23 +serverId | int | 服务器 ID
24 +playerId | int | 角色 ID
25 +orderId | string | 渠道方订单 ID
26 +payAmount | double | 充值金额(如有商品 ID,此值为商 品的金额)
27 +currency | string | 充值货币(CNY:人民币)
28 +goodsId | string | 商品ID,参数对一些有商品列表 的充值有效
29 +goodsName | string | 商品名称
30 +remoteIp | string | 客户端充值 IP
31 +custom | string | 透传参数 ,长度 512
32 +serverSign | string | 发给充值服务器验证的注意:(改为游戏本身的 gameAppkey 值)
33 +uId | string | 平台渠道帐号 ID
34 +gameSimpleName | string | 平台SDK后台游戏代号名
35 +sdkSimpleName | string | 平台SDK代号
36 +queryId | string | 平台SDK订单号
37 +postTime | string | 订单创建时间戳
38 +
39 +验证方式:
40 +旧:serverSign=MD5(serverId=%s&playerId=%s&orderId=%s&gameAppKey=%s)
41 +升级:sign=Md5('serverId=%s&playerId=%s&orderId=%s&payAmount=%s&goodsId=%s&sdkSimpleName=%s&gameAppKey=%s')
42 +%s:为相应的值
43 +gameAppkey : 在公共SDK后台的Md5加密的KEY
44 +验证通过后,返回公共 SDK 服务器数据,数据格式:{"code":0,"message":"无订 单"}。code:0 表示失败,1 表示成功,message:描述原因。
45 +
46 +`注意!CP必须要以orderId+sdkSimpleName保证订单唯一性,建议使用sign验证`
...\ No newline at end of file ...\ No newline at end of file
1 +channelRootPath = "poolsdk_file"
2 +gameProjName = 'Demo'
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
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 + print('start build proj')
19 + commands.getstatusoutput('xcodebuild -project ' + buildProjName + '.xcodeproj')
20 + releaseDir = os.path.abspath('.') + '/Release'
21 + if not os.path.exists(releaseDir):
22 + os.mkdir(releaseDir)
23 +
24 + ipaPath = releaseDir + '/' + buildProjName + '-Release.ipa'
25 + buildPath = os.path.abspath('.') + '/build'
26 + if os.path.exists(ipaPath):
27 + os.remove(ipaPath)
28 +
29 + resultStr = commands.getstatusoutput('xcrun -sdk iphoneos PackageApplication -v build/Release-iphoneos/' + targetName + '.app -o ' +ipaPath)
30 + #print(resultStr)
31 +
32 + if os.path.exists(buildPath):
33 + shutil.rmtree(buildPath)
34 +
No preview for this file type
1 +#import <Foundation/Foundation.h>
2 +#import "HaiBaoJuheSDK/HaiBaoJuheLoginInfo.h"
3 +#import "HaiBaoJuheSDK/HaiBaoJuheNotification.h"
4 +#import "HaiBaoJuheSDK/HaiBaoJuheCreateOrderInfo.h"
5 +#import "HaiBaoJuheSDK/HaiBaoJuheGzyazfInfo.h"
6 +#import "HaiBaoJuheReportInfo.h"
7 +#import "HaiBaoJuheSDKDelegate.h"
8 +
9 +@interface HaiBaoJuheChecker : NSObject<HaiBaoJuheSDKDelegate>
10 +@property(nonatomic, strong)NSString *userId;
11 +@property(nonatomic, strong)id<HaiBaoJuheSDKDelegate> mHaiBaoJuheSDKDelegate;
12 +
13 +@property bool onlyOneTimeGzyazf;
14 ++ (HaiBaoJuheChecker *)getInstance;
15 +- (void)initChecker;
16 +- (void)startCheck:(HaiBaoJuheLoginInfo *)loginInfo;
17 +- (void) createOrder:(HaiBaoJuheCreateOrderInfo *)gzyazfInfo;
18 +- (void) RailwayHaiBaoJuhereportOpen;
19 +- (void) RailwayHaiBaoJuhereportSDKOpen;
20 +- (void)RailwayHaiBaoJuhehandleFirstOpenApp:(NSString*) path;
21 +- (void) reportEnter:(HaiBaoJuheReportInfo *)reInfo;
22 +- (void) RailwayHaiBaoJuheReport:(NSString *)_action :(HaiBaoJuheReportInfo *)reInfo;
23 +- (void)sendNotice:(HaiBaoJuheSDKNotificationType)notiType
24 + notiName:(NSString *)notiName
25 + statusCode:(int)nCode
26 + description:(NSString *)szDescripton
27 + extendData:(NSObject *)extendData;
28 +
29 +- (void)startCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo;
30 +
31 +- (void)RailwayHaiBaoJuheStartCheckDelegate:(HaiBaoJuheLoginInfo *)loginInfo type:(int)type;
32 +
33 +/*
34 + *初始化时调用
35 + */
36 +- (void)setHaiBaoJuheSDKDelegate:(nullable id<HaiBaoJuheSDKDelegate>)HaiBaoJuheSDKDeletate;
37 +@end
38 +
39 +
40 +
41 +
1 +#import <Foundation/Foundation.h>
2 +
3 +@interface HaiBaoJuheConfig : NSObject
4 +
5 +@property(nonatomic, strong)NSString *gameSimpleName;
6 +@property(nonatomic, strong)NSString *sdkSimpleName;
7 +@property(nonatomic, strong)NSString *sdkVersionCode;
8 +@property(nonatomic, strong)NSString *loginCheckUrl;
9 +@property(nonatomic, strong)NSString *gzyazfOrderUrl;
10 +@property(nonatomic, strong)NSString *gzyazfCheckUrl;
11 +@property(nonatomic, strong)NSString *c1;
12 +@property(nonatomic, strong)NSString *c2;
13 +@property(nonatomic, strong)NSString *custom;
14 +
15 ++ (HaiBaoJuheConfig *)getInstance;
16 +
17 +- (void) loadFile:(NSString *) fileName;
18 +
19 +- (NSString *)getValueByKey:(NSString *) key;
20 +
21 +- (void) updateC1C2Value:(NSString *)c1 c2:(NSString *)c2;
22 +
23 +@end
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.