Commit 22b03300fcc2499ef5e744102b927a1e21b43be5

Authored by alexYang
0 parents
Exists in master

create Activity

Showing 18 changed files with 999 additions and 0 deletions Side-by-side Diff

GameActivitySDK.framework/GameActivitySDK
... ... @@ -0,0 +1 @@
  1 +Versions/Current/GameActivitySDK
0 2 \ No newline at end of file
GameActivitySDK.framework/Headers
... ... @@ -0,0 +1 @@
  1 +Versions/Current/Headers
0 2 \ No newline at end of file
GameActivitySDK.framework/Versions/A/GameActivitySDK
No preview for this file type
GameActivitySDK.framework/Versions/A/Headers/LetsGameActivityAPI.h
... ... @@ -0,0 +1,26 @@
  1 +//
  2 +// LetsGameActivityAPI.h
  3 +// GameActivitySDK
  4 +//
  5 +// Created by yanglele on 2018/6/11.
  6 +// Copyright © 2018年 alexYang. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <UIKit/UIKit.h>
  11 +
  12 +static NSString *actVersion = @"1.0.1";
  13 +
  14 +@interface LetsGameActivityAPI : NSObject<UIApplicationDelegate>
  15 +
  16 +@property(nonatomic, assign) int isDebug;
  17 +
  18 ++(instancetype)instance;
  19 +
  20 +- (void)hide;
  21 +
  22 +-(void)decideIsDebug:(int)isDebug;
  23 +
  24 +-(void)GameActivityWithParaDictory:(NSDictionary *)paraDictory handleCallBackL:(void(^)(void))accomplistCallBack;
  25 +
  26 +@end
GameActivitySDK.framework/Versions/Current
No preview for this file type
GameActivitySDK.xcodeproj/project.pbxproj
... ... @@ -0,0 +1,463 @@
  1 +// !$*UTF8*$!
  2 +{
  3 + archiveVersion = 1;
  4 + classes = {
  5 + };
  6 + objectVersion = 48;
  7 + objects = {
  8 +
  9 +/* Begin PBXAggregateTarget section */
  10 + 752CAD6920CE2B37003C3840 /* GameActivitySDK.framework */ = {
  11 + isa = PBXAggregateTarget;
  12 + buildConfigurationList = 752CAD6A20CE2B37003C3840 /* Build configuration list for PBXAggregateTarget "GameActivitySDK.framework" */;
  13 + buildPhases = (
  14 + 752CAD6F20CE2B7C003C3840 /* ShellScript */,
  15 + );
  16 + dependencies = (
  17 + 752CAD7120CE2B94003C3840 /* PBXTargetDependency */,
  18 + );
  19 + name = GameActivitySDK.framework;
  20 + productName = GameActivitySDK.framework;
  21 + };
  22 +/* End PBXAggregateTarget section */
  23 +
  24 +/* Begin PBXBuildFile section */
  25 + 752CAD7520CE2BF9003C3840 /* LetsGameActivityAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 752CAD7420CE2BF9003C3840 /* LetsGameActivityAPI.m */; };
  26 + 752CAD7820CE4010003C3840 /* LetsGameActivityAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 752CAD7320CE2BF9003C3840 /* LetsGameActivityAPI.h */; settings = {ATTRIBUTES = (Public, ); }; };
  27 + 752CAD7B20CE4515003C3840 /* LSGGameActivityViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 752CAD7920CE4515003C3840 /* LSGGameActivityViewController.h */; };
  28 + 752CAD7C20CE4515003C3840 /* LSGGameActivityViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 752CAD7A20CE4515003C3840 /* LSGGameActivityViewController.m */; };
  29 + 752CAD7F20CE45C3003C3840 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 752CAD7E20CE45C3003C3840 /* UIKit.framework */; };
  30 + 752CAD8120CE45CB003C3840 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 752CAD8020CE45CB003C3840 /* Foundation.framework */; };
  31 + 75A510D920CF61E5008A4F04 /* LetsGameActivityAPI.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 752CAD7320CE2BF9003C3840 /* LetsGameActivityAPI.h */; };
  32 + 75A510DC20CF65E0008A4F04 /* LSGColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 75A510DA20CF65E0008A4F04 /* LSGColor.h */; };
  33 + 75A510DD20CF65E0008A4F04 /* LSGColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 75A510DB20CF65E0008A4F04 /* LSGColor.m */; };
  34 +/* End PBXBuildFile section */
  35 +
  36 +/* Begin PBXContainerItemProxy section */
  37 + 752CAD7020CE2B94003C3840 /* PBXContainerItemProxy */ = {
  38 + isa = PBXContainerItemProxy;
  39 + containerPortal = 752CAD5520CE2AEE003C3840 /* Project object */;
  40 + proxyType = 1;
  41 + remoteGlobalIDString = 752CAD5C20CE2AEE003C3840;
  42 + remoteInfo = GameActivitySDK;
  43 + };
  44 +/* End PBXContainerItemProxy section */
  45 +
  46 +/* Begin PBXCopyFilesBuildPhase section */
  47 + 752CAD5B20CE2AEE003C3840 /* CopyFiles */ = {
  48 + isa = PBXCopyFilesBuildPhase;
  49 + buildActionMask = 2147483647;
  50 + dstPath = "include/$(PRODUCT_NAME)";
  51 + dstSubfolderSpec = 16;
  52 + files = (
  53 + 75A510D920CF61E5008A4F04 /* LetsGameActivityAPI.h in CopyFiles */,
  54 + );
  55 + runOnlyForDeploymentPostprocessing = 0;
  56 + };
  57 +/* End PBXCopyFilesBuildPhase section */
  58 +
  59 +/* Begin PBXFileReference section */
  60 + 752CAD5D20CE2AEE003C3840 /* libGameActivitySDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libGameActivitySDK.a; sourceTree = BUILT_PRODUCTS_DIR; };
  61 + 752CAD7320CE2BF9003C3840 /* LetsGameActivityAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LetsGameActivityAPI.h; sourceTree = "<group>"; };
  62 + 752CAD7420CE2BF9003C3840 /* LetsGameActivityAPI.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LetsGameActivityAPI.m; sourceTree = "<group>"; };
  63 + 752CAD7920CE4515003C3840 /* LSGGameActivityViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LSGGameActivityViewController.h; sourceTree = "<group>"; };
  64 + 752CAD7A20CE4515003C3840 /* LSGGameActivityViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LSGGameActivityViewController.m; sourceTree = "<group>"; };
  65 + 752CAD7E20CE45C3003C3840 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
  66 + 752CAD8020CE45CB003C3840 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
  67 + 752CAD8520CE4C17003C3840 /* LSGUrl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LSGUrl.h; sourceTree = "<group>"; };
  68 + 752CAD8620CE59C5003C3840 /* LSGMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LSGMacros.h; sourceTree = "<group>"; };
  69 + 75A510DA20CF65E0008A4F04 /* LSGColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSGColor.h; sourceTree = "<group>"; };
  70 + 75A510DB20CF65E0008A4F04 /* LSGColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LSGColor.m; sourceTree = "<group>"; };
  71 +/* End PBXFileReference section */
  72 +
  73 +/* Begin PBXFrameworksBuildPhase section */
  74 + 752CAD5A20CE2AEE003C3840 /* Frameworks */ = {
  75 + isa = PBXFrameworksBuildPhase;
  76 + buildActionMask = 2147483647;
  77 + files = (
  78 + 752CAD8120CE45CB003C3840 /* Foundation.framework in Frameworks */,
  79 + 752CAD7F20CE45C3003C3840 /* UIKit.framework in Frameworks */,
  80 + );
  81 + runOnlyForDeploymentPostprocessing = 0;
  82 + };
  83 +/* End PBXFrameworksBuildPhase section */
  84 +
  85 +/* Begin PBXGroup section */
  86 + 752CAD5420CE2AEE003C3840 = {
  87 + isa = PBXGroup;
  88 + children = (
  89 + 752CAD5F20CE2AEE003C3840 /* GameActivitySDK */,
  90 + 752CAD5E20CE2AEE003C3840 /* Products */,
  91 + 752CAD7D20CE45C3003C3840 /* Frameworks */,
  92 + );
  93 + sourceTree = "<group>";
  94 + };
  95 + 752CAD5E20CE2AEE003C3840 /* Products */ = {
  96 + isa = PBXGroup;
  97 + children = (
  98 + 752CAD5D20CE2AEE003C3840 /* libGameActivitySDK.a */,
  99 + );
  100 + name = Products;
  101 + sourceTree = "<group>";
  102 + };
  103 + 752CAD5F20CE2AEE003C3840 /* GameActivitySDK */ = {
  104 + isa = PBXGroup;
  105 + children = (
  106 + 75A510DA20CF65E0008A4F04 /* LSGColor.h */,
  107 + 75A510DB20CF65E0008A4F04 /* LSGColor.m */,
  108 + 752CAD7920CE4515003C3840 /* LSGGameActivityViewController.h */,
  109 + 752CAD7A20CE4515003C3840 /* LSGGameActivityViewController.m */,
  110 + 752CAD7320CE2BF9003C3840 /* LetsGameActivityAPI.h */,
  111 + 752CAD7420CE2BF9003C3840 /* LetsGameActivityAPI.m */,
  112 + 752CAD8520CE4C17003C3840 /* LSGUrl.h */,
  113 + 752CAD8620CE59C5003C3840 /* LSGMacros.h */,
  114 + );
  115 + path = GameActivitySDK;
  116 + sourceTree = "<group>";
  117 + };
  118 + 752CAD7D20CE45C3003C3840 /* Frameworks */ = {
  119 + isa = PBXGroup;
  120 + children = (
  121 + 752CAD8020CE45CB003C3840 /* Foundation.framework */,
  122 + 752CAD7E20CE45C3003C3840 /* UIKit.framework */,
  123 + );
  124 + name = Frameworks;
  125 + sourceTree = "<group>";
  126 + };
  127 +/* End PBXGroup section */
  128 +
  129 +/* Begin PBXHeadersBuildPhase section */
  130 + 752CAD7620CE3FFE003C3840 /* Headers */ = {
  131 + isa = PBXHeadersBuildPhase;
  132 + buildActionMask = 2147483647;
  133 + files = (
  134 + 752CAD7820CE4010003C3840 /* LetsGameActivityAPI.h in Headers */,
  135 + 75A510DC20CF65E0008A4F04 /* LSGColor.h in Headers */,
  136 + 752CAD7B20CE4515003C3840 /* LSGGameActivityViewController.h in Headers */,
  137 + );
  138 + runOnlyForDeploymentPostprocessing = 0;
  139 + };
  140 +/* End PBXHeadersBuildPhase section */
  141 +
  142 +/* Begin PBXNativeTarget section */
  143 + 752CAD5C20CE2AEE003C3840 /* GameActivitySDK */ = {
  144 + isa = PBXNativeTarget;
  145 + buildConfigurationList = 752CAD6620CE2AEE003C3840 /* Build configuration list for PBXNativeTarget "GameActivitySDK" */;
  146 + buildPhases = (
  147 + 752CAD5920CE2AEE003C3840 /* Sources */,
  148 + 752CAD5A20CE2AEE003C3840 /* Frameworks */,
  149 + 752CAD5B20CE2AEE003C3840 /* CopyFiles */,
  150 + 752CAD6D20CE2B52003C3840 /* ShellScript */,
  151 + 752CAD7620CE3FFE003C3840 /* Headers */,
  152 + );
  153 + buildRules = (
  154 + );
  155 + dependencies = (
  156 + );
  157 + name = GameActivitySDK;
  158 + productName = GameActivitySDK;
  159 + productReference = 752CAD5D20CE2AEE003C3840 /* libGameActivitySDK.a */;
  160 + productType = "com.apple.product-type.library.static";
  161 + };
  162 +/* End PBXNativeTarget section */
  163 +
  164 +/* Begin PBXProject section */
  165 + 752CAD5520CE2AEE003C3840 /* Project object */ = {
  166 + isa = PBXProject;
  167 + attributes = {
  168 + LastUpgradeCheck = 0900;
  169 + ORGANIZATIONNAME = alexYang;
  170 + TargetAttributes = {
  171 + 752CAD5C20CE2AEE003C3840 = {
  172 + CreatedOnToolsVersion = 9.0;
  173 + ProvisioningStyle = Automatic;
  174 + };
  175 + 752CAD6920CE2B37003C3840 = {
  176 + CreatedOnToolsVersion = 9.0;
  177 + ProvisioningStyle = Automatic;
  178 + };
  179 + };
  180 + };
  181 + buildConfigurationList = 752CAD5820CE2AEE003C3840 /* Build configuration list for PBXProject "GameActivitySDK" */;
  182 + compatibilityVersion = "Xcode 8.0";
  183 + developmentRegion = en;
  184 + hasScannedForEncodings = 0;
  185 + knownRegions = (
  186 + en,
  187 + );
  188 + mainGroup = 752CAD5420CE2AEE003C3840;
  189 + productRefGroup = 752CAD5E20CE2AEE003C3840 /* Products */;
  190 + projectDirPath = "";
  191 + projectRoot = "";
  192 + targets = (
  193 + 752CAD5C20CE2AEE003C3840 /* GameActivitySDK */,
  194 + 752CAD6920CE2B37003C3840 /* GameActivitySDK.framework */,
  195 + );
  196 + };
  197 +/* End PBXProject section */
  198 +
  199 +/* Begin PBXShellScriptBuildPhase section */
  200 + 752CAD6D20CE2B52003C3840 /* ShellScript */ = {
  201 + isa = PBXShellScriptBuildPhase;
  202 + buildActionMask = 2147483647;
  203 + files = (
  204 + );
  205 + inputPaths = (
  206 + );
  207 + outputPaths = (
  208 + );
  209 + runOnlyForDeploymentPostprocessing = 0;
  210 + shellPath = /bin/sh;
  211 + shellScript = "set -e\n\nif [ ${DEPLOYMENT_LOCATION} == \"YES\" ]; then\necho \"Deploying, exit\"\nexit 0\nfi\n\nexport FRAMEWORK_LOCN=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework\"\nrm -rf ${FRAMEWORK_LOCN}\n# Create the path to the real Headers die\nmkdir -p \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n\n# Create the required symlinks\n/bin/ln -sfh A \"${FRAMEWORK_LOCN}/Versions/Current\"\n/bin/ln -sfh Versions/Current/Headers \"${FRAMEWORK_LOCN}/Headers\"\n/bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}\" \\\n\"${FRAMEWORK_LOCN}/${PRODUCT_NAME}\"\n\necho \"taget built dir=${TARGET_BUILD_DIR},public headers path=${PUBLIC_HEADERS_FOLDER_PATH}\"\n# Copy the public headers into the framework\necho \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\"\necho \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n\n/bin/cp -a \"${TARGET_BUILD_DIR}${PUBLIC_HEADERS_FOLDER_PATH}/\" \\\n\"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n\necho \"Framework built successfully\"";
  212 + };
  213 + 752CAD6F20CE2B7C003C3840 /* ShellScript */ = {
  214 + isa = PBXShellScriptBuildPhase;
  215 + buildActionMask = 2147483647;
  216 + files = (
  217 + );
  218 + inputPaths = (
  219 + );
  220 + outputPaths = (
  221 + );
  222 + runOnlyForDeploymentPostprocessing = 0;
  223 + shellPath = /bin/sh;
  224 + shellScript = "set -e\n\n# If we're already inside this script then die\nif [ -n \"$RW_MULTIPLATFORM_BUILD_IN_PROGRESS\" ]; then\nexit 0\nfi\nexport RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1\n\nRW_FRAMEWORK_NAME=${PROJECT_NAME}\nRW_INPUT_STATIC_LIB=\"lib${PROJECT_NAME}.a\"\nRW_FRAMEWORK_LOCATION=\"${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework\"\n#RW_BUNDLE_NAME=\"VKSdkResources\"\n\n\nfunction build_static_library {\n # Will rebuild the static library as specified\n # build_static_library sdk\n xcrun xcodebuild -project \"${PROJECT_FILE_PATH}\" \\\n -target \"${TARGET_NAME}\" \\\n -configuration \"${CONFIGURATION}\" \\\n -sdk \"${1}\" \\\n ONLY_ACTIVE_ARCH=NO \\\n BUILD_DIR=\"${BUILD_DIR}\" \\\n OBJROOT=\"${OBJROOT}\" \\\n BUILD_ROOT=\"${BUILD_ROOT}\" \\\n SYMROOT=\"${SYMROOT}\" $ACTION\n}\n\nfunction make_fat_library {\n # Will smash 2 static libs together\n # make_fat_library in1 in2 out\n #xcrun\n lipo -create \"${1}\" \"${2}\" -output \"${3}\"\n}\n\n\n# 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK name\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]; then\nRW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\necho \"Could not find platform name from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\n# 2 - Extract the version from the SDK\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]; then\nRW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\necho \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\n# 3 - Determine the other platform\nif [ \"$RW_SDK_PLATFORM\" == \"iphoneos\" ]; then\nRW_OTHER_PLATFORM=iphonesimulator\nelse\nRW_OTHER_PLATFORM=iphoneos\nfi\n\n# 4 - Find the build directory\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$RW_SDK_PLATFORM$ ]]; then\nRW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${RW_OTHER_PLATFORM}\"\nelse\necho \"Could not find other platform build directory.\"\nexit 1\nfi\n\n# Build the other platform.\nbuild_static_library \"${RW_OTHER_PLATFORM}${RW_SDK_VERSION}\"\n\n# If we're currently building for iphonesimulator, then need to rebuild\n# to ensure that we get both i386 and x86_64\nif [ \"$RW_SDK_PLATFORM\" == \"iphonesimulator\" ]; then\nbuild_static_library \"${SDK_NAME}\"\nfi\n\n# Join the 2 static libs into 1 and push into the .framework\nmake_fat_library \"${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}\" \\\n\"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}\"\n\n# Ensure that the framework is present in both platform's build directories\ncp -a \"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework/Versions/A/${RW_FRAMEWORK_NAME}\"\n\n# Copy the framework to the user's desktop\nditto \"${RW_FRAMEWORK_LOCATION}\" \"${SRCROOT}/${RW_FRAMEWORK_NAME}.framework\"\n\nopen ${SRCROOT}\n";
  225 + };
  226 +/* End PBXShellScriptBuildPhase section */
  227 +
  228 +/* Begin PBXSourcesBuildPhase section */
  229 + 752CAD5920CE2AEE003C3840 /* Sources */ = {
  230 + isa = PBXSourcesBuildPhase;
  231 + buildActionMask = 2147483647;
  232 + files = (
  233 + 752CAD7C20CE4515003C3840 /* LSGGameActivityViewController.m in Sources */,
  234 + 752CAD7520CE2BF9003C3840 /* LetsGameActivityAPI.m in Sources */,
  235 + 75A510DD20CF65E0008A4F04 /* LSGColor.m in Sources */,
  236 + );
  237 + runOnlyForDeploymentPostprocessing = 0;
  238 + };
  239 +/* End PBXSourcesBuildPhase section */
  240 +
  241 +/* Begin PBXTargetDependency section */
  242 + 752CAD7120CE2B94003C3840 /* PBXTargetDependency */ = {
  243 + isa = PBXTargetDependency;
  244 + target = 752CAD5C20CE2AEE003C3840 /* GameActivitySDK */;
  245 + targetProxy = 752CAD7020CE2B94003C3840 /* PBXContainerItemProxy */;
  246 + };
  247 +/* End PBXTargetDependency section */
  248 +
  249 +/* Begin XCBuildConfiguration section */
  250 + 752CAD6420CE2AEE003C3840 /* Debug */ = {
  251 + isa = XCBuildConfiguration;
  252 + buildSettings = {
  253 + ALWAYS_SEARCH_USER_PATHS = NO;
  254 + CLANG_ANALYZER_NONNULL = YES;
  255 + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
  256 + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
  257 + CLANG_CXX_LIBRARY = "libc++";
  258 + CLANG_ENABLE_MODULES = YES;
  259 + CLANG_ENABLE_OBJC_ARC = YES;
  260 + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
  261 + CLANG_WARN_BOOL_CONVERSION = YES;
  262 + CLANG_WARN_COMMA = YES;
  263 + CLANG_WARN_CONSTANT_CONVERSION = YES;
  264 + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
  265 + CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
  266 + CLANG_WARN_EMPTY_BODY = YES;
  267 + CLANG_WARN_ENUM_CONVERSION = YES;
  268 + CLANG_WARN_INFINITE_RECURSION = YES;
  269 + CLANG_WARN_INT_CONVERSION = YES;
  270 + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
  271 + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
  272 + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
  273 + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
  274 + CLANG_WARN_STRICT_PROTOTYPES = YES;
  275 + CLANG_WARN_SUSPICIOUS_MOVE = YES;
  276 + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
  277 + CLANG_WARN_UNREACHABLE_CODE = YES;
  278 + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
  279 + CODE_SIGN_IDENTITY = "iPhone Developer";
  280 + COPY_PHASE_STRIP = NO;
  281 + DEBUG_INFORMATION_FORMAT = dwarf;
  282 + ENABLE_STRICT_OBJC_MSGSEND = YES;
  283 + ENABLE_TESTABILITY = YES;
  284 + GCC_C_LANGUAGE_STANDARD = gnu11;
  285 + GCC_DYNAMIC_NO_PIC = NO;
  286 + GCC_NO_COMMON_BLOCKS = YES;
  287 + GCC_OPTIMIZATION_LEVEL = 0;
  288 + GCC_PREPROCESSOR_DEFINITIONS = (
  289 + "DEBUG=1",
  290 + "$(inherited)",
  291 + );
  292 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
  293 + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
  294 + GCC_WARN_UNDECLARED_SELECTOR = YES;
  295 + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
  296 + GCC_WARN_UNUSED_FUNCTION = YES;
  297 + GCC_WARN_UNUSED_VARIABLE = YES;
  298 + IPHONEOS_DEPLOYMENT_TARGET = 11.0;
  299 + MTL_ENABLE_DEBUG_INFO = YES;
  300 + ONLY_ACTIVE_ARCH = YES;
  301 + SDKROOT = iphoneos;
  302 + };
  303 + name = Debug;
  304 + };
  305 + 752CAD6520CE2AEE003C3840 /* Release */ = {
  306 + isa = XCBuildConfiguration;
  307 + buildSettings = {
  308 + ALWAYS_SEARCH_USER_PATHS = NO;
  309 + CLANG_ANALYZER_NONNULL = YES;
  310 + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
  311 + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
  312 + CLANG_CXX_LIBRARY = "libc++";
  313 + CLANG_ENABLE_MODULES = YES;
  314 + CLANG_ENABLE_OBJC_ARC = YES;
  315 + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
  316 + CLANG_WARN_BOOL_CONVERSION = YES;
  317 + CLANG_WARN_COMMA = YES;
  318 + CLANG_WARN_CONSTANT_CONVERSION = YES;
  319 + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
  320 + CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
  321 + CLANG_WARN_EMPTY_BODY = YES;
  322 + CLANG_WARN_ENUM_CONVERSION = YES;
  323 + CLANG_WARN_INFINITE_RECURSION = YES;
  324 + CLANG_WARN_INT_CONVERSION = YES;
  325 + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
  326 + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
  327 + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
  328 + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
  329 + CLANG_WARN_STRICT_PROTOTYPES = YES;
  330 + CLANG_WARN_SUSPICIOUS_MOVE = YES;
  331 + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
  332 + CLANG_WARN_UNREACHABLE_CODE = YES;
  333 + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
  334 + CODE_SIGN_IDENTITY = "iPhone Developer";
  335 + COPY_PHASE_STRIP = NO;
  336 + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
  337 + ENABLE_NS_ASSERTIONS = NO;
  338 + ENABLE_STRICT_OBJC_MSGSEND = YES;
  339 + GCC_C_LANGUAGE_STANDARD = gnu11;
  340 + GCC_NO_COMMON_BLOCKS = YES;
  341 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
  342 + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
  343 + GCC_WARN_UNDECLARED_SELECTOR = YES;
  344 + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
  345 + GCC_WARN_UNUSED_FUNCTION = YES;
  346 + GCC_WARN_UNUSED_VARIABLE = YES;
  347 + IPHONEOS_DEPLOYMENT_TARGET = 11.0;
  348 + MTL_ENABLE_DEBUG_INFO = NO;
  349 + SDKROOT = iphoneos;
  350 + VALIDATE_PRODUCT = YES;
  351 + };
  352 + name = Release;
  353 + };
  354 + 752CAD6720CE2AEE003C3840 /* Debug */ = {
  355 + isa = XCBuildConfiguration;
  356 + buildSettings = {
  357 + CODE_SIGN_STYLE = Automatic;
  358 + FRAMEWORK_SEARCH_PATHS = (
  359 + "$(inherited)",
  360 + "$(PROJECT_DIR)/GameActivitySDK/",
  361 + "$(PROJECT_DIR)",
  362 + "$(SRCROOT)/../..",
  363 + );
  364 + GCC_NO_COMMON_BLOCKS = NO;
  365 + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/GameActivitySDK/";
  366 + LIBRARY_SEARCH_PATHS = (
  367 + "$(inherited)",
  368 + "$(PROJECT_DIR)/",
  369 + "$(PROJECT_DIR)",
  370 + );
  371 + ONLY_ACTIVE_ARCH = NO;
  372 + OTHER_LDFLAGS = (
  373 + "-ObjC",
  374 + "-all_load",
  375 + );
  376 + PRIVATE_HEADERS_FOLDER_PATH = /../GameActivitySDK/Private;
  377 + PRODUCT_NAME = "$(TARGET_NAME)";
  378 + PUBLIC_HEADERS_FOLDER_PATH = "/include/$(PRODUCT_NAME)";
  379 + SKIP_INSTALL = YES;
  380 + TARGETED_DEVICE_FAMILY = "1,2";
  381 + };
  382 + name = Debug;
  383 + };
  384 + 752CAD6820CE2AEE003C3840 /* Release */ = {
  385 + isa = XCBuildConfiguration;
  386 + buildSettings = {
  387 + CODE_SIGN_STYLE = Automatic;
  388 + FRAMEWORK_SEARCH_PATHS = (
  389 + "$(inherited)",
  390 + "$(PROJECT_DIR)/GameActivitySDK/",
  391 + "$(PROJECT_DIR)",
  392 + "$(SRCROOT)/../..",
  393 + );
  394 + GCC_NO_COMMON_BLOCKS = NO;
  395 + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/GameActivitySDK/";
  396 + LIBRARY_SEARCH_PATHS = (
  397 + "$(inherited)",
  398 + "$(PROJECT_DIR)/",
  399 + "$(PROJECT_DIR)",
  400 + );
  401 + OTHER_LDFLAGS = (
  402 + "-ObjC",
  403 + "-all_load",
  404 + );
  405 + PRIVATE_HEADERS_FOLDER_PATH = /../GameActivitySDK/Private;
  406 + PRODUCT_NAME = "$(TARGET_NAME)";
  407 + PUBLIC_HEADERS_FOLDER_PATH = "/include/$(PRODUCT_NAME)";
  408 + SKIP_INSTALL = YES;
  409 + TARGETED_DEVICE_FAMILY = "1,2";
  410 + };
  411 + name = Release;
  412 + };
  413 + 752CAD6B20CE2B37003C3840 /* Debug */ = {
  414 + isa = XCBuildConfiguration;
  415 + buildSettings = {
  416 + CODE_SIGN_STYLE = Automatic;
  417 + ONLY_ACTIVE_ARCH = NO;
  418 + PRODUCT_NAME = "$(TARGET_NAME)";
  419 + };
  420 + name = Debug;
  421 + };
  422 + 752CAD6C20CE2B37003C3840 /* Release */ = {
  423 + isa = XCBuildConfiguration;
  424 + buildSettings = {
  425 + CODE_SIGN_STYLE = Automatic;
  426 + PRODUCT_NAME = "$(TARGET_NAME)";
  427 + };
  428 + name = Release;
  429 + };
  430 +/* End XCBuildConfiguration section */
  431 +
  432 +/* Begin XCConfigurationList section */
  433 + 752CAD5820CE2AEE003C3840 /* Build configuration list for PBXProject "GameActivitySDK" */ = {
  434 + isa = XCConfigurationList;
  435 + buildConfigurations = (
  436 + 752CAD6420CE2AEE003C3840 /* Debug */,
  437 + 752CAD6520CE2AEE003C3840 /* Release */,
  438 + );
  439 + defaultConfigurationIsVisible = 0;
  440 + defaultConfigurationName = Release;
  441 + };
  442 + 752CAD6620CE2AEE003C3840 /* Build configuration list for PBXNativeTarget "GameActivitySDK" */ = {
  443 + isa = XCConfigurationList;
  444 + buildConfigurations = (
  445 + 752CAD6720CE2AEE003C3840 /* Debug */,
  446 + 752CAD6820CE2AEE003C3840 /* Release */,
  447 + );
  448 + defaultConfigurationIsVisible = 0;
  449 + defaultConfigurationName = Release;
  450 + };
  451 + 752CAD6A20CE2B37003C3840 /* Build configuration list for PBXAggregateTarget "GameActivitySDK.framework" */ = {
  452 + isa = XCConfigurationList;
  453 + buildConfigurations = (
  454 + 752CAD6B20CE2B37003C3840 /* Debug */,
  455 + 752CAD6C20CE2B37003C3840 /* Release */,
  456 + );
  457 + defaultConfigurationIsVisible = 0;
  458 + defaultConfigurationName = Release;
  459 + };
  460 +/* End XCConfigurationList section */
  461 + };
  462 + rootObject = 752CAD5520CE2AEE003C3840 /* Project object */;
  463 +}
GameActivitySDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata
... ... @@ -0,0 +1,7 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<Workspace
  3 + version = "1.0">
  4 + <FileRef
  5 + location = "self:GameActivitySDK.xcodeproj">
  6 + </FileRef>
  7 +</Workspace>
GameActivitySDK.xcodeproj/project.xcworkspace/xcuserdata/yanglele.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
GameActivitySDK.xcodeproj/xcuserdata/yanglele.xcuserdatad/xcschemes/GameActivitySDK.framework.xcscheme
... ... @@ -0,0 +1,82 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<Scheme
  3 + LastUpgradeVersion = "0900"
  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 = "752CAD6920CE2B37003C3840"
  18 + BuildableName = "GameActivitySDK.framework"
  19 + BlueprintName = "GameActivitySDK.framework"
  20 + ReferencedContainer = "container:GameActivitySDK.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 + language = ""
  30 + shouldUseLaunchSchemeArgsEnv = "YES">
  31 + <Testables>
  32 + </Testables>
  33 + <AdditionalOptions>
  34 + </AdditionalOptions>
  35 + </TestAction>
  36 + <LaunchAction
  37 + buildConfiguration = "Debug"
  38 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
  39 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
  40 + language = ""
  41 + launchStyle = "0"
  42 + useCustomWorkingDirectory = "NO"
  43 + ignoresPersistentStateOnLaunch = "NO"
  44 + debugDocumentVersioning = "YES"
  45 + debugServiceExtension = "internal"
  46 + allowLocationSimulation = "YES">
  47 + <MacroExpansion>
  48 + <BuildableReference
  49 + BuildableIdentifier = "primary"
  50 + BlueprintIdentifier = "752CAD6920CE2B37003C3840"
  51 + BuildableName = "GameActivitySDK.framework"
  52 + BlueprintName = "GameActivitySDK.framework"
  53 + ReferencedContainer = "container:GameActivitySDK.xcodeproj">
  54 + </BuildableReference>
  55 + </MacroExpansion>
  56 + <AdditionalOptions>
  57 + </AdditionalOptions>
  58 + </LaunchAction>
  59 + <ProfileAction
  60 + buildConfiguration = "Release"
  61 + shouldUseLaunchSchemeArgsEnv = "YES"
  62 + savedToolIdentifier = ""
  63 + useCustomWorkingDirectory = "NO"
  64 + debugDocumentVersioning = "YES">
  65 + <MacroExpansion>
  66 + <BuildableReference
  67 + BuildableIdentifier = "primary"
  68 + BlueprintIdentifier = "752CAD6920CE2B37003C3840"
  69 + BuildableName = "GameActivitySDK.framework"
  70 + BlueprintName = "GameActivitySDK.framework"
  71 + ReferencedContainer = "container:GameActivitySDK.xcodeproj">
  72 + </BuildableReference>
  73 + </MacroExpansion>
  74 + </ProfileAction>
  75 + <AnalyzeAction
  76 + buildConfiguration = "Debug">
  77 + </AnalyzeAction>
  78 + <ArchiveAction
  79 + buildConfiguration = "Release"
  80 + revealArchiveInOrganizer = "YES">
  81 + </ArchiveAction>
  82 +</Scheme>
GameActivitySDK.xcodeproj/xcuserdata/yanglele.xcuserdatad/xcschemes/xcschememanagement.plist
... ... @@ -0,0 +1,27 @@
  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>GameActivitySDK.framework.xcscheme</key>
  8 + <dict>
  9 + <key>orderHint</key>
  10 + <integer>0</integer>
  11 + </dict>
  12 + <key>GameActivitySDK.xcscheme</key>
  13 + <dict>
  14 + <key>orderHint</key>
  15 + <integer>4</integer>
  16 + </dict>
  17 + </dict>
  18 + <key>SuppressBuildableAutocreation</key>
  19 + <dict>
  20 + <key>752CAD6920CE2B37003C3840</key>
  21 + <dict>
  22 + <key>primary</key>
  23 + <true/>
  24 + </dict>
  25 + </dict>
  26 +</dict>
  27 +</plist>
GameActivitySDK/LSGColor.h
... ... @@ -0,0 +1,20 @@
  1 +
  2 +
  3 +#import <Foundation/Foundation.h>
  4 +#import <CoreGraphics/CoreGraphics.h>
  5 +
  6 +@class UIColor;
  7 +
  8 +
  9 +@interface LSGColor : NSObject
  10 +
  11 ++ (UIColor *)colorWithHexValue:(NSInteger)color alpha:(CGFloat)alpha;
  12 ++ (UIColor *)colorWithHexString:(NSString *)stringToConvert;
  13 +
  14 ++ (UIColor *)backgroudColor; //FFFFFF
  15 ++ (UIColor *)textColor; //3E3E3E
  16 ++ (UIColor *)lightTextColor; //7E7E7E
  17 ++ (UIColor *)redColor; //D11301
  18 ++ (UIColor *)borderColor;
  19 +
  20 +@end
GameActivitySDK/LSGColor.m
... ... @@ -0,0 +1,73 @@
  1 +
  2 +
  3 +#import <UIKit/UIKit.h>
  4 +#import "LSGColor.h"
  5 +
  6 +
  7 +@implementation LSGColor
  8 +
  9 ++ (UIColor *)colorWithHexValue:(NSInteger)color alpha:(CGFloat)alpha {
  10 + return [UIColor colorWithRed:((float) ((color & 0xff0000) >> 16)) / 255.0
  11 + green:((float) ((color & 0x00ff00) >> 8)) / 255.0
  12 + blue:((float) (color & 0x0000ff)) / 255.0
  13 + alpha:alpha];
  14 +}
  15 +
  16 ++ (UIColor *)colorWithHexString:(NSString *)stringToConvert
  17 +{
  18 + //去掉前后空格换行符
  19 + NSString *cString = [[stringToConvert stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString];
  20 +
  21 + if ([cString hasPrefix:@"0X"])
  22 + cString = [cString substringFromIndex:2];
  23 + else if ([cString hasPrefix:@"#"])
  24 + cString = [cString substringFromIndex:1];
  25 +
  26 + if ([cString length] != 6)
  27 + return nil;
  28 +
  29 + // Separate into r, g, b substrings
  30 + NSRange range;
  31 + range.location = 0;
  32 + range.length = 2;
  33 + NSString *rString = [cString substringWithRange:range];
  34 +
  35 + range.location = 2;
  36 + NSString *gString = [cString substringWithRange:range];
  37 +
  38 + range.location = 4;
  39 + NSString *bString = [cString substringWithRange:range];
  40 +
  41 + unsigned int r, g, b;
  42 + [[NSScanner scannerWithString:rString] scanHexInt:&r];
  43 + [[NSScanner scannerWithString:gString] scanHexInt:&g];
  44 + [[NSScanner scannerWithString:bString] scanHexInt:&b];
  45 + return [UIColor colorWithRed:r / 255.0 green:g / 255.0 blue:b / 255.0 alpha:1.0];
  46 +}
  47 +
  48 ++ (UIColor *)backgroudColor
  49 +{
  50 + return [UIColor whiteColor]; //[UIColor whiteColor];
  51 +}
  52 +
  53 ++ (UIColor *)textColor
  54 +{
  55 + return [self colorWithHexValue:0x3E3E3E alpha:1.0];
  56 +}
  57 +
  58 ++ (UIColor *)lightTextColor
  59 +{
  60 + return [self colorWithHexValue:0x7E7E7E alpha:1.0];
  61 +}
  62 +
  63 ++ (UIColor *)redColor
  64 +{
  65 + return [self colorWithHexValue:0xD11301 alpha:1.0];
  66 +}
  67 +
  68 ++ (UIColor *)borderColor
  69 +{
  70 + return [self colorWithHexValue:0xeeeeee alpha:1.0];
  71 +}
  72 +
  73 +@end
GameActivitySDK/LSGGameActivityViewController.h
... ... @@ -0,0 +1,28 @@
  1 +//
  2 +// LSGGameActivityViewController.h
  3 +// GameActivitySDK
  4 +//
  5 +// Created by yanglele on 2018/6/11.
  6 +// Copyright © 2018年 alexYang. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +@interface LSGGameActivityViewController : UIViewController
  12 +
  13 +//appId=100&appKey=f899139df5e1059396431415e770c6dd&userId=123456&serverId=111&serverName=aaa&roleId=222&roleName=ccc&diamond=888
  14 +
  15 +@property(nonatomic, copy) NSString *appId;
  16 +@property(nonatomic, copy) NSString *appKey;
  17 +@property(nonatomic, copy) NSString *userId;
  18 +@property(nonatomic, copy) NSString *serverId;
  19 +@property(nonatomic, copy) NSString *serverName;
  20 +@property(nonatomic, copy) NSString *roleId;
  21 +@property(nonatomic, copy) NSString *roleName;
  22 +@property(nonatomic, copy) NSString *diamond;
  23 +
  24 +@property(nonatomic, assign) BOOL *isDebug;
  25 +
  26 +@property(nonatomic, copy) void(^accomplistCallBack)();
  27 +
  28 +@end
GameActivitySDK/LSGGameActivityViewController.m
... ... @@ -0,0 +1,132 @@
  1 +//
  2 +// LSGGameActivityViewController.m
  3 +// GameActivitySDK
  4 +//
  5 +// Created by yanglele on 2018/6/11.
  6 +// Copyright © 2018年 alexYang. All rights reserved.
  7 +//
  8 +
  9 +#import "LSGGameActivityViewController.h"
  10 +#import "LetsGameActivityAPI.h"
  11 +#import "LSGColor.h"
  12 +#import "LSGUrl.h"
  13 +#import "LSGMacros.h"
  14 +
  15 +@interface LSGGameActivityViewController ()<UIWebViewDelegate>
  16 +@property(nonatomic, strong) UIWebView *webView;
  17 +@end
  18 +
  19 +@implementation LSGGameActivityViewController
  20 +
  21 +-(void)loadView{
  22 + [super loadView];
  23 + [self.navigationController setNavigationBarHidden:YES];
  24 + self.view.backgroundColor = [LSGColor colorWithHexValue:0x181818 alpha:0.8];
  25 + [self.view addSubview:self.webView];
  26 +}
  27 +
  28 +- (void)viewDidLoad {
  29 + [super viewDidLoad];
  30 + // Do any additional setup after loading the view.
  31 +
  32 + NSString *newUserAgent = @"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1";
  33 + [[NSUserDefaults standardUserDefaults] registerDefaults:@{@"UserAgent":newUserAgent}];
  34 +
  35 + NSString *webViewUrlPath = [decideIsDebugOrRelease(self.isDebug) stringByAppendingString:kActivityAwardURL];
  36 + NSMutableString *urlWithParams = [NSMutableString stringWithString:webViewUrlPath];
  37 +
  38 + //appId=100&appKey=f899139df5e1059396431415e770c6dd&userId=123456&serverId=111&serverName=aaa&roleId=222&roleName=ccc&diamond=888
  39 + NSMutableString *queryString = [NSMutableString new];
  40 + [queryString appendFormat:@"appId=%@",self.appId];
  41 + [queryString appendFormat:@"&appKey=%@", self.appKey];
  42 + [queryString appendFormat:@"&userId=%@", self.userId];
  43 + [queryString appendFormat:@"&serverId=%@", self.serverId];
  44 + [queryString appendFormat:@"&serverName=%@", self.serverName];
  45 + [queryString appendFormat:@"&roleId=%@", self.roleId];
  46 + [queryString appendFormat:@"&roleName=%@", self.roleName];
  47 + [queryString appendFormat:@"&diamond=%@", self.diamond];
  48 +
  49 + [urlWithParams appendFormat:@"?%@", queryString];
  50 +
  51 + NSString *urlEncode = [urlWithParams stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  52 + NSURL *url = [NSURL URLWithString:urlEncode];
  53 + NSLog(@"activity Url %@", [url absoluteString]);
  54 + NSURLRequest *request = [NSURLRequest requestWithURL:url];
  55 + [self.webView loadRequest:request];
  56 +}
  57 +
  58 +-(UIWebView*)webView{
  59 + if(!_webView){
  60 + _webView = [[UIWebView alloc] init];
  61 + _webView.delegate = self;
  62 + }
  63 + return _webView;
  64 +}
  65 +
  66 +-(void)viewDidLayoutSubviews{
  67 + [super viewDidLayoutSubviews];
  68 + [self layoutSubViews];
  69 +}
  70 +
  71 +-(void)layoutSubViews{
  72 + if (iPhoneX) {
  73 + _webView.frame = CGRectMake(0, 44, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-44-34);
  74 + }else{
  75 + _webView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
  76 + }
  77 +}
  78 +
  79 +-(void)injectJSObject{
  80 + NSString *jsPath = [[NSBundle mainBundle].resourcePath stringByAppendingFormat:@"/%@/ActJs.txt", kBundleName];
  81 + NSString *jsStr = [NSString stringWithContentsOfFile:jsPath encoding:NSUTF8StringEncoding error:nil];
  82 + [self.webView stringByEvaluatingJavaScriptFromString:jsStr];
  83 +
  84 +}
  85 +
  86 +#pragma mark webView Delegate
  87 +-(void)webViewDidFinishLoad:(UIWebView *)webView{
  88 + [self injectJSObject];
  89 +}
  90 +
  91 +-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
  92 + NSURL *url = [request URL];
  93 +
  94 + NSString *urlStr = [url absoluteString];
  95 + if([urlStr hasPrefix:@"jscall"]){
  96 + NSArray *components = [urlStr componentsSeparatedByString:@":"];
  97 +
  98 + NSString *function = (NSString*)[components objectAtIndex:1];
  99 + //调用oc方法,忽略警告
  100 +#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
  101 + NSString *funcSig = [NSString stringWithString:function];
  102 + NSLog(@"select funcSig %@", funcSig);
  103 +
  104 + SEL selector = NSSelectorFromString(funcSig);
  105 + if ([self respondsToSelector:selector]) {
  106 + [self performSelector:selector];
  107 + }
  108 + return NO;
  109 + }else{
  110 + return YES;
  111 + }
  112 +}
  113 +
  114 +- (void)didReceiveMemoryWarning {
  115 + [super didReceiveMemoryWarning];
  116 + // Dispose of any resources that can be recreated.
  117 +}
  118 +
  119 +#pragma js function
  120 +-(void)closeWin{
  121 + // [[LetsGameAPI instance] hide];
  122 + self.accomplistCallBack();
  123 + //当成功完成时返回是1(包括支付成功和支付失败),其他的情况都是没有值
  124 +// if ([args[0] isEqualToString:@"1"]) {
  125 +// //产生回调
  126 +// self.accomplistCallBack();
  127 +// }
  128 + //其余的关闭窗口
  129 + [[LetsGameActivityAPI instance] hide];
  130 +}
  131 +
  132 +@end
GameActivitySDK/LSGMacros.h
... ... @@ -0,0 +1,24 @@
  1 +//
  2 +// LSGMacros.h
  3 +// GameActivitySDK
  4 +//
  5 +// Created by yanglele on 2018/6/11.
  6 +// Copyright © 2018年 alexYang. All rights reserved.
  7 +//
  8 +
  9 +#ifndef LSGMacros_h
  10 +#define LSGMacros_h
  11 +
  12 +
  13 +// 判断是否是iPhone X
  14 +#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
  15 +// 状态栏高度
  16 +#define STATUS_BAR_HEIGHT (iPhoneX ? 44.f : 20.f)
  17 +// 导航栏高度
  18 +#define NAVIGATION_BAR_HEIGHT (iPhoneX ? 88.f : 64.f)
  19 +// tabBar高度
  20 +#define TAB_BAR_HEIGHT (iPhoneX ? (49.f+34.f) : 49.f)
  21 +// home indicator高度
  22 +#define HOME_INDICATOR_HEIGHT (iPhoneX ? 34.f : 0.f)
  23 +
  24 +#endif /* LSGMacros_h */
GameActivitySDK/LSGUrl.h
... ... @@ -0,0 +1,21 @@
  1 +//
  2 +// LSGUrl.h
  3 +// GameActivitySDK
  4 +//
  5 +// Created by yanglele on 2018/6/11.
  6 +// Copyright © 2018年 alexYang. All rights reserved.
  7 +//
  8 +
  9 +#ifndef LSGUrl_h
  10 +#define LSGUrl_h
  11 +
  12 +#define devBaseURL @"https://devsdk.letsgame.mobi"
  13 +#define releaseBaseURL @"https://api.gumptech.com"
  14 +
  15 +#define kActivityAwardURL @"/activity/award.do"
  16 +
  17 +
  18 +#define kBundleName @"GameSDKResources.bundle"
  19 +
  20 +#define decideIsDebugOrRelease(isDebug) (isDebug > 0 ? devBaseURL: releaseBaseURL)
  21 +#endif /* LSGUrl_h */
GameActivitySDK/LetsGameActivityAPI.h
... ... @@ -0,0 +1,26 @@
  1 +//
  2 +// LetsGameActivityAPI.h
  3 +// GameActivitySDK
  4 +//
  5 +// Created by yanglele on 2018/6/11.
  6 +// Copyright © 2018年 alexYang. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <UIKit/UIKit.h>
  11 +
  12 +static NSString *actVersion = @"1.0.1";
  13 +
  14 +@interface LetsGameActivityAPI : NSObject<UIApplicationDelegate>
  15 +
  16 +@property(nonatomic, assign) int isDebug;
  17 +
  18 ++(instancetype)instance;
  19 +
  20 +- (void)hide;
  21 +
  22 +-(void)decideIsDebug:(int)isDebug;
  23 +
  24 +-(void)GameActivityWithParaDictory:(NSDictionary *)paraDictory handleCallBackL:(void(^)(void))accomplistCallBack;
  25 +
  26 +@end
GameActivitySDK/LetsGameActivityAPI.m
... ... @@ -0,0 +1,67 @@
  1 +//
  2 +// LetsGameActivityAPI.m
  3 +// GameActivitySDK
  4 +//
  5 +// Created by yanglele on 2018/6/11.
  6 +// Copyright © 2018年 alexYang. All rights reserved.
  7 +//
  8 +
  9 +#import "LetsGameActivityAPI.h"
  10 +#import "LSGGameActivityViewController.h"
  11 +
  12 +@interface LetsGameActivityAPI()
  13 +
  14 +@property(nonatomic, assign) BOOL isShowed;
  15 +@property(nonatomic, strong) UINavigationController *navigationController;
  16 +
  17 +@end
  18 +
  19 +@implementation LetsGameActivityAPI
  20 ++(instancetype)instance{
  21 + static LetsGameActivityAPI *__single__;
  22 + static dispatch_once_t onceToken;
  23 + dispatch_once(&onceToken, ^{
  24 + __single__ = [[LetsGameActivityAPI alloc] init];
  25 + });
  26 + return __single__;
  27 +}
  28 +
  29 +-(void)decideIsDebug:(int)isDebug{
  30 + self.isDebug = isDebug;
  31 +}
  32 +
  33 +-(void)GameActivityWithParaDictory:(NSDictionary *)paraDictory handleCallBackL:(void(^)())accomplistCallBack{
  34 + LSGGameActivityViewController *gameActivityVC = [[LSGGameActivityViewController alloc] init];
  35 + gameActivityVC.appId = paraDictory[@"appId"];
  36 + gameActivityVC.appKey = paraDictory[@"appKey"];
  37 + gameActivityVC.userId = paraDictory[@"userId"];
  38 + gameActivityVC.serverId = paraDictory[@"serverId"];
  39 + gameActivityVC.serverName = paraDictory[@"serverName"];
  40 + gameActivityVC.roleId = paraDictory[@"roleId"];
  41 + gameActivityVC.roleName = paraDictory[@"roleName"];
  42 + gameActivityVC.diamond = paraDictory[@"diamond"];
  43 +
  44 + gameActivityVC.accomplistCallBack = accomplistCallBack;
  45 +
  46 + gameActivityVC.isDebug = self.isDebug;
  47 + self.navigationController = [[UINavigationController alloc] initWithRootViewController:gameActivityVC];
  48 + [self show:[UIApplication sharedApplication].delegate.window];
  49 +
  50 +}
  51 +
  52 +- (void)hide {
  53 + [self.navigationController popToRootViewControllerAnimated:NO];
  54 + [self.navigationController.view removeFromSuperview];
  55 + self.navigationController = nil;
  56 + self.isShowed = NO;
  57 +}
  58 +
  59 +- (void)show:(UIView *)view {
  60 + if (self.isShowed) {
  61 + return;
  62 + }
  63 +
  64 + [view addSubview:self.navigationController.view];
  65 + self.isShowed = YES;
  66 +}
  67 +@end