Commit c31a1d342b89b5426be2ef5ab7e4ef7d4732e4e6
1 parent
91cde789
no message
Showing
5 changed files
with
52 additions
and
48 deletions
CNLiveUserAgreementManager.podspec
| ... | ... | @@ -40,7 +40,7 @@ TODO: Add long description of the pod here. |
| 40 | 40 | # s.frameworks = 'UIKit', 'MapKit' |
| 41 | 41 | # s.dependency 'AFNetworking', '~> 2.3' |
| 42 | 42 | s.dependency 'CNLiveRequestBastKit' |
| 43 | - s.dependency 'CNLiveEnvironmentConfiguration' | |
| 43 | + s.dependency 'CNLiveEnvironment' | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | end | ... | ... |
CNLiveUserAgreementManager/Classes/CNUserAgreementManager.h
| ... | ... | @@ -10,22 +10,22 @@ |
| 10 | 10 | |
| 11 | 11 | NS_ASSUME_NONNULL_BEGIN |
| 12 | 12 | typedef enum { |
| 13 | - CNAgreementUser = 1001,//用户协议 | |
| 14 | - CNAgreementPrivacy = 1002,//隐私政策 | |
| 15 | - CNAgreementHelp = 1003,//帮助与反馈 | |
| 16 | - CNAgreementUnderstand = 1004,//使用手册 | |
| 17 | - CNAgreementIntroduction = 1005,//应用简介 | |
| 18 | - CNAgreementCopyright = 1006,//版权信息 | |
| 19 | - CNAgreementPermission = 1007,//软件许可及服务协议 | |
| 20 | - CNAgreementIntegralRules = 1008,//积分规则 | |
| 21 | - CNAgreementSigninRules = 1009,//签到奖励规则 | |
| 22 | - CNAgreementReviewApply = 1010,//复核申请 | |
| 23 | - CNAgreementCancellation = 1011,//注销协议 | |
| 24 | - CNAgreementEmojiService = 1012,//表情包服务说明 | |
| 25 | - CNAgreementEmojiComplaints = 1013,//表情包投诉说明 | |
| 13 | + CNAgreementUser = 1001,//用户协议 | |
| 14 | + CNAgreementPrivacy = 1002,//隐私政策 | |
| 15 | + CNAgreementHelp = 1003,//帮助与反馈 | |
| 16 | + CNAgreementUnderstand = 1004,//使用手册 | |
| 17 | + CNAgreementIntroduction = 1005,//应用简介 | |
| 18 | + CNAgreementCopyright = 1006,//版权信息 | |
| 19 | + CNAgreementPermission = 1007,//软件许可及服务协议 | |
| 20 | + CNAgreementIntegralRules = 1008,//积分规则 | |
| 21 | + CNAgreementSigninRules = 1009,//签到奖励规则 | |
| 22 | + CNAgreementReviewApply = 1010,//复核申请 | |
| 23 | + CNAgreementCancellation = 1011,//注销协议 | |
| 24 | + CNAgreementEmojiService = 1012,//表情包服务说明 | |
| 25 | + CNAgreementEmojiComplaints = 1013,//表情包投诉说明 | |
| 26 | 26 | CNAgreementEnterpriseQualification = 1014,//企业资质 |
| 27 | - | |
| 28 | - | |
| 27 | + CNAgreementBuyAudio = 1015,//购买音频协议 | |
| 28 | + | |
| 29 | 29 | } CNGetAgreementH5Type; |
| 30 | 30 | |
| 31 | 31 | typedef void(^SuccessBlock)(NSString *h5,NSString *title); |
| ... | ... | @@ -34,6 +34,8 @@ typedef void(^FailureBlock)(NSError *error); |
| 34 | 34 | @interface CNUserAgreementManager : NSObject |
| 35 | 35 | + (void)getAgreementH5WithType:(CNGetAgreementH5Type)type success:(SuccessBlock)success failure:(FailureBlock)failure; |
| 36 | 36 | |
| 37 | ++ (void)jumpToAgreementWebWithType:(CNGetAgreementH5Type)type; | |
| 38 | + | |
| 37 | 39 | @end |
| 38 | 40 | |
| 39 | 41 | NS_ASSUME_NONNULL_END | ... | ... |
CNLiveUserAgreementManager/Classes/CNUserAgreementManager.m
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | #import "CNUserAgreementManager.h" |
| 10 | 10 | #import <CNLiveRequestBastKit/CNLiveNetworking.h> |
| 11 | -#import "CNLiveEnvironmentConfiguration.h" | |
| 11 | +#import "CNLiveEnvironment.h" | |
| 12 | 12 | |
| 13 | 13 | @interface CNUserAgreementManager() |
| 14 | 14 | |
| ... | ... | @@ -202,6 +202,16 @@ static CNUserAgreementManager *_instance = nil; |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | break; |
| 205 | + case CNAgreementBuyAudio: | |
| 206 | + { | |
| 207 | + if ([[NSString stringWithFormat:@"%@",dic[@"type"]] isEqualToString:@"ypxy"]) { | |
| 208 | + if (success) { | |
| 209 | + success(dic[@"detailUrl"],dic[@"title"]); | |
| 210 | + return ; | |
| 211 | + } | |
| 212 | + } | |
| 213 | + } | |
| 214 | + break; | |
| 205 | 215 | default: |
| 206 | 216 | break; |
| 207 | 217 | } |
| ... | ... | @@ -228,4 +238,23 @@ static CNUserAgreementManager *_instance = nil; |
| 228 | 238 | |
| 229 | 239 | } |
| 230 | 240 | |
| 241 | + | |
| 242 | ++ (void)jumpToAgreementWebWithType:(CNGetAgreementH5Type)type{ | |
| 243 | + | |
| 244 | + __weak typeof(self) weakSelf = self; | |
| 245 | + [[CNUserAgreementManager shared] getAgreementH5WithType:type success:^(NSString * _Nonnull h5, NSString * _Nonnull title) { | |
| 246 | + __strong typeof(self) strongSelf = weakSelf; | |
| 247 | + | |
| 248 | + | |
| 249 | + } failure:^(NSError * _Nonnull error) { | |
| 250 | + __strong typeof(self) strongSelf = weakSelf; | |
| 251 | + | |
| 252 | + if(TestEnvironment){ | |
| 253 | + NSLog(@"获取协议请求失败"); | |
| 254 | + } | |
| 255 | + | |
| 256 | + }]; | |
| 257 | + | |
| 258 | +} | |
| 259 | + | |
| 231 | 260 | @end | ... | ... |
Example/CNLiveUserAgreementManager.xcodeproj/project.pbxproj
| ... | ... | @@ -226,7 +226,6 @@ |
| 226 | 226 | 6003F5AA195388D20070C39A /* Sources */, |
| 227 | 227 | 6003F5AB195388D20070C39A /* Frameworks */, |
| 228 | 228 | 6003F5AC195388D20070C39A /* Resources */, |
| 229 | - D2AAC06DA362E1B3EB74E364 /* [CP] Embed Pods Frameworks */, | |
| 230 | 229 | ); |
| 231 | 230 | buildRules = ( |
| 232 | 231 | ); |
| ... | ... | @@ -306,8 +305,9 @@ |
| 306 | 305 | inputFileListPaths = ( |
| 307 | 306 | ); |
| 308 | 307 | inputPaths = ( |
| 309 | - "${SRCROOT}/Pods/Target Support Files/Pods-CNLiveUserAgreementManager_Example/Pods-CNLiveUserAgreementManager_Example-frameworks.sh", | |
| 308 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveUserAgreementManager_Example/Pods-CNLiveUserAgreementManager_Example-frameworks.sh", | |
| 310 | 309 | "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", |
| 310 | + "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", | |
| 311 | 311 | "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", |
| 312 | 312 | "${BUILT_PRODUCTS_DIR}/CNLiveUserAgreementManager/CNLiveUserAgreementManager.framework", |
| 313 | 313 | ); |
| ... | ... | @@ -316,12 +316,13 @@ |
| 316 | 316 | ); |
| 317 | 317 | outputPaths = ( |
| 318 | 318 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", |
| 319 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", | |
| 319 | 320 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", |
| 320 | 321 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserAgreementManager.framework", |
| 321 | 322 | ); |
| 322 | 323 | runOnlyForDeploymentPostprocessing = 0; |
| 323 | 324 | shellPath = /bin/sh; |
| 324 | - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CNLiveUserAgreementManager_Example/Pods-CNLiveUserAgreementManager_Example-frameworks.sh\"\n"; | |
| 325 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveUserAgreementManager_Example/Pods-CNLiveUserAgreementManager_Example-frameworks.sh\"\n"; | |
| 325 | 326 | showEnvVarsInLog = 0; |
| 326 | 327 | }; |
| 327 | 328 | 888A51F7B3A7616D53247CA7 /* [CP] Check Pods Manifest.lock */ = { |
| ... | ... | @@ -368,30 +369,6 @@ |
| 368 | 369 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; |
| 369 | 370 | showEnvVarsInLog = 0; |
| 370 | 371 | }; |
| 371 | - D2AAC06DA362E1B3EB74E364 /* [CP] Embed Pods Frameworks */ = { | |
| 372 | - isa = PBXShellScriptBuildPhase; | |
| 373 | - buildActionMask = 2147483647; | |
| 374 | - files = ( | |
| 375 | - ); | |
| 376 | - inputFileListPaths = ( | |
| 377 | - ); | |
| 378 | - inputPaths = ( | |
| 379 | - "${SRCROOT}/Pods/Target Support Files/Pods-CNLiveUserAgreementManager_Tests/Pods-CNLiveUserAgreementManager_Tests-frameworks.sh", | |
| 380 | - "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", | |
| 381 | - "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", | |
| 382 | - ); | |
| 383 | - name = "[CP] Embed Pods Frameworks"; | |
| 384 | - outputFileListPaths = ( | |
| 385 | - ); | |
| 386 | - outputPaths = ( | |
| 387 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", | |
| 388 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", | |
| 389 | - ); | |
| 390 | - runOnlyForDeploymentPostprocessing = 0; | |
| 391 | - shellPath = /bin/sh; | |
| 392 | - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CNLiveUserAgreementManager_Tests/Pods-CNLiveUserAgreementManager_Tests-frameworks.sh\"\n"; | |
| 393 | - showEnvVarsInLog = 0; | |
| 394 | - }; | |
| 395 | 372 | /* End PBXShellScriptBuildPhase section */ |
| 396 | 373 | |
| 397 | 374 | /* Begin PBXSourcesBuildPhase section */ | ... | ... |
Example/Podfile
| ... | ... | @@ -6,13 +6,9 @@ platform :ios, '9.0' |
| 6 | 6 | |
| 7 | 7 | target 'CNLiveUserAgreementManager_Example' do |
| 8 | 8 | pod 'CNLiveUserAgreementManager', :path => '../' |
| 9 | - pod 'CNLiveRequestBastKit' | |
| 10 | - pod 'CNLiveEnvironmentConfiguration' | |
| 11 | 9 | |
| 12 | 10 | target 'CNLiveUserAgreementManager_Tests' do |
| 13 | 11 | inherit! :search_paths |
| 14 | - pod 'CNLiveRequestBastKit' | |
| 15 | - pod 'CNLiveEnvironmentConfiguration' | |
| 16 | 12 | |
| 17 | 13 | end |
| 18 | 14 | end | ... | ... |