diff --git a/Demo/.DS_Store b/Demo/.DS_Store index dbb80f8fe3f16b5cec89210e7d7393980106cccc..007a2c8061a340742cf5a47d4f906458841b4d8f 100644 Binary files a/Demo/.DS_Store and b/Demo/.DS_Store differ diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index 535d96b24e46127a8e5c75315e158da1dc4b4178..2cf24b02353ddf8be732a0566b6a4f02a1527bb0 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -27,13 +27,14 @@ 77303F6722F98A3A00A51176 /* Advertisement.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 77303F6622F98A3A00A51176 /* Advertisement.mp4 */; }; 77303F6A22F98F2D00A51176 /* landingPageIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 77303F6922F98F2D00A51176 /* landingPageIcon.png */; }; 7781CA6122C4BBD1002805DB /* sdkconfig.xml in Resources */ = {isa = PBXBuildFile; fileRef = 7781CA6022C4BBD1002805DB /* sdkconfig.xml */; }; - 77BDFC3F230D44BF00079FDF /* libMobileTrackingSimulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABB195518DAFA0300C7CAA9 /* libMobileTrackingSimulator.a */; }; AF353EDF1CFC24FB00969035 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF353EDE1CFC24FB00969035 /* AdSupport.framework */; }; AF4B464B218AB16400BE2F3F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF353EE01CFC251C00969035 /* SystemConfiguration.framework */; }; AF4B464C218AB18300BE2F3F /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF353ED91CFC24E400969035 /* CoreLocation.framework */; }; AF6EA2E51EF655AD000DF811 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AF6EA2E41EF655AD000DF811 /* Images.xcassets */; }; AF7D89611EF655F50069A7DC /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AF7D89601EF655F50069A7DC /* Launch Screen.storyboard */; }; AFB3717E1F3854E10092930F /* admaster.js in Resources */ = {isa = PBXBuildFile; fileRef = AFB3717D1F3854E10092930F /* admaster.js */; }; + C765ABEC23262CDA0066E906 /* libMobileTrackingSimulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABB195518DAFA0300C7CAA9 /* libMobileTrackingSimulator.a */; }; + C765ABED23262CE00066E906 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C765ABE923262CC20066E906 /* WebKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -114,6 +115,7 @@ AF6EA2E41EF655AD000DF811 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; AF7D89601EF655F50069A7DC /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; AFB3717D1F3854E10092930F /* admaster.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = admaster.js; sourceTree = ""; }; + C765ABE923262CC20066E906 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -121,7 +123,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 77BDFC3F230D44BF00079FDF /* libMobileTrackingSimulator.a in Frameworks */, + C765ABED23262CE00066E906 /* WebKit.framework in Frameworks */, + C765ABEC23262CDA0066E906 /* libMobileTrackingSimulator.a in Frameworks */, AF4B464C218AB18300BE2F3F /* CoreLocation.framework in Frameworks */, AF4B464B218AB16400BE2F3F /* SystemConfiguration.framework in Frameworks */, AF353EDF1CFC24FB00969035 /* AdSupport.framework in Frameworks */, @@ -164,6 +167,7 @@ 2A0C4E1C18D6D18700200F18 /* Frameworks */ = { isa = PBXGroup; children = ( + C765ABE923262CC20066E906 /* WebKit.framework */, AF2DFF4021955F0300B10C3F /* libxml2.tbd */, AF353EE01CFC251C00969035 /* SystemConfiguration.framework */, AF353EDE1CFC24FB00969035 /* AdSupport.framework */, @@ -294,7 +298,7 @@ TargetAttributes = { 2A0C4E1918D6D18700200F18 = { DevelopmentTeam = 44PQ7EUSW9; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.AccessWiFi = { enabled = 0; @@ -546,9 +550,9 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer: Jian Wu (G946Z272GF)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Jian Wu (G946Z272GF)"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 44PQ7EUSW9; ENABLE_BITCODE = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -570,8 +574,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.test.abcde; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "97e98d37-8685-4f3a-96ce-cd9d04f6286a"; - PROVISIONING_PROFILE_SPECIFIER = Develop; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 arm64"; WRAPPER_EXTENSION = app; @@ -583,9 +587,9 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer: Jian Wu (G946Z272GF)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Jian Wu (G946Z272GF)"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 44PQ7EUSW9; ENABLE_BITCODE = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -607,8 +611,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.test.abcde; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "97e98d37-8685-4f3a-96ce-cd9d04f6286a"; - PROVISIONING_PROFILE_SPECIFIER = Develop; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 arm64"; WRAPPER_EXTENSION = app; diff --git a/MobileTracking/.DS_Store b/MobileTracking/.DS_Store index e1e1cc6b29b660de4a6e1d8a5ebc66beebc1396f..75106d4601851c70c24acdfd5cb79a85aae0bdf4 100644 Binary files a/MobileTracking/.DS_Store and b/MobileTracking/.DS_Store differ diff --git a/MobileTracking/JSViewAbility/VACacheWebView.h b/MobileTracking/JSViewAbility/VACacheWebView.h index 9f333b9279ac478e3fdfa13279e907d6133b5f77..b138143c0ec806265b6691002131a58a4ca397d5 100644 --- a/MobileTracking/JSViewAbility/VACacheWebView.h +++ b/MobileTracking/JSViewAbility/VACacheWebView.h @@ -7,10 +7,10 @@ // #import - +#import @interface VACacheWebView : NSObject + (void)start; -+ (UIWebView *)getWebView; ++ (WKWebView *)getWebView; @end diff --git a/MobileTracking/JSViewAbility/VACacheWebView.m b/MobileTracking/JSViewAbility/VACacheWebView.m index 55e4e7aaefafe209237a4072d9b2e1d13f453a4e..d4287c535d4c1ce3db94238fa1036444a6d86532 100644 --- a/MobileTracking/JSViewAbility/VACacheWebView.m +++ b/MobileTracking/JSViewAbility/VACacheWebView.m @@ -32,13 +32,15 @@ static dispatch_queue_t _webViewQueue; } + (void)generateWebView { - UIWebView *webView = [[UIWebView alloc] init]; + WKWebView *webView = [[WKWebView alloc] init]; + + [_canUsedWebViews addObject:webView]; } -+ (UIWebView *)getWebView { - __block UIWebView *webView; ++ (WKWebView *)getWebView { + __block WKWebView *webView; dispatch_sync(_webViewQueue, ^{ if(!_canUsedWebViews.count) { dispatch_sync(dispatch_get_main_queue(), ^{ diff --git a/MobileTracking/JSViewAbility/VACompanyRun.m b/MobileTracking/JSViewAbility/VACompanyRun.m index 64a33b9675a08cecdc79eafa96b7ec394b4b056f..279bdfe953ac83331fddd7998e85a383d95a4425 100644 --- a/MobileTracking/JSViewAbility/VACompanyRun.m +++ b/MobileTracking/JSViewAbility/VACompanyRun.m @@ -15,10 +15,10 @@ #import "VAJSMaros.h" #import "VACacheWebView.h" #import "MMA_Macro.h" - +#import @interface VACompanyRun () -@property (nonatomic, strong) UIWebView *webView; +@property (nonatomic, strong) WKWebView *webView; @property (nonatomic, strong) NSMutableDictionary *captureObjs; @property (nonatomic, strong) VAJavascriptBridge *jsBridge; @@ -57,8 +57,10 @@ static const char *data_send_queue = "adview.jsmonitor.dataSend.queue"; }]; - - [self.webView loadHTMLString:html baseURL:[[NSBundle mainBundle] bundleURL]]; + + [self.webView loadHTMLString:html baseURL:[[NSBundle mainBundle] bundleURL]]; + + _dataHandleQueue = dispatch_queue_create(data_handle_queue, DISPATCH_QUEUE_CONCURRENT); diff --git a/MobileTracking/JSViewAbility/VAJavascriptBridge.h b/MobileTracking/JSViewAbility/VAJavascriptBridge.h index 7f6fb6d2df0d422fe7614d42810830ed90dee9a7..18569d8e23318dc954f8231741a4c665109a4c49 100644 --- a/MobileTracking/JSViewAbility/VAJavascriptBridge.h +++ b/MobileTracking/JSViewAbility/VAJavascriptBridge.h @@ -7,7 +7,7 @@ // #import - +#import @protocol VAJavascriptBridgeProtocol - (void)stopViewability:(NSString *)url; - (void)saveJSCacheData:(NSString *)data; @@ -19,7 +19,7 @@ @property (nonatomic, copy) void(^webFinishBlock)(); -- (instancetype)initWithWebView:(UIWebView *)webView delegate:(id ) delegate; +- (instancetype)initWithWebView:(WKWebView *)webView delegate:(id ) delegate; - (void)sendViewabilityMessage:(NSString *)viewabilityMessage; - (void)sendCacheMessage:(NSString *)cacheViewabilityMessage; diff --git a/MobileTracking/JSViewAbility/VAJavascriptBridge.m b/MobileTracking/JSViewAbility/VAJavascriptBridge.m index 78e0775d4e3a09bd22a2646775627b14833c7235..f52d0bb3afe71f0d71e3e85b3aa967ead4eb6397 100644 --- a/MobileTracking/JSViewAbility/VAJavascriptBridge.m +++ b/MobileTracking/JSViewAbility/VAJavascriptBridge.m @@ -11,20 +11,25 @@ #import "VAJavascriptParse.h" #import "VAJSMaros.h" -@interface VAJavascriptBridge () +@interface VAJavascriptBridge () -@property (nonatomic, weak) UIWebView *webView; +@property (nonatomic, weak) WKWebView *webView; @property (nonatomic, weak) id delegate; @end @implementation VAJavascriptBridge -- (instancetype)initWithWebView:(UIWebView *)webView delegate:(id ) delegate { +- (instancetype)initWithWebView:(WKWebView *)webView delegate:(id ) delegate { if(self = [super init]) { self.webView = webView; - self.webView.delegate = self; + + + self.webView.navigationDelegate = self; + + + self.delegate = delegate; // 线程保护: 3s 没有返回自动resume dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @@ -46,38 +51,51 @@ t++; NSString *url = [NSString stringWithFormat:@"MMASDK.sendViewabilityMessage(JSON.stringify(%@))",viewabilityMessage]; dispatch_async(dispatch_get_main_queue(), ^{ - [self.webView stringByEvaluatingJavaScriptFromString:url]; + [self.webView evaluateJavaScript:url completionHandler:nil]; }); } - (void)sendCacheMessage:(NSString *)cacheViewabilityMessage { NSString *url = [NSString stringWithFormat:@"MMASDK.sendCacheMessage(JSON.stringify(%@))",cacheViewabilityMessage]; dispatch_async(dispatch_get_main_queue(), ^{ - [self.webView stringByEvaluatingJavaScriptFromString:url]; + [self.webView evaluateJavaScript:url completionHandler:nil]; }); } -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ - VAJavascriptParse *parse = [[VAJavascriptParse alloc] initWithURL:request.URL withResponder:_delegate]; +- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(nonnull void (^)(WKNavigationActionPolicy))decisionHandler{ + + VAJavascriptParse *parse = [[VAJavascriptParse alloc] initWithURL:navigationAction.request.URL withResponder:_delegate]; NSLog(@"拦截到:%@",NSStringFromSelector(parse.action)); + [parse isVaildParse]?decisionHandler(WKNavigationActionPolicyCancel):decisionHandler(WKNavigationActionPolicyAllow); + + +} - return ![parse isVaildParse]; +//- (BOOL)webView:(WKWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(WKWebViewNavigationType)navigationType{ +// VAJavascriptParse *parse = [[VAJavascriptParse alloc] initWithURL:request.URL withResponder:_delegate]; +// NSLog(@"拦截到:%@",NSStringFromSelector(parse.action)); +// +// return ![parse isVaildParse]; +//} +-(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{ + NSLog(@"webViewdidStrat"); + } -- (void)webViewDidStartLoad:(UIWebView *)webView{ - NSLog(@"webViewDidStartLoad"); +- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation{ + NSLog(@"webViewdidCommit"); + } - -- (void)webViewDidFinishLoad:(UIWebView *)webView{ +-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{ NSLog(@"webViewDidFinishLoad"); if(self.webFinishBlock) { _webFinishBlock(); _webFinishBlock = nil; } - + } - -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{ +-(void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error{ + NSLog(@"didFailLoadWithError"); if(self.webFinishBlock) { _webFinishBlock(); @@ -85,6 +103,8 @@ } } + + - (void)dealloc { NSLog(@"VACompanyRun Dealloc"); } diff --git a/MobileTracking/MobileTracking.xcodeproj/project.pbxproj b/MobileTracking/MobileTracking.xcodeproj/project.pbxproj index 4e2f7fe3003119ce1d13ee17518090b1e716b323..f5515b2223780871a6d790121bcc4f5d3af5aecf 100755 --- a/MobileTracking/MobileTracking.xcodeproj/project.pbxproj +++ b/MobileTracking/MobileTracking.xcodeproj/project.pbxproj @@ -116,6 +116,9 @@ AFB3717C1F3854770092930F /* ViewabilityJSService.m in Sources */ = {isa = PBXBuildFile; fileRef = AFB3716A1F3854770092930F /* ViewabilityJSService.m */; }; AFB87D332004BAA000A02E0C /* libMMASign.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AFB87D322004BA9E00A02E0C /* libMMASign.a */; }; AFB87D342004BAA100A02E0C /* libMMASign.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AFB87D322004BA9E00A02E0C /* libMMASign.a */; }; + C765ABE023262B660066E906 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C765ABDF23262B660066E906 /* WebKit.framework */; }; + C765ABE123262B710066E906 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C765ABDF23262B660066E906 /* WebKit.framework */; }; + C765ABE223262C040066E906 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C765ABDF23262B660066E906 /* WebKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -248,6 +251,7 @@ AFB371691F3854770092930F /* ViewabilityJSService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewabilityJSService.h; sourceTree = ""; }; AFB3716A1F3854770092930F /* ViewabilityJSService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewabilityJSService.m; sourceTree = ""; }; AFB87D322004BA9E00A02E0C /* libMMASign.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libMMASign.a; sourceTree = ""; }; + C765ABDF23262B660066E906 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -255,6 +259,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C765ABE023262B660066E906 /* WebKit.framework in Frameworks */, 2ABFE29818CF2B5F007BD457 /* CoreLocation.framework in Frameworks */, 2ABFE28218CF1778007BD457 /* UIKit.framework in Frameworks */, AFB87D332004BAA000A02E0C /* libMMASign.a in Frameworks */, @@ -267,6 +272,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C765ABE223262C040066E906 /* WebKit.framework in Frameworks */, 2A632A3018CEB10B00BE2533 /* libMobileTrackingDevice.a in Frameworks */, 2A632A2A18CEB10B00BE2533 /* XCTest.framework in Frameworks */, 2A632A2B18CEB10B00BE2533 /* Foundation.framework in Frameworks */, @@ -277,6 +283,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C765ABE123262B710066E906 /* WebKit.framework in Frameworks */, 2A81721118DAEB3A00E0EFEC /* CoreLocation.framework in Frameworks */, 2A81721218DAEB3A00E0EFEC /* UIKit.framework in Frameworks */, AFB87D342004BAA100A02E0C /* libMMASign.a in Frameworks */, @@ -312,6 +319,7 @@ 2A632A1A18CEB10B00BE2533 /* Frameworks */ = { isa = PBXGroup; children = ( + C765ABDF23262B660066E906 /* WebKit.framework */, 2ABFE29718CF2B5F007BD457 /* CoreLocation.framework */, 2ABFE28118CF1778007BD457 /* UIKit.framework */, 2ABFE27F18CF176D007BD457 /* AdSupport.framework */, @@ -805,7 +813,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -824,9 +832,9 @@ "$(inherited)", /usr/include/libxml2, ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = NO; - OTHER_CFLAGS = "-fembed-bitcode"; + OTHER_CFLAGS = ""; OTHER_LDFLAGS = "-lxml2"; SDKROOT = iphoneos; VALID_ARCHS = "armv7 armv7s arm64"; @@ -854,7 +862,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; - ENABLE_BITCODE = YES; + ENABLE_BITCODE = NO; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -867,9 +875,9 @@ "$(inherited)", /usr/include/libxml2, ); - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = NO; - OTHER_CFLAGS = "-fembed-bitcode"; + OTHER_CFLAGS = ""; OTHER_LDFLAGS = "-lxml2"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; @@ -932,6 +940,7 @@ 2A632A3F18CEB10B00BE2533 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -948,6 +957,7 @@ "$(inherited)", "$(PROJECT_DIR)/MobileTracking/EncryptModule", ); + OTHER_CFLAGS = "-fembed-bitcode"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xctest; }; @@ -956,6 +966,7 @@ 2A632A4018CEB10B00BE2533 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -968,6 +979,7 @@ "$(inherited)", "$(PROJECT_DIR)/MobileTracking/EncryptModule", ); + OTHER_CFLAGS = "-fembed-bitcode"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xctest; }; diff --git a/MobileTracking/MobileTracking/MMA_Macro.h b/MobileTracking/MobileTracking/MMA_Macro.h index 8a93ca99498d759131e50c8cb620141e3470bf17..3fedd69717127105412ce39df723f7d97f8efa14 100755 --- a/MobileTracking/MobileTracking/MMA_Macro.h +++ b/MobileTracking/MobileTracking/MMA_Macro.h @@ -9,7 +9,7 @@ #ifndef MobileTracking_Macro_h #define MobileTracking_Macro_h -#define MMA_SDK_VERSION @"V2.1.0" +#define MMA_SDK_VERSION @"V2.1.1" #define NOTIFICATION_VB @"viewability_notification" #define NOTIFICATION_EXPOSE @"expose_notification" diff --git a/MobileTracking/MobileTracking/MobileTracking.h b/MobileTracking/MobileTracking/MobileTracking.h index 753766f47edc7000f2e2282e8cee9452ee43fa95..b0ab15244ad322d66b47e07e32f9dd4c574e2987 100755 --- a/MobileTracking/MobileTracking/MobileTracking.h +++ b/MobileTracking/MobileTracking/MobileTracking.h @@ -6,7 +6,7 @@ // Copyright (c) 2014年 Admaster. All rights reserved. // -//#define MMA_SDK_VERSION @"V2.1.0" +//#define MMA_SDK_VERSION @"V2.1.1" #import diff --git a/MobileTracking/build.sh b/MobileTracking/build.sh index 55009cff5ea30947396281fbe2316ff7664dcfa0..273524e3fdac1f4abeb116deaad19207a67b60fd 100755 --- a/MobileTracking/build.sh +++ b/MobileTracking/build.sh @@ -1,7 +1,8 @@ CONFIGURATION="Release" -PROJECT_NAME="libMobileTrackingDevice.a" # 版本库名称 +PROJECT_NAME="libMobileTracking.a" # 版本库名称 UNIVERSAL_OUTPUTFOLDER=$(pwd)/build # 通用版本库存放目录 targetName="MobileTrackingDevice" +BUILDNAME="libMobileTrackingDevice.a" #通用连接 release 连接 sim连接 universal_path=${UNIVERSAL_OUTPUTFOLDER}/${CONFIGURATION}-universal @@ -11,10 +12,10 @@ iphonesimulator_path=${UNIVERSAL_OUTPUTFOLDER}/${CONFIGURATION}-iphonesimulator ${$targetName:?"mush set targetName"} xcodebuild -target $targetName clean # clean project -xcodebuild -target $targetName -sdk iphoneos12.2 # build iphoneos +xcodebuild -target $targetName -sdk iphoneos12.4 # build iphoneos #build iphonesimulator -xcodebuild -target $targetName -configuration ${CONFIGURATION} -sdk iphonesimulator12.2 -arch x86_64 -arch i386 +xcodebuild -target $targetName -configuration ${CONFIGURATION} -sdk iphonesimulator12.4 -arch x86_64 -arch i386 if [ ! -d "$universal_path" ]; then #判断文件是否存在 不存在创建 中括号两边要空格 mkdir "$universal_path" @@ -22,7 +23,10 @@ fi echo # 合并版本库 -lipo -create -output "${universal_path}/${PROJECT_NAME}" "${iphoneos_path}/${PROJECT_NAME}" "${iphonesimulator_path}/${PROJECT_NAME}" +lipo -create -output "${universal_path}/${PROJECT_NAME}" "${iphoneos_path}/${BUILDNAME}" "${iphonesimulator_path}/${BUILDNAME}" + +mv "${iphoneos_path}/${BUILDNAME}" "${iphoneos_path}/${PROJECT_NAME}" +mv "${iphonesimulator_path}/${BUILDNAME}" "${iphonesimulator_path}/${PROJECT_NAME}" cp -R "${iphoneos_path}/include" "$universal_path/" # open $universal_path diff --git a/OutputRelease/libMobileTracking.a b/OutputRelease/libMobileTracking.a index 3673dfb0f194a9e7944b6e75acd507d468a4160f..984213e728a9ccfb3bc89c613341e0d88d3e4411 100644 Binary files a/OutputRelease/libMobileTracking.a and b/OutputRelease/libMobileTracking.a differ diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 0500d1b35b85c46cbe770b536de1e7d96ea81818..e0613366948accf8ae65b36032ad28c0ecc0b604 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -## MMA iOS SDK 部署指南 +## 数字广告监测及验证统一SDK 部署指南(iOS) -### 步骤1:添加 MMA iOS SDK 到工程中 +### 步骤1:添加 iOS SDK 到工程中 1. 将SDK发布文件中,release目录下的**MobileTracking.h** 、**libMobileTracking.a**、**sdkconfig.xml** 三个文件拷贝到项目工程中,将 **sdkconfig.xml** 上传到 web 服务器,使其可以通过 web 方式访问,假设其地址为 **http://xxxxxx.com/sdkconfig.xml**(其后会用到)。 2. 在项目工程 App 的 Target Build Settings 中的 **Other Linker Flags** 选项里添加 **-lxml2** **-all_load** 或 **-lxml2** **-force_load** 静态库的绝对路径 @@ -13,10 +13,11 @@ AdSupport.framework CoreTelephony.framework SystemConfiguration.framework + WebKit.framework ``` -### 步骤2:配置文件sdkconfig.xml的使用方法 +### 步骤2:使用方法 在使用的文件中引用 **#import "MobileTracking.h"**. @@ -43,8 +44,8 @@ SDK 会自动下载远程的配置文件,使用最新的配置文件进行参 通过调用以下的代码进行曝光的监测, * view:参数为第三方公司的监测地址 - * ad:参数为当前广告视图对象(**可视化广告监测为必传字段,普通广告监测默认缺省。**) - * videoPlayType:参数为当前视频广告的播放类型(**视频可视化广告监测为可选字段,1-自动播放,2-手动播放,0-无法识别。**) + * ad:参数为当前广告视图对象(**广告可见曝光监测为必传字段,普通广告监测默认缺省。**) + * videoPlayType:参数为当前视频广告的播放类型(**视频广告可见曝光监测为可选字段,1-自动播放,2-手动播放,0-无法识别。**) * impressionType:参数为曝光的类型。(**普通广告监测的类型为必选字段,0-Tracked ads,1-曝光**) 3.1 曝光监测 diff --git "a/\347\211\271\345\210\253\347\211\210/Bitcode/iphoneos/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/Bitcode/iphoneos/libMobileTracking.a" index 3673dfb0f194a9e7944b6e75acd507d468a4160f..5a831866b18f9835774464acf5b026c278543b18 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/Bitcode/iphoneos/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/Bitcode/iphoneos/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/Bitcode/iphonesimulator/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/Bitcode/iphonesimulator/libMobileTracking.a" index 15eb37b8e2aeb4a0f17ba60ee00377a93639c7af..c4579ac1e914eede60ea9411d36b5a9eb2751ac6 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/Bitcode/iphonesimulator/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/Bitcode/iphonesimulator/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/Bitcode/universal/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/Bitcode/universal/libMobileTracking.a" index 3673dfb0f194a9e7944b6e75acd507d468a4160f..984213e728a9ccfb3bc89c613341e0d88d3e4411 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/Bitcode/universal/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/Bitcode/universal/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/noBitcode/iphoneos/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/noBitcode/iphoneos/libMobileTracking.a" index f9ebd4fed98a52a08ee27e42ba1e33309a6568e5..1b99b909398ecf63bbc7f01d27e5ee14f3d48f8e 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/noBitcode/iphoneos/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/noBitcode/iphoneos/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/noBitcode/iphonesimulator/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/noBitcode/iphonesimulator/libMobileTracking.a" index 33c803c6adf58e0ccbbb96ac3aeea87024f84b9c..dfcb20f7742cbad9f14bdc2440e7147869d7dde5 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/noBitcode/iphonesimulator/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/noBitcode/iphonesimulator/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/noBitcode/universal/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/noBitcode/universal/libMobileTracking.a" index ed10c3a54410fe19d6d787dfae76e7382880c315..406441f5dba76275c90f74f69d6c6cbba2a4ea4b 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/noBitcode/universal/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/noBitcode/universal/libMobileTracking.a" differ