Commit 1d8d6635818734ab28ccf78e3192483214c9c82d

Authored by guoruipeng
1 parent 17b1863a

no message

CNLiveBusinessTools.podspec
@@ -28,7 +28,7 @@ Pod::Spec.new do |s| @@ -28,7 +28,7 @@ Pod::Spec.new do |s|
28 s.source = { :git => 'http://bj.gitlab.cnlive.com/ios-team/CNLiveBusinessTools.git', :tag => s.version.to_s } 28 s.source = { :git => 'http://bj.gitlab.cnlive.com/ios-team/CNLiveBusinessTools.git', :tag => s.version.to_s }
29 # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' 29 # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
30 30
31 - s.ios.deployment_target = '8.0' 31 + s.ios.deployment_target = '9.0'
32 32
33 s.source_files = 'CNLiveBusinessTools/Classes/**/*' 33 s.source_files = 'CNLiveBusinessTools/Classes/**/*'
34 34
@@ -38,5 +38,7 @@ Pod::Spec.new do |s| @@ -38,5 +38,7 @@ Pod::Spec.new do |s|
38 38
39 # s.public_header_files = 'Pod/Classes/**/*.h' 39 # s.public_header_files = 'Pod/Classes/**/*.h'
40 s.frameworks = 'UIKit', 'MapKit','Photos' 40 s.frameworks = 'UIKit', 'MapKit','Photos'
41 - # s.dependency 'AFNetworking', '~> 2.3' 41 + s.dependency 'CNLiveEnvironmentConfiguration'
  42 + s.dependency 'CNLiveUserManagement'
  43 +
42 end 44 end
CNLiveBusinessTools/Classes/CNLiveBusinessTools.h
@@ -49,6 +49,11 @@ typedef NS_ENUM(NSInteger, CNFileType) { @@ -49,6 +49,11 @@ typedef NS_ENUM(NSInteger, CNFileType) {
49 //通过文件后缀名判断是否为可读文件 49 //通过文件后缀名判断是否为可读文件
50 + (CNFileType)isReadedFileByType:(NSString *)suffixType; 50 + (CNFileType)isReadedFileByType:(NSString *)suffixType;
51 #pragma mark -- 51 #pragma mark --
  52 +#pragma mark -- 拼接需要的参数
  53 ++ (NSString *)uuid;
  54 ++ (NSString *)getSpid;
  55 ++ (NSString *)getSidIdfv;
  56 +#pragma mark --
52 @end 57 @end
53 58
54 NS_ASSUME_NONNULL_END 59 NS_ASSUME_NONNULL_END
CNLiveBusinessTools/Classes/CNLiveBusinessTools.m
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 7
8 #import "CNLiveBusinessTools.h" 8 #import "CNLiveBusinessTools.h"
9 #import <Photos/Photos.h> 9 #import <Photos/Photos.h>
  10 +#import <CNLiveEnvironmentConfiguration/CNLiveEnvironmentConfiguration.h>
  11 +#import <CNLiveUserManagement/CNUserInfoManager.h>
10 12
11 @implementation CNLiveBusinessTools 13 @implementation CNLiveBusinessTools
12 14
@@ -253,4 +255,37 @@ @@ -253,4 +255,37 @@
253 }; 255 };
254 return dic; 256 return dic;
255 } 257 }
  258 +
  259 ++ (NSString *)getSpid
  260 +{
  261 + NSString *spId = @"";
  262 + NSArray *array = [AppId componentsSeparatedByString:@"_"];
  263 + spId = [array firstObject];
  264 + return spId;
  265 +}
  266 ++ (NSString *)getSidIdfv
  267 +{
  268 + NSString *idfv = [self uuid];
  269 + NSString *uid = @"";
  270 + if ([CNUserShareManager isLogin]) {
  271 + uid = CNUserShareModel.uid;
  272 + }
  273 + NSString *sidIdfv = [NSString stringWithFormat:@"%@%@",uid,idfv];
  274 + // NSLog(@"sidIdfv:%@",sidIdfv);
  275 + return sidIdfv;
  276 +}
  277 +
  278 ++ (NSString *)uuid{
  279 + NSString *uid = @"";
  280 + NSUserDefaults *defauts = [NSUserDefaults standardUserDefaults];
  281 + if ([defauts objectForKey:@"kCNLiveUserDefaultsTingYunUIDKey"]) {
  282 + uid = [[defauts objectForKey:@"kCNLiveUserDefaultsTingYunUIDKey"] copy];
  283 + return uid;
  284 + } else {
  285 + NSString *idfv = [[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""];
  286 + [defauts setObject:idfv forKey:@"kCNLiveUserDefaultsTingYunUIDKey"];
  287 + [defauts synchronize];
  288 + }
  289 + return uid;
  290 +}
256 @end 291 @end
Example/CNLiveBusinessTools.xcodeproj/project.pbxproj
@@ -351,12 +351,16 @@ @@ -351,12 +351,16 @@
351 inputPaths = ( 351 inputPaths = (
352 "${PODS_ROOT}/Target Support Files/Pods-CNLiveBusinessTools_Example/Pods-CNLiveBusinessTools_Example-frameworks.sh", 352 "${PODS_ROOT}/Target Support Files/Pods-CNLiveBusinessTools_Example/Pods-CNLiveBusinessTools_Example-frameworks.sh",
353 "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework", 353 "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework",
  354 + "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework",
  355 + "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework",
354 ); 356 );
355 name = "[CP] Embed Pods Frameworks"; 357 name = "[CP] Embed Pods Frameworks";
356 outputFileListPaths = ( 358 outputFileListPaths = (
357 ); 359 );
358 outputPaths = ( 360 outputPaths = (
359 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework", 361 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework",
  362 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework",
  363 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework",
360 ); 364 );
361 runOnlyForDeploymentPostprocessing = 0; 365 runOnlyForDeploymentPostprocessing = 0;
362 shellPath = /bin/sh; 366 shellPath = /bin/sh;
Example/Podfile
  1 +source 'http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git'
  2 +source 'https://github.com/CocoaPods/Specs.git'
  3 +
1 use_frameworks! 4 use_frameworks!
2 5
3 -platform :ios, '8.0' 6 +platform :ios, '9.0'
4 7
5 target 'CNLiveBusinessTools_Example' do 8 target 'CNLiveBusinessTools_Example' do
6 pod 'CNLiveBusinessTools', :path => '../' 9 pod 'CNLiveBusinessTools', :path => '../'
7 - 10 + pod 'MJExtension'
8 target 'CNLiveBusinessTools_Tests' do 11 target 'CNLiveBusinessTools_Tests' do
9 inherit! :search_paths 12 inherit! :search_paths
10 13