diff --git a/.DS_Store b/.DS_Store index 33a6d0e123957cfcc55309cce2ce732440b3c0b6..2d51cf27a7317501fd6e74cca8bf42da0da320df 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Demo/.DS_Store b/Demo/.DS_Store index b6068d7d9a9fc85659df862b0059ef89fb6c5193..2939364088603db97bc1e94ca6bdff1bc18ea363 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 346c2dfd470c0ad8405e8e067ad43c6b7b40948b..18612c5a7f184f09b963499418fcb3a8ab5513ce 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -33,8 +33,9 @@ AF7D89611EF655F50069A7DC /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AF7D89601EF655F50069A7DC /* Launch Screen.storyboard */; }; AFB3717E1F3854E10092930F /* admaster.js in Resources */ = {isa = PBXBuildFile; fileRef = AFB3717D1F3854E10092930F /* admaster.js */; }; C765ABED23262CE00066E906 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C765ABE923262CC20066E906 /* WebKit.framework */; }; - C77368FA23F50752005E1ACB /* sdkconfig.xml in Resources */ = {isa = PBXBuildFile; fileRef = C77368F923F50752005E1ACB /* sdkconfig.xml */; }; + C782595124ADEA04005A4B4E /* sdkconfig.xml in Resources */ = {isa = PBXBuildFile; fileRef = C782595024ADEA04005A4B4E /* sdkconfig.xml */; }; C78B6BB0236C303F0022BD30 /* libMobileTrackingSimulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABB195518DAFA0300C7CAA9 /* libMobileTrackingSimulator.a */; }; + C7E0DA1924BEAF98003D19F4 /* AppTrackingTransparency.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7E0DA1724BEAED3003D19F4 /* AppTrackingTransparency.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -69,7 +70,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 2A0C4E1A18D6D18700200F18 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 2A0C4E1A18D6D18700200F18 /* MMA测试.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MMA测试.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2A0C4E1D18D6D18700200F18 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 2A0C4E1F18D6D18700200F18 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 2A0C4E2118D6D18700200F18 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; @@ -109,8 +110,10 @@ AFB3717D1F3854E10092930F /* admaster.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = admaster.js; sourceTree = ""; }; C74B7838237557EA0031DE10 /* Photos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Photos.framework; path = System/Library/Frameworks/Photos.framework; sourceTree = SDKROOT; }; C765ABE923262CC20066E906 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; - C77368F923F50752005E1ACB /* sdkconfig.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = sdkconfig.xml; sourceTree = ""; }; + C782595024ADEA04005A4B4E /* sdkconfig.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = sdkconfig.xml; sourceTree = ""; }; C78B6BC0236C33A60022BD30 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + C7E0DA1724BEAED3003D19F4 /* AppTrackingTransparency.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppTrackingTransparency.framework; path = System/Library/Frameworks/AppTrackingTransparency.framework; sourceTree = SDKROOT; }; + C7E0DA1D24BEB206003D19F4 /* MMA测试.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "MMA测试.entitlements"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -118,6 +121,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C7E0DA1924BEAF98003D19F4 /* AppTrackingTransparency.framework in Frameworks */, C765ABED23262CE00066E906 /* WebKit.framework in Frameworks */, C78B6BB0236C303F0022BD30 /* libMobileTrackingSimulator.a in Frameworks */, AF4B464C218AB18300BE2F3F /* CoreLocation.framework in Frameworks */, @@ -153,7 +157,7 @@ 2A0C4E1B18D6D18700200F18 /* Products */ = { isa = PBXGroup; children = ( - 2A0C4E1A18D6D18700200F18 /* Demo.app */, + 2A0C4E1A18D6D18700200F18 /* MMA测试.app */, 2A0C4E3B18D6D18700200F18 /* DemoTests.xctest */, ); name = Products; @@ -162,6 +166,7 @@ 2A0C4E1C18D6D18700200F18 /* Frameworks */ = { isa = PBXGroup; children = ( + C7E0DA1724BEAED3003D19F4 /* AppTrackingTransparency.framework */, C74B7838237557EA0031DE10 /* Photos.framework */, C78B6BC0236C33A60022BD30 /* CoreMotion.framework */, C765ABE923262CC20066E906 /* WebKit.framework */, @@ -180,6 +185,7 @@ 2A0C4E2318D6D18700200F18 /* Demo */ = { isa = PBXGroup; children = ( + C7E0DA1D24BEB206003D19F4 /* MMA测试.entitlements */, 77303F6622F98A3A00A51176 /* Advertisement.mp4 */, 772E49C522F19F940009DFD2 /* videoAd.mp4 */, 77303F6922F98F2D00A51176 /* landingPageIcon.png */, @@ -195,8 +201,8 @@ 772E49B822F195980009DFD2 /* SecondViewController.xib */, 772E49BB22F1959A0009DFD2 /* VideoViewController.h */, 772E49B722F195970009DFD2 /* VideoViewController.m */, + C782595024ADEA04005A4B4E /* sdkconfig.xml */, 772E49B422F195950009DFD2 /* VideoViewController.xib */, - C77368F923F50752005E1ACB /* sdkconfig.xml */, AFB3717D1F3854E10092930F /* admaster.js */, 2A0C4E2F18D6D18700200F18 /* Main.storyboard */, AF7D89601EF655F50069A7DC /* Launch Screen.storyboard */, @@ -262,7 +268,7 @@ ); name = Demo; productName = Demo; - productReference = 2A0C4E1A18D6D18700200F18 /* Demo.app */; + productReference = 2A0C4E1A18D6D18700200F18 /* MMA测试.app */; productType = "com.apple.product-type.application"; }; 2A0C4E3A18D6D18700200F18 /* DemoTests */ = { @@ -302,7 +308,7 @@ }; }; 2A0C4E3A18D6D18700200F18 = { - DevelopmentTeam = 4E89P63KS8; + DevelopmentTeam = 44PQ7EUSW9; TestTargetID = 2A0C4E1918D6D18700200F18; }; }; @@ -362,7 +368,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C77368FA23F50752005E1ACB /* sdkconfig.xml in Resources */, + C782595124ADEA04005A4B4E /* sdkconfig.xml in Resources */, 77303F6722F98A3A00A51176 /* Advertisement.mp4 in Resources */, 772E49BD22F1959B0009DFD2 /* VideoViewController.xib in Resources */, AF6EA2E51EF655AD000DF811 /* Images.xcassets in Resources */, @@ -541,9 +547,11 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_ENTITLEMENTS = "Demo/MMA测试.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1.0; DEVELOPMENT_TEAM = 44PQ7EUSW9; ENABLE_BITCODE = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -558,15 +566,17 @@ "$(inherited)", "$(PROJECT_DIR)/Demo", ); + MARKETING_VERSION = 1.0; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-lxml2", "-all_load", ); - PRODUCT_BUNDLE_IDENTIFIER = com.test.abcde; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = com.test.abcde2; + PRODUCT_NAME = "MMA测试"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTS_MACCATALYST = NO; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 arm64"; WRAPPER_EXTENSION = app; @@ -578,9 +588,11 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_ENTITLEMENTS = "Demo/MMA测试.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1.0; DEVELOPMENT_TEAM = 44PQ7EUSW9; ENABLE_BITCODE = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -595,15 +607,17 @@ "$(inherited)", "$(PROJECT_DIR)/Demo", ); + MARKETING_VERSION = 1.0; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-lxml2", "-all_load", ); - PRODUCT_BUNDLE_IDENTIFIER = com.test.abcde; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = com.test.abcde2; + PRODUCT_NAME = "MMA测试"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTS_MACCATALYST = NO; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv7 arm64"; WRAPPER_EXTENSION = app; @@ -616,6 +630,7 @@ BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = 44PQ7EUSW9; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -641,6 +656,7 @@ BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Demo.app/Demo"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = 44PQ7EUSW9; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", diff --git a/Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/DeveWang.xcuserdatad/WorkspaceSettings.xcsettings b/Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/DeveWang.xcuserdatad/WorkspaceSettings.xcsettings index dd7403bf66e22a2b6c4af9325329f28060867051..379adbed5a64c54e605e0a7b5ec7b19fc20e53a4 100644 --- a/Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/DeveWang.xcuserdatad/WorkspaceSettings.xcsettings +++ b/Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/DeveWang.xcuserdatad/WorkspaceSettings.xcsettings @@ -12,5 +12,7 @@ ShowActiveSchemeOnly LiveSourceIssuesEnabled + ShowSharedSchemesAutomaticallyEnabled + diff --git a/Demo/Demo/AppDelegate.m b/Demo/Demo/AppDelegate.m index 2e85059332e541eac362d1cc08bb51bb4c69f9e5..561216af1bff61a63b1233d7044f52c92415410a 100755 --- a/Demo/Demo/AppDelegate.m +++ b/Demo/Demo/AppDelegate.m @@ -8,9 +8,11 @@ #import "AppDelegate.h" #import "MobileTracking.h" + //#import "ViewController.h" //#import "TabCoverViewController.h" //#import "PageViewController.h" +#import @implementation AppDelegate @@ -18,7 +20,22 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [[MobileTracking sharedInstance] enableLog:YES]; + if (@available(iOS 14, *)) { + // iOS14及以上版本需要先请求权限 + [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { + + if (status == ATTrackingManagerAuthorizationStatusAuthorized) { + NSLog(@"同意授权"); + + + }else{ + NSLog(@"被拒绝,请在设置-隐私-广告中打开广告跟踪功能"); + } + }]; + } + + + [[MobileTracking sharedInstance] enableLog:YES]; // ViewController *vc1 = [[ViewController alloc] init]; // UINavigationController *navCtrl1 = [[UINavigationController alloc] initWithRootViewController:vc1]; diff --git a/Demo/Demo/Demo-Info.plist b/Demo/Demo/Demo-Info.plist index ca3a99724b03299c703d76f3aec8d23a38e43ef3..3a85f84cb5b5a249a91e55d9ef2136e11d70f594 100755 --- a/Demo/Demo/Demo-Info.plist +++ b/Demo/Demo/Demo-Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion en CFBundleDisplayName - 测试 + $(PRODUCT_NAME) CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIcons diff --git "a/Demo/Demo/MMA\346\265\213\350\257\225.entitlements" "b/Demo/Demo/MMA\346\265\213\350\257\225.entitlements" new file mode 100644 index 0000000000000000000000000000000000000000..fc07546cfa36616a45058387c0bf48a0fd2678a7 --- /dev/null +++ "b/Demo/Demo/MMA\346\265\213\350\257\225.entitlements" @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.security.personal-information.location + + + diff --git a/Demo/Demo/NormalViewController.m b/Demo/Demo/NormalViewController.m index bca5123cdef1ccafc43e876e7fea1bf910cd2482..095967322b3a112cb1472963494d8261d24a5d29 100644 --- a/Demo/Demo/NormalViewController.m +++ b/Demo/Demo/NormalViewController.m @@ -30,7 +30,7 @@ NSString *const normalViewUrl = @"http://tyfx.m.cn.miaozhen.com/x/k=2122669&p=7P //可视化点击url -NSString *const displayClickUrl = @"http://tyfx.m.cn.miaozhen.com/x/k=2122669&p=7P5QE&dx=__IPDX__&rt=2&ns=__IP__&ni=__IESID__&v=__LOC__&xa=__ADPLATFORM__&tr=__REQUESTID__&mo=__OS__&m0=__OPENUDID__&m0a=__DUID__&m1=__ANDROIDID1__&m1a=__ANDROIDID__&m2=__IMEI__&m4=__AAID__&m5=__IDFA__&m6=__MAC1__&m6a=__MAC__&nd=__DRA__&np=__POS__&nn=__APP__&nc=__VID__&nf=__FLL__&ne=__SLL__&ng=__CTREF__&nx=__TRANSID__&o="; +NSString *const displayClickUrl = @"http://tyfx.m.cn.miaozhen.com/x/k=2128485&p=7P5QE&dx=__IPDX__&rt=2&ns=__IP__&ni=__IESID__&v=__LOC__&xa=__ADPLATFORM__&tr=__REQUESTID__&mo=__OS__&m0=__OPENUDID__&m0a=__DUID__&m1=__ANDROIDID1__&m1a=__ANDROIDID__&m2=__IMEI__&m4=__AAID__&m5=__IDFA__&m6=__MAC1__&m6a=__MAC__&nd=__DRA__&np=__POS__&nn=__APP__&nc=__VID__&nf=__FLL__&ne=__SLL__&ng=__CTREF__&nx=__TRANSID__&o="; //可视化曝光url NSString *const displayViewUrl = @"http://e.cn.miaozhen.com/r/k=2128485&p=7Q5OK&dx=__IPDX__&rt=2&ns=__IP__&ni=__IESID__&v=__LOC__&xa=__ADPLATFORM__&tr=__REQUESTID__&o="; @@ -84,7 +84,11 @@ NSString *const displayViewUrl = @"http://e.cn.miaozhen.com/r/k=2128485&p=7Q5OK& - [[MobileTracking sharedInstance] view:normalViewUrl ad:_adView impressionType:1]; + [[MobileTracking sharedInstance] view:normalViewUrl ad:_adView impressionType:1 succeed:^(NSString *eventType) { + //监测代码发送成功 + } failed:^(NSString *errorMessage) { + //监测代码发送失败 + }]; _clickUrl = [NSString stringWithFormat:@"%@", normalClickUrl]; self.title = @"曝光及点击"; @@ -96,7 +100,18 @@ NSString *const displayViewUrl = @"http://e.cn.miaozhen.com/r/k=2128485&p=7Q5OK& // 可视化曝光+可视化点击 // 可视化曝光 - [[MobileTracking sharedInstance] view:@"https://g.ads.cn.miaozhen.com/v1.1/i.gif?cp=1446&sp=51035&ad=__ADID__&adgp=__ADGPID__&cr=7788&rq=__REQUESTID__&mck=__MCOOKIE__&did=__DEVICEID__&dmp=__DMP__&rs=__RESPONSEID__&srcsp=__SOURCESP__&maca=__MAC__&maca1=__MAC1__&ta=__TA__&excl=__EXCL__&ci=__CIDX__&ig=,u" ad:_adView]; + + + [[MobileTracking sharedInstance] view:displayViewUrl ad:_adView succeed:^(NSString *eventType) { + NSLog(@"%@",eventType); + } failed:^(NSString *errorMessage) { + NSLog(@"%@",errorMessage); + }]; + + + + + _clickUrl = [NSString stringWithFormat:@"%@", displayClickUrl]; self.title = @"Display可见曝光"; @@ -114,7 +129,11 @@ NSString *const displayViewUrl = @"http://e.cn.miaozhen.com/r/k=2128485&p=7Q5OK& SecondViewController *secondVC = [[SecondViewController alloc]init]; [self.navigationController pushViewController:secondVC animated:YES]; // 点击 - [[MobileTracking sharedInstance]click:_clickUrl]; + [[MobileTracking sharedInstance]click:_clickUrl succeed:^(NSString *eventType) { + NSLog(@"%@",eventType); + } failed:^(NSString *errorMessage) { + NSLog(@"%@",errorMessage); + }]; } diff --git a/Demo/Demo/VideoViewController.m b/Demo/Demo/VideoViewController.m index 6797e8c31a4d80068a0eefb8094e7ac417b0aff3..82bfc099ea6af21ef00e4cb9b4401bb40c06696c 100644 --- a/Demo/Demo/VideoViewController.m +++ b/Demo/Demo/VideoViewController.m @@ -74,7 +74,11 @@ // 广告开始播放的情况下调用;网络的广告资源需要等资源加载成功开始播放的情况下调用 // 可视化视频曝光 - [[MobileTracking sharedInstance] viewVideo:_viewUrl ad:_avMovieView videoPlayType:_type]; + [[MobileTracking sharedInstance] viewVideo:_viewUrl ad:_avMovieView videoPlayType:_type succeed:^(NSString *eventType) { + NSLog(@"%@",eventType); + } failed:^(NSString *errorMessage) { + NSLog(@"%@",errorMessage); + }]; } @@ -140,12 +144,20 @@ self.view.tag =1; [_player play]; - [[MobileTracking sharedInstance] viewVideo:_viewUrl ad:_avMovieView videoPlayType:_type]; + [[MobileTracking sharedInstance] viewVideo:_viewUrl ad:_avMovieView videoPlayType:_type succeed:^(NSString *eventType) { + NSLog(@"%@",eventType); + } failed:^(NSString *errorMessage) { + NSLog(@"%@",errorMessage); + }]; _remindLabel.text = @"status:前贴片广告播放中..."; } else { // 可视化视频点击 - [[MobileTracking sharedInstance]click:_clickUrl]; + [[MobileTracking sharedInstance]click:_clickUrl succeed:^(NSString *eventType) { + NSLog(@"%@",eventType); + } failed:^(NSString *errorMessage) { + NSLog(@"%@",errorMessage); + }]; [_player pause]; SecondViewController *secondVC = [[SecondViewController alloc]init]; diff --git a/Demo/Demo/sdkconfig.xml b/Demo/Demo/sdkconfig.xml index d4a8aa05a6192faf486f0aaf04dbbb7f668cb330..964897061f721eaf2942ee96dfba380d34a587a4 100644 --- a/Demo/Demo/sdkconfig.xml +++ b/Demo/Demo/sdkconfig.xml @@ -184,13 +184,7 @@ true true - - - OPENUDID - o - true - true - + TERM @@ -570,13 +564,7 @@ true true - - - OPENUDID - m0 - true - true - + TERM @@ -781,398 +769,427 @@ - + + + + + isRoot + l1 + true + true + + + + isSimulator + l2 + true + true + + + + isHook + l3 + true + true + + + + isAdb + l4 + true + true + + & https://g.cn.miaozhen.com/x/k=adid + + + svl + = true - - girdsum - - - - - - - gridsumdissector.com - - - - fm6dOWUqZ - sign - - - true - - 604800 - - 1 - - md5 - raw - md5 - md5 - - - - - - - - OS - os - true - true - - - - TS - ts - true - true - - - - MAC - m - true - true - - - - - IDFA - if - true - true - - - - IMEI - im - true - true - - - - ANDROIDID - aid - true - true - - - - OAID - oa - true - true - - - - WIFI - wifi - true - true - - - - AKEY - ak - true - true - - - - ANAME - an - true - true - - - - - SCWH - scwh - true - true - - - - - WIFISSID - wfssid - true - true - - - - WIFIBSSID - wfbssid - true - true - - - - OPENUDID - oid - true - true - - - - TERM - term - true - true - - - - OSVS - osvs - true - true - - - - LBS - lbs - true - true - - - - MUID - mid - true - true - - - - MUDS - muds - true - true - - - - REDIRECTURL - u - true - true - - - SDKVS - sdkvs - true - true - - - - - - start - event=start - true - - - - end - event=end - true - - - - - - - Adplacement - ap - false - false - - - - - - - ImpressionID - viid - true - true - - - - - ImpressionType - vitype - true - true - - - - AdviewabilityRecord - vir - true - true - - - - AdviewabilityEvents - ve - true - true - - - - AdviewabilityTime - vts - true - true - - - - AdviewabilityFrame - vf - true - true - - - - AdviewabilityPoint - vp - true - true - - - - AdviewabilityAlpha - va - true - true - - - - AdviewabilityShown - vs - true - true - - - - AdviewabilityCoverRate - vc - true - true - - - - AdviewabilityShowFrame - vsf - true - true - - - - AdviewabilityLight - vl - true - true - - - - AdviewabilityForground - vfg - true - true - - - - Adviewability - vab - true - true - - - - AdMeasurability - vm - true - true - - - - AdviewabilityResult - vr - true - true - - - - - - - AdviewabilityConfigArea - vca - true - true - - - - AdviewabilityConfigThreshold - vct - true - true - - - - AdviewabilityVideoDuration - vcvd - true - true - - - - AdviewabilityVideoProgress - vcvp - true - true - - - - AdviewabilityVideoPlayType - vcpt - true - true - - - - AdviewabilityVideoProgressPoint - vcpp - true - true - - 18ri - - AdviewabilityStrongInteract - vcsi - true - true - - - - & - - = - - true - + + girdsum + + + + + + + gridsumdissector.com + + + + fm6dOWUqZ + sign + + + true + + 604800 + + 1 + + md5 + raw + md5 + md5 + + + + + + + + OS + os + true + true + + + + TS + ts + true + true + + + + MAC + m + true + true + + + + + IDFA + if + true + true + + + + IMEI + im + true + true + + + + ANDROIDID + aid + true + true + + + + OAID + oa + true + true + + + + WIFI + wifi + true + true + + + + AKEY + ak + true + true + + + + ANAME + an + true + true + + + + + SCWH + scwh + true + true + + + + + WIFISSID + wfssid + true + true + + + + WIFIBSSID + wfbssid + true + true + + + + + + TERM + term + true + true + + + + OSVS + osvs + true + true + + + + LBS + lbs + true + true + + + + MUID + mid + true + true + + + + MUDS + muds + true + true + + + + REDIRECTURL + u + true + true + + + SDKVS + sdkvs + true + true + + + + + + start + event=start + true + + + + end + event=end + true + + + + + + + Adplacement + ap + false + false + + + + + + + ImpressionID + viid + true + true + + + + + ImpressionType + vitype + true + true + + + + AdviewabilityRecord + vir + true + true + + + + AdviewabilityEvents + ve + true + true + + + + AdviewabilityTime + vts + true + true + + + + AdviewabilityFrame + vf + true + true + + + + AdviewabilityPoint + vp + true + true + + + + AdviewabilityAlpha + va + true + true + + + + AdviewabilityShown + vs + true + true + + + + AdviewabilityCoverRate + vc + true + true + + + + AdviewabilityShowFrame + vsf + true + true + + + + AdviewabilityLight + vl + true + true + + + + AdviewabilityForground + vfg + true + true + + + + Adviewability + vab + true + true + + + + AdMeasurability + vm + true + true + + + + AdviewabilityResult + vr + true + true + + + + + + + AdviewabilityConfigArea + vca + true + true + + + + AdviewabilityConfigThreshold + vct + true + true + + + + AdviewabilityVideoDuration + vcvd + true + true + + + + AdviewabilityVideoProgress + vcvp + true + true + + + + AdviewabilityVideoPlayType + vcpt + true + true + + + + AdviewabilityVideoProgressPoint + vcpp + true + true + + 18ri + + AdviewabilityStrongInteract + vcsi + true + true + + + + & + + = + + true + @@ -1272,12 +1289,7 @@ true - - OPENUDID - o - true - true - + TERM r @@ -1540,12 +1552,7 @@ true true - - OPENUDID - rouid - true - true - + TERM rterm @@ -1828,12 +1835,7 @@ true - - OPENUDID - openudid - true - true - + ODIN @@ -2180,12 +2182,7 @@ true false - - OPENUDID - openudid - true - false - + TERM devicetype diff --git a/MobileTracking/.DS_Store b/MobileTracking/.DS_Store index 711bb4c487e610ebb9e259780bb6c7ff04336eec..fbca71f30808b6c99fa7a2e140684480f1bd0979 100644 Binary files a/MobileTracking/.DS_Store and b/MobileTracking/.DS_Store differ diff --git a/MobileTracking/JSViewAbility/VADeviceMessage.m b/MobileTracking/JSViewAbility/VADeviceMessage.m index a8d0d0a07b286ef392b1a07f2171e7160d19bc8e..54ee1281de7dbc32ac71d382ddf08a42ffcc41da 100644 --- a/MobileTracking/JSViewAbility/VADeviceMessage.m +++ b/MobileTracking/JSViewAbility/VADeviceMessage.m @@ -39,7 +39,6 @@ static NSString *_locationInfo; @"akey" : [[service appKey] gtm_stringByEscapingForURLArgument], @"aname" : [[service appName] gtm_stringByEscapingForURLArgument], @"scwh" : [service scwh], - @"openudid" : [[service openUDID] gtm_stringByEscapingForURLArgument], @"term" : [[service term] gtm_stringByEscapingForURLArgument], @"wifissid" : [[service wifiSSID] gtm_stringByEscapingForURLArgument], @"wifibssid" : [MMA_Helper md5HexDigest:[service wifiBSSID]], diff --git a/MobileTracking/MobileTracking.xcodeproj/project.pbxproj b/MobileTracking/MobileTracking.xcodeproj/project.pbxproj index 3d5569d23af80e5b01ca47ca5cfc1d8ff8551359..d4381eaf3554589cd1ce36dc18ab77f2c557d9a3 100755 --- a/MobileTracking/MobileTracking.xcodeproj/project.pbxproj +++ b/MobileTracking/MobileTracking.xcodeproj/project.pbxproj @@ -32,7 +32,6 @@ 2A79BC1F18D2DC2900FC62C1 /* MMA_TrackingInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A79BC1E18D2DC2900FC62C1 /* MMA_TrackingInfoService.m */; }; 2A8171BE18DA91C700E0EFEC /* MMA_SSNetworkInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A8171BD18DA91C700E0EFEC /* MMA_SSNetworkInfo.m */; }; 2A81720118DAEB3A00E0EFEC /* MobileTracking.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A632A2218CEB10B00BE2533 /* MobileTracking.m */; }; - 2A81720218DAEB3A00E0EFEC /* MMA_TrackingInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A79BC1E18D2DC2900FC62C1 /* MMA_TrackingInfoService.m */; }; 2A81720318DAEB3A00E0EFEC /* MMA_GDataXMLNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE23A18CF0427007BD457 /* MMA_GDataXMLNode.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 2A81720418DAEB3A00E0EFEC /* MMA_XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE28E18CF25A1007BD457 /* MMA_XMLReader.m */; }; 2A81720518DAEB3A00E0EFEC /* MMA_Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE2EE18D1B1A2007BD457 /* MMA_Helper.m */; }; @@ -40,7 +39,6 @@ 2A81720718DAEB3A00E0EFEC /* MMA_Log.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE2A318D0581A007BD457 /* MMA_Log.m */; }; 2A81720818DAEB3A00E0EFEC /* MMA_SSNetworkInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A8171BD18DA91C700E0EFEC /* MMA_SSNetworkInfo.m */; }; 2A81720918DAEB3A00E0EFEC /* MMA_Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE1FB18CED086007BD457 /* MMA_Reachability.m */; }; - 2A81720A18DAEB3A00E0EFEC /* MMA_OpenUDID.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE1F718CED085007BD457 /* MMA_OpenUDID.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 2A81720B18DAEB3A00E0EFEC /* MMA_SDKConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE28B18CF1EA5007BD457 /* MMA_SDKConfig.m */; }; 2A81720C18DAEB3A00E0EFEC /* MMA_TaskQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE2B018D07126007BD457 /* MMA_TaskQueue.m */; }; 2A81720D18DAEB3A00E0EFEC /* MMA_GTMNSString+URLArguments.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE2A018D02ED2007BD457 /* MMA_GTMNSString+URLArguments.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; @@ -50,7 +48,6 @@ 2A81721318DAEB3A00E0EFEC /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABFE27F18CF176D007BD457 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 2A81721518DAEB3A00E0EFEC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A632A1B18CEB10B00BE2533 /* Foundation.framework */; }; 2A81721718DAEB3A00E0EFEC /* MobileTracking.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 2A632A2018CEB10B00BE2533 /* MobileTracking.h */; }; - 2ABFE22318CED086007BD457 /* MMA_OpenUDID.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE1F718CED085007BD457 /* MMA_OpenUDID.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 2ABFE22418CED086007BD457 /* MMA_Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE1FB18CED086007BD457 /* MMA_Reachability.m */; }; 2ABFE22518CED086007BD457 /* MMA_RequestQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE1FE18CED086007BD457 /* MMA_RequestQueue.m */; }; 2ABFE23B18CF0427007BD457 /* MMA_GDataXMLNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 2ABFE23A18CF0427007BD457 /* MMA_GDataXMLNode.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; @@ -112,11 +109,16 @@ AFB3717A1F3854770092930F /* VAViewCapture.m in Sources */ = {isa = PBXBuildFile; fileRef = AFB371681F3854770092930F /* VAViewCapture.m */; }; AFB3717B1F3854770092930F /* ViewabilityJSService.m in Sources */ = {isa = PBXBuildFile; fileRef = AFB3716A1F3854770092930F /* ViewabilityJSService.m */; }; 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 */; }; + C733D3E524A9C73F002F137E /* MMA_IVTInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = C733D3E424A9C73F002F137E /* MMA_IVTInfoService.m */; }; + C733D3E624A9C73F002F137E /* MMA_IVTInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = C733D3E424A9C73F002F137E /* MMA_IVTInfoService.m */; }; 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 */; }; + C7E0DA0C24BEAE2B003D19F4 /* MMA_TrackingInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A79BC1E18D2DC2900FC62C1 /* MMA_TrackingInfoService.m */; }; + C7E0DA2024BEE41F003D19F4 /* AppTrackingTransparency.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7E0DA1024BEAEB1003D19F4 /* AppTrackingTransparency.framework */; }; + C7E0DA2124BEE423003D19F4 /* AppTrackingTransparency.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7E0DA1024BEAEB1003D19F4 /* AppTrackingTransparency.framework */; }; + C7F626F124DA87E800B0F93C /* libMMASign.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C7F626F024DA87E800B0F93C /* libMMASign.a */; }; + C7F626F224DA87E800B0F93C /* libMMASign.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C7F626F024DA87E800B0F93C /* libMMASign.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -171,9 +173,6 @@ 2A8171BD18DA91C700E0EFEC /* MMA_SSNetworkInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMA_SSNetworkInfo.m; sourceTree = ""; }; 2A8171BF18DA979E00E0EFEC /* MMA_SystemServicesConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMA_SystemServicesConstants.h; sourceTree = ""; }; 2A81721B18DAEB3A00E0EFEC /* libMobileTrackingSimulator.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMobileTrackingSimulator.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 2ABFE1F618CED085007BD457 /* MMA_OpenUDID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMA_OpenUDID.h; sourceTree = ""; }; - 2ABFE1F718CED085007BD457 /* MMA_OpenUDID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMA_OpenUDID.m; sourceTree = ""; }; - 2ABFE1F818CED085007BD457 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = ""; }; 2ABFE1FA18CED086007BD457 /* MMA_Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMA_Reachability.h; sourceTree = ""; }; 2ABFE1FB18CED086007BD457 /* MMA_Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMA_Reachability.m; sourceTree = ""; }; 2ABFE1FD18CED086007BD457 /* MMA_RequestQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMA_RequestQueue.h; sourceTree = ""; }; @@ -206,7 +205,6 @@ 7791985C229FB9C00090A788 /* MMA_AdCalSize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMA_AdCalSize.m; sourceTree = ""; }; 7791985D229FB9C00090A788 /* MMA_AdHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMA_AdHelper.m; sourceTree = ""; }; 7791985E229FB9C00090A788 /* MMA_AdCalSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMA_AdCalSize.h; sourceTree = ""; }; - AF0F01A01FF49BCC0095BE0C /* MMASign.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMASign.h; sourceTree = ""; }; AF1AAE7A1EF61EF300E9C276 /* NSDate+VASDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+VASDK.h"; sourceTree = ""; }; AF1AAE7B1EF61EF300E9C276 /* NSDate+VASDK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+VASDK.m"; sourceTree = ""; }; AF1AAE7C1EF61EF300E9C276 /* UIView+MMA_Monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+MMA_Monitor.h"; sourceTree = ""; }; @@ -246,10 +244,14 @@ AFB371681F3854770092930F /* VAViewCapture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VAViewCapture.m; sourceTree = ""; }; 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 = ""; }; + C733D3E324A9C73E002F137E /* MMA_IVTInfoService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMA_IVTInfoService.h; sourceTree = ""; }; + C733D3E424A9C73F002F137E /* MMA_IVTInfoService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMA_IVTInfoService.m; sourceTree = ""; }; C74B78322375573A0031DE10 /* Photos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Photos.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Photos.framework; sourceTree = DEVELOPER_DIR; }; C74B7835237557510031DE10 /* PhotosUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PhotosUI.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/PhotosUI.framework; sourceTree = DEVELOPER_DIR; }; C765ABDF23262B660066E906 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; + C7E0DA1024BEAEB1003D19F4 /* AppTrackingTransparency.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppTrackingTransparency.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.16.sdk/System/Library/Frameworks/AppTrackingTransparency.framework; sourceTree = DEVELOPER_DIR; }; + C7F626F024DA87E800B0F93C /* libMMASign.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libMMASign.a; sourceTree = ""; }; + C7F626F324DA87F000B0F93C /* MMASign.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMASign.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -257,12 +259,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C7E0DA2024BEE41F003D19F4 /* AppTrackingTransparency.framework in Frameworks */, C765ABE023262B660066E906 /* WebKit.framework in Frameworks */, 2ABFE29818CF2B5F007BD457 /* CoreLocation.framework in Frameworks */, 2ABFE28218CF1778007BD457 /* UIKit.framework in Frameworks */, - AFB87D332004BAA000A02E0C /* libMMASign.a in Frameworks */, 2ABFE28018CF176D007BD457 /* AdSupport.framework in Frameworks */, 2A632A1C18CEB10B00BE2533 /* Foundation.framework in Frameworks */, + C7F626F124DA87E800B0F93C /* libMMASign.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -281,12 +284,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C7E0DA2124BEE423003D19F4 /* AppTrackingTransparency.framework in Frameworks */, C765ABE123262B710066E906 /* WebKit.framework in Frameworks */, 2A81721118DAEB3A00E0EFEC /* CoreLocation.framework in Frameworks */, 2A81721218DAEB3A00E0EFEC /* UIKit.framework in Frameworks */, - AFB87D342004BAA100A02E0C /* libMMASign.a in Frameworks */, 2A81721318DAEB3A00E0EFEC /* AdSupport.framework in Frameworks */, 2A81721518DAEB3A00E0EFEC /* Foundation.framework in Frameworks */, + C7F626F224DA87E800B0F93C /* libMMASign.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -317,6 +321,7 @@ 2A632A1A18CEB10B00BE2533 /* Frameworks */ = { isa = PBXGroup; children = ( + C7E0DA1024BEAEB1003D19F4 /* AppTrackingTransparency.framework */, C74B7835237557510031DE10 /* PhotosUI.framework */, C74B78322375573A0031DE10 /* Photos.framework */, C765ABDF23262B660066E906 /* WebKit.framework */, @@ -376,9 +381,9 @@ 2ABFE1F118CED085007BD457 /* EncryptModule */ = { isa = PBXGroup; children = ( + C7F626F324DA87F000B0F93C /* MMASign.h */, + C7F626F024DA87E800B0F93C /* libMMASign.a */, 2A632A3118CEB10B00BE2533 /* MobileTrackingTests */, - AFB87D322004BA9E00A02E0C /* libMMASign.a */, - AF0F01A01FF49BCC0095BE0C /* MMASign.h */, ); path = EncryptModule; sourceTree = ""; @@ -389,23 +394,12 @@ 2ABFE29E18D02ED2007BD457 /* GTMNSString */, 2ABFE24C18CF1756007BD457 /* SystemService */, 2ABFE23818CF0427007BD457 /* GDataXMLNode */, - 2ABFE1F518CED085007BD457 /* OpenUDID */, 2ABFE1F918CED086007BD457 /* Reachability */, 2ABFE1FC18CED086007BD457 /* RequestQueue */, ); path = Vendor; sourceTree = ""; }; - 2ABFE1F518CED085007BD457 /* OpenUDID */ = { - isa = PBXGroup; - children = ( - 2ABFE1F618CED085007BD457 /* MMA_OpenUDID.h */, - 2ABFE1F718CED085007BD457 /* MMA_OpenUDID.m */, - 2ABFE1F818CED085007BD457 /* README.md */, - ); - path = OpenUDID; - sourceTree = ""; - }; 2ABFE1F918CED086007BD457 /* Reachability */ = { isa = PBXGroup; children = ( @@ -479,6 +473,8 @@ 2ABFE29918CFF9EF007BD457 /* Service */ = { isa = PBXGroup; children = ( + C733D3E324A9C73E002F137E /* MMA_IVTInfoService.h */, + C733D3E424A9C73F002F137E /* MMA_IVTInfoService.m */, 2A79BC1D18D2DC2900FC62C1 /* MMA_TrackingInfoService.h */, 2A79BC1E18D2DC2900FC62C1 /* MMA_TrackingInfoService.m */, ); @@ -682,6 +678,7 @@ AF1AAE9E1EF61EF300E9C276 /* VAMonitorFrame.m in Sources */, 77919862229FB9C10090A788 /* MMA_AdHelper.m in Sources */, AF1AAE981EF61EF300E9C276 /* VAMaros.m in Sources */, + C733D3E524A9C73F002F137E /* MMA_IVTInfoService.m in Sources */, AF1AAEA81EF61EF300E9C276 /* VAViewTools.m in Sources */, AF89EC731EFA0CB400A2AF21 /* Viewability_iOS.md in Sources */, AF1AAE941EF61EF300E9C276 /* NSDate+VASDK.m in Sources */, @@ -697,7 +694,6 @@ 2ABFE2A418D0581A007BD457 /* MMA_Log.m in Sources */, 2A8171BE18DA91C700E0EFEC /* MMA_SSNetworkInfo.m in Sources */, 2ABFE22418CED086007BD457 /* MMA_Reachability.m in Sources */, - 2ABFE22318CED086007BD457 /* MMA_OpenUDID.m in Sources */, AF1AAE961EF61EF300E9C276 /* UIView+MMA_Monitor.m in Sources */, 2ABFE28C18CF1EA5007BD457 /* MMA_SDKConfig.m in Sources */, 2ABFE2B118D07126007BD457 /* MMA_TaskQueue.m in Sources */, @@ -731,10 +727,11 @@ AFB3717A1F3854770092930F /* VAViewCapture.m in Sources */, 77919863229FBDDD0090A788 /* MMA_AdCalSize.m in Sources */, AFB371781F3854770092930F /* VAJSViewabilityData.m in Sources */, - 2A81720218DAEB3A00E0EFEC /* MMA_TrackingInfoService.m in Sources */, + C7E0DA0C24BEAE2B003D19F4 /* MMA_TrackingInfoService.m in Sources */, 2A81720318DAEB3A00E0EFEC /* MMA_GDataXMLNode.m in Sources */, 77919866229FBDE80090A788 /* MMA_AdViewMonitor.m in Sources */, AF1AAE9F1EF61EF300E9C276 /* VAMonitorFrame.m in Sources */, + C733D3E624A9C73F002F137E /* MMA_IVTInfoService.m in Sources */, AF1AAE991EF61EF300E9C276 /* VAMaros.m in Sources */, AF1AAEA91EF61EF300E9C276 /* VAViewTools.m in Sources */, AF89EC741EFA0CB400A2AF21 /* Viewability_iOS.md in Sources */, @@ -751,7 +748,6 @@ 2A81720718DAEB3A00E0EFEC /* MMA_Log.m in Sources */, 2A81720818DAEB3A00E0EFEC /* MMA_SSNetworkInfo.m in Sources */, 2A81720918DAEB3A00E0EFEC /* MMA_Reachability.m in Sources */, - 2A81720A18DAEB3A00E0EFEC /* MMA_OpenUDID.m in Sources */, AF1AAE971EF61EF300E9C276 /* UIView+MMA_Monitor.m in Sources */, 2A81720B18DAEB3A00E0EFEC /* MMA_SDKConfig.m in Sources */, 2A81720C18DAEB3A00E0EFEC /* MMA_TaskQueue.m in Sources */, @@ -895,7 +891,6 @@ GCC_PREFIX_HEADER = "MobileTracking/MobileTracking-Prefix.pch"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Users/wenqi/Project/MMA_iOS_SDK/MobileTracking/MobileTracking/EncryptModule, "$(PROJECT_DIR)/MobileTracking/EncryptModule", ); ONLY_ACTIVE_ARCH = NO; @@ -921,7 +916,6 @@ GCC_PREFIX_HEADER = "MobileTracking/MobileTracking-Prefix.pch"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - /Users/wenqi/Project/MMA_iOS_SDK/MobileTracking/MobileTracking/EncryptModule, "$(PROJECT_DIR)/MobileTracking/EncryptModule", ); ONLY_ACTIVE_ARCH = NO; @@ -953,6 +947,7 @@ "$(inherited)", "$(PROJECT_DIR)/MobileTracking/EncryptModule", ); + ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-fembed-bitcode"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xctest; @@ -975,6 +970,7 @@ "$(inherited)", "$(PROJECT_DIR)/MobileTracking/EncryptModule", ); + ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-fembed-bitcode"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xctest; diff --git a/MobileTracking/MobileTracking/EncryptModule/libMMASign.a b/MobileTracking/MobileTracking/EncryptModule/libMMASign.a index f87cc1ed2baf7a977b897bb2aa7cce6569b3b79f..dabdad931bec4c595bfbd6ef5fc4136c9b9c1898 100644 Binary files a/MobileTracking/MobileTracking/EncryptModule/libMMASign.a and b/MobileTracking/MobileTracking/EncryptModule/libMMASign.a differ diff --git a/MobileTracking/MobileTracking/MMA_Macro.h b/MobileTracking/MobileTracking/MMA_Macro.h index a765f61d5bc62f81e5543ac269d0a571dc56152d..742e8e1ed211fb5fb88a9d089385be133e308c10 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.6" +#define MMA_SDK_VERSION @"V2.2.0" #define NOTIFICATION_VB @"viewability_notification" #define NOTIFICATION_EXPOSE @"expose_notification" @@ -34,8 +34,8 @@ #define UPDATE_SDK_CONFIG_WIFI_INTERVAL (1 * 24 * 60 * 60) #define UPDATE_SDK_CONFIG_3G_INTERVAL (3 * 24 * 60 * 60) #define LOCATION_UPDATE_INTERVAL 120 //定位刷新间隔 单位:秒 -#define SENSOR_UPDATE_INTERVAL 3600 //传感器刷新间隔 单位:秒 -#define SENSOR_COLLECT_TIME 0.5 //传感器采集时间 单位:秒 +#define SENSOR_UPDATE_INTERVAL 0 //传感器刷新间隔 单位:秒 + #define NETWORK_STATUS_WIFI 1 #define NETWORK_STATUS_3G 0 @@ -47,7 +47,7 @@ #define TRACKING_KEY_IDFAMD5 @"IDFAMD5" -#define TRACKING_KEY_OPENUDID @"OPENUDID" + #define TRACKING_KEY_TS @"TS" #define TRACKING_KEY_LBS @"LBS" #define TRACKING_KEY_OSVS @"OSVS" diff --git a/MobileTracking/MobileTracking/MobileTracking.h b/MobileTracking/MobileTracking/MobileTracking.h index 0b11d7edc98d80dc77d7288d1105b5fdb8f0ed2d..2223a46e959e1418043ae71753aaddc5c96930ca 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.6" +//#define MMA_SDK_VERSION @"V2.2.0" #import @@ -21,18 +21,17 @@ - (void)enableLog:(BOOL)enableLog; // 点击 -- (void)click:(NSString *)url; +- (void)click:(NSString *)url succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; /* 普通曝光 url:监测的链接 adView:监测的广告视图对象 impressionType:曝光类型。Tracked Ads:0;曝光:1 */ -- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type; +- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; // 可视化监测曝光 -- (void)view:(NSString *)url ad:(UIView *)adView; - +- (void)view:(NSString *)url ad:(UIView *)adView succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; /* 视频可视化监测曝光 自动播放:1 @@ -40,7 +39,7 @@ 无法识别:0 */ -- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type; +- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; //停止可见监测 - (void)stop:(NSString *)url; diff --git a/MobileTracking/MobileTracking/MobileTracking.m b/MobileTracking/MobileTracking/MobileTracking.m index 2320eb167ac823a1727e79b4a78ed02bd239b96c..a320949dddb6ca2a23caf5a854080d2e12252f2e 100755 --- a/MobileTracking/MobileTracking/MobileTracking.m +++ b/MobileTracking/MobileTracking/MobileTracking.m @@ -26,6 +26,7 @@ #import "VAMonitorConfig.h" #import "ViewabilityJSService.h" #import "VAViewCapture.h" +#import "MMA_IVTInfoService.h" @interface MobileTracking() @@ -43,6 +44,7 @@ @property (nonatomic,strong) ViewabilityJSService *viewabilityJSService; @property (nonatomic, strong) NSMutableDictionary *impressionDictionary; +@property(nonatomic,strong)MMA_Company * M_Company; @end @@ -88,23 +90,22 @@ _trackingInfoService = [MMA_TrackingInfoService sharedInstance]; _impressionDictionary = [NSMutableDictionary dictionary]; _isTrackLocation = false; - + + + [self initSdkConfig]; [self initQueue]; [self initTimer]; [self openLBS]; [self initViewabilityService]; + // [self performSelector:@selector(initSensor) withObject:nil afterDelay:0.1]; } return self; } --(void)initSensor{ - - -} - (void)initSdkConfig { @try { @@ -169,6 +170,7 @@ - (void)initTimer { + NSInteger failedQueueInterval = self.sdkConfig.offlineCache.queueExpirationSecs; if (!failedQueueInterval) { failedQueueInterval = DEFAULT_FAILED_QUEUE_TIMER_INTERVAL; @@ -184,6 +186,8 @@ selector:@selector(handleSendQueueTimer:) userInfo:nil repeats:YES]; + + } - (void)handleFailedQueueTimer:(NSTimer *)timer @@ -216,6 +220,7 @@ [self.failedQueue push:task]; } } else { + [[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_SUCCEED object:nil]; } }; @@ -247,12 +252,48 @@ task.failedCount++; task.hasFailed = true; [self.failedQueue push:task]; + if(task.failedBlock){ + task.failedBlock([NSString stringWithFormat:@"MMA_URL Failed To Send"]); + } } else { + // NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response; + if (task.succeedBlock) { + + + //self.M_Company 可以设置成全局,减少后续其他操作进行xml匹配的耗时。 + + MMA_Argument *adViewabilityResult = [self.M_Company.config.viewabilityarguments valueForKey:AD_VB_RESULT]; + + if(adViewabilityResult.value && adViewabilityResult.value.length) { + + NSString * vx1 =[NSString stringWithFormat: @"%@%@%@%@",self.M_Company.separator,adViewabilityResult.value,self.M_Company.equalizer,@"1"]; + NSString * vx4 =[NSString stringWithFormat: @"%@%@%@%@",self.M_Company.separator,adViewabilityResult.value,self.M_Company.equalizer,@"4"]; + + if ([task.url containsString:vx1]) { + + task.succeedBlock(TaskTypeAry[VIEWABLE]); + + }else if ([task.url containsString:vx4]) { + + task.succeedBlock(TaskTypeAry[NONVIEWABLE]); + + + } else { + + task.succeedBlock(task.tType); + } + + } +// + + } [[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_SUCCEED object:nil]; } }; [[MMA_RequestQueue mainQueue] addOperation:operation]; + + } } @@ -404,8 +445,11 @@ @try { MMA_Company *company = [self confirmCompany:url]; - - + + NSString *svl = company.antidevice; + + + MMA_VBOpenResult *res = [[MMA_VBOpenResult alloc] init]; res.config = self.viewabilityConfig; // 初始化默认配置为当前的配置 @@ -592,7 +636,7 @@ } -- (void)click:(NSString *)url +- (void)click:(NSString *)url succeed:(void (^)(id))succeedBlock failed:(void(^)())failedBlock { @@ -620,17 +664,19 @@ * 拼接u参数和impressID */ url = [self handleImpressURL:url impression:impressID redirectURL:result.redirectURL additionKey:NO]; - - [self filterURL:url]; + MMA_Task * task = [[MMA_Task alloc]init]; + task.tType = TaskTypeAry[CLICK]; + [self filterURL:url task:task succeed:succeedBlock failed:failedBlock]; } // 普通曝光请求: 普通曝光默认不开启viewability. 需要redirectURL -- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type +- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock { @try { BOOL viewability = NO; MMA_VBOpenResult *result = [self vbFilterURL:url isForViewability:viewability isVideo:NO videoPlayType:0]; - [self view:url ad:adView isVideo:NO videoPlayType:0 handleResult:result impressionType:type]; + + [self view:url ad:adView isVideo:NO videoPlayType:0 handleResult:result impressionType:type succeed:succeedBlock failed:failedBlock]; } @catch (NSException *exception) { [MMA_Log log:@"##exception:%@" ,exception]; @@ -638,17 +684,19 @@ } // 视频Viewaility曝光请求: 视频曝光判断是否含有相关AdViewabilityEvents字段决定是否开启viewability 不需要redirectURL -- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type{ +- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock{ BOOL viewability = YES; MMA_VBOpenResult *result = [self vbFilterURL:url isForViewability:viewability isVideo:YES videoPlayType:type]; - [self view:url ad:adView isVideo:YES videoPlayType:type handleResult:result impressionType:1]; + + [self view:url ad:adView isVideo:YES videoPlayType:type handleResult:result impressionType:1 succeed:succeedBlock failed:failedBlock]; } // 广告Viewability曝光请求: 同视频Viewability曝光逻辑 不需要redirectURL -- (void)view:(NSString *)url ad:(UIView *)adView { +- (void)view:(NSString *)url ad:(UIView *)adView succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock{ BOOL viewability = YES; MMA_VBOpenResult *result = [self vbFilterURL:url isForViewability:viewability isVideo:NO videoPlayType:0]; - [self view:url ad:adView isVideo:NO videoPlayType:0 handleResult:result impressionType:1]; + + [self view:url ad:adView isVideo:NO videoPlayType:0 handleResult:result impressionType:1 succeed:succeedBlock failed:failedBlock]; } // 停止可见监测 @@ -676,7 +724,7 @@ // viewability曝光不需要redirectURL已在前面剔除,普通曝光需要redirectURL -- (void)view:(NSString *)url ad:(UIView *)adView isVideo:(BOOL)isVideo videoPlayType:(NSInteger)type handleResult:(MMA_VBOpenResult *)result impressionType:(NSInteger)impressionType{ +- (void)view:(NSString *)url ad:(UIView *)adView isVideo:(BOOL)isVideo videoPlayType:(NSInteger)type handleResult:(MMA_VBOpenResult *)result impressionType:(NSInteger)impressionType succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock{ @try { /** @@ -688,19 +736,22 @@ BOOL useViewabilityService = result.canOpen; MMA_Company *company = [self confirmCompany:url]; + // ========== result.config.trackPolicy = company.MMASwitch.viewabilityTrackPolicy; if(!company) { [MMA_Log log:@"%@" ,@"company is nil,please check your 'sdkconfig.xml' file"]; return; } - + self.M_Company = company; /** * 获取广告位ID,如果没有扔回MMA */ NSString *adID = [self getAdIDForURL:url]; if(!adID || !adID.length) { - [self filterURL:url]; + MMA_Task * task = [[MMA_Task alloc]init]; + task.tType = TaskTypeAry[UNMEASURED]; + [self filterURL:url task:task succeed:succeedBlock failed:failedBlock]; [MMA_Log log:@"adplacement get failed: %@" ,@"no adplacement"]; return; } @@ -725,15 +776,21 @@ // impressionType=0视为Tracked ads;impressionType=1视为曝光 if (impressionType == 0) { - [self handleImpressionType:@"0" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; + MMA_Task * task = [[MMA_Task alloc]init]; + task.tType = TaskTypeAry[IMPRESSION]; + [self handleImpressionType:@"0" task:task URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService succeed:succeedBlock failed:failedBlock] ; } else if (impressionType == 1){ + MMA_Task * task = [[MMA_Task alloc]init]; + task.tType = TaskTypeAry[IMPRESSION]; if(!adView || ![adView isKindOfClass:[UIView class]]) { // view=nil或者view非法的情况下,未达到CBR条件,如果是可见监测停止监测 - [self handleImpressionType:@"0" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; + [self handleImpressionType:@"0" task:task URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService succeed:succeedBlock failed:failedBlock]; return; } else { + MMA_Task * task = [[MMA_Task alloc]init]; + task.tType = TaskTypeAry[IMPRESSION]; // 达到CBR条件,如果是可见监测继续监测 - [self handleImpressionType:@"1" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; + [self handleImpressionType:@"1" task:task URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService succeed:succeedBlock failed:failedBlock]; } } @@ -770,8 +827,15 @@ // NSString *url = [self monitorHandleWithURL:result.url data:accessDictionary redirectURL:@""]; // [self filterURL:url]; } + MMA_Task * task = [[MMA_Task alloc]init]; + task.tType = TaskTypeAry[IMPRESSION]; + VAMonitor *monitor = [VAMonitor monitorWithView:adView isVideo:isVideo url:result.url redirectURL:@"" impressionID:impressID adID:adID keyValueAccess:[keyvalueAccess copy] config:result.config domain:domain]; + monitor.succeedBlock=succeedBlock; + monitor.failedBlock =failedBlock; + monitor.task = task; monitor.delegate = self; + [_viewabilityService addVAMonitor:monitor]; @@ -787,14 +851,14 @@ // } -- (void)handleImpressionType:(NSString *)impressionType URL:(NSString *)url impression:(NSString *)impressionID redirectURL:(NSString *)redirectURL additionKey:(BOOL)additionKey { +- (void)handleImpressionType:(NSString *)impressionType task:(MMA_Task *)task URL:(NSString *)url impression:(NSString *)impressionID redirectURL:(NSString *)redirectURL additionKey:(BOOL)additionKey succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock{ MMA_Company *company = [self confirmCompany:url]; NSMutableString *trackURL = [NSMutableString stringWithString:url]; MMA_Argument *impressionTypeArgument = [company.config.viewabilityarguments valueForKey:IMPRESSIONTYPE]; if(impressionTypeArgument.value) { [trackURL appendFormat:@"%@%@%@%@",company.separator,impressionTypeArgument.value,company.equalizer,impressionType]; } - [self filterURL:[self handleImpressURL:trackURL impression:impressionID redirectURL:redirectURL additionKey:additionKey]]; + [self filterURL:[self handleImpressURL:trackURL impression:impressionID redirectURL:redirectURL additionKey:additionKey] task:task succeed:succeedBlock failed:failedBlock]; [[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_EXPOSE object:nil]; } @@ -822,12 +886,12 @@ //Viewability可视化监测Delegate 接收数据 -- (void)monitor:(VAMonitor *)monitor didReceiveData:(NSDictionary *)monitorData { +- (void)monitor:(VAMonitor *)monitor task:(MMA_Task *)task didReceiveData:(NSDictionary *)monitorData succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock { NSString *url = [self monitorHandleWithURL:monitor.url data:monitorData redirectURL:monitor.redirectURL]; NSLog(@"viewabilityURL-----------------------%@",url); - [self filterURL:url]; + [self filterURL:url task:task succeed:succeedBlock failed:failedBlock]; } - (NSString *)handleImpressURL:(NSString *)url impression:(NSString *)impressionID redirectURL:(NSString *)redirectURL additionKey:(BOOL)additionKey { @@ -913,14 +977,15 @@ } -- (void)filterURL:(NSString *)url +- (void)filterURL:(NSString *)url task:(MMA_Task *)task succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock { if ([self confirmCompany:url] == nil) { [MMA_Log log:@"%@" ,@"company is nil,please check your 'sdkconfig.xml' file"]; return; } - [self pushTask:url]; + + [self pushTask:url task:task succeed:succeedBlock failed:failedBlock]; @@ -930,7 +995,7 @@ - + } - (MMA_Company *)confirmCompany:(NSString *)url @@ -953,16 +1018,18 @@ } -- (void)pushTask: (NSString *)url +- (void)pushTask: (NSString *)url task:(MMA_Task *)task succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock { @try { NSString *trackURL = [self generateTrackingURL:url]; - MMA_Task *task = [[MMA_Task alloc] init]; +// MMA_Task *task = [[MMA_Task alloc] init]; task.url = trackURL; task.timePoint = [[[NSDate alloc] init] timeIntervalSince1970]; task.failedCount = 0; task.hasFailed = false; task.hasLock = false; + task.succeedBlock=succeedBlock; + task.failedBlock = failedBlock; [self.sendQueue push:task]; @@ -1036,12 +1103,7 @@ NSDictionary *encrptDic = company.MMASwitch.encrypt; [trackURL appendFormat:@"%@%@%@%@", company.separator, queryArgsKey, company.equalizer,[MMA_Helper md5HexDigest:idfa]]; /************/ - } else if ([argument.key isEqualToString:TRACKING_KEY_OPENUDID]) { - - NSString *openUDID = [[self.trackingInfoService openUDID] gtm_stringByEscapingForURLArgument]; - [trackURL appendFormat:@"%@%@%@%@", company.separator, queryArgsKey, company.equalizer, openUDID]; - - } else if ([argument.key isEqualToString:TRACKING_KEY_TS]) { + } else if ([argument.key isEqualToString:TRACKING_KEY_TS]) { /*增加了根据配置文件选择客户端传输的时间精度为妙或者毫秒*/ NSDate *date = [NSDate date]; NSString *timestamp = [NSString stringWithFormat:@"%.0f", [date timeIntervalSince1970] * 1000]; @@ -1124,7 +1186,92 @@ [trackURL appendFormat:@"%@%@%@%@", company.separator, company.signature.paramKey, company.equalizer, signString]; + #pragma mark == ivt == + + + NSString *svl = company.antidevice; + MMA_IVTInfoService * ivt = [MMA_IVTInfoService sharedInstance]; + if (svl) { + + + + + + + NSString *reWriteString = @""; + + NSArray *sensorArray = [MMA_IVTInfoService ArrayWithDict:company.config.sensorarguments]; +// BOOL iSupdate = ivt.iSupdate; + for (NSInteger i =0; i + + + +@interface MMA_IVTInfoService : NSObject ++ (MMA_IVTInfoService *)sharedInstance; + +/**是否越狱*/ +-(BOOL)isRoot; +/**剩余电量*/ +-(NSString *)Electricity; +/**是否充电*/ +-(BOOL)isCharging; +/**是否模拟器*/ +-(BOOL)isSimulator; + + +-(void)updateSensorInfo:(void(^)())result; +/**距离上次刷新时间s*/ +-(NSInteger )timeDifference; +/**存储当前时间*/ +-(void)saveLastTime; + +-(BOOL)iSupdate; + +//根据value排序 ++(NSArray*)ArrayWithDict:(NSDictionary*)dict; +//根据value排序2 ++(NSArray*)ArrayWithDict2:(NSDictionary*)dict; + + +@end + + diff --git a/MobileTracking/MobileTracking/Service/MMA_IVTInfoService.m b/MobileTracking/MobileTracking/Service/MMA_IVTInfoService.m new file mode 100644 index 0000000000000000000000000000000000000000..4b81061d96ac3305bbdc27ccedbb8c95354b46c7 --- /dev/null +++ b/MobileTracking/MobileTracking/Service/MMA_IVTInfoService.m @@ -0,0 +1,296 @@ +// +// MMA_IVTInfoService.m +// MobileTracking +// +// Created by DeveWang on 2019/11/1. +// Copyright © 2019 Admaster. All rights reserved. +// + +#import "MMA_IVTInfoService.h" + +#import + +#import +#import "MMA_Log.h" +#import "MMA_Macro.h" + + +#define SENSOR_LAST_TIME @"SENSOR_LAST_TIME" +#define SENSOR_UPDATE_TIME 0.1 +/*--------------参数设置-----------------*/ +@interface MMA_Argument : NSObject + +@property (nonatomic, strong) NSString *key; +@property (nonatomic, strong) NSString *value; +@property (nonatomic, assign) Boolean urlEncode; +@property (nonatomic, assign) Boolean isRequired; + +@end + +@interface MMA_IVTInfoService () + + + +@property(nonatomic,assign)NSInteger lastTime; + + +@property (nonatomic, strong) dispatch_source_t gcd_timer; + + + + + +@end + +@implementation MMA_IVTInfoService{ + + + __block BOOL _updateing ; + + +} + ++ (MMA_IVTInfoService *)sharedInstance { + + static MMA_IVTInfoService *_sharedInstance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _sharedInstance = [[self alloc] init]; +// _sharedInstance.brightnessAry = [[NSMutableArray alloc]init]; +// _sharedInstance.directionAry = [[NSMutableArray alloc]init]; +// + // [_sharedInstance checkEnable]; + + }); + return _sharedInstance; +} + + + + + + +-(void)updateSensorInfo:(void (^)())result{ + + if ([self timeDifference]=SENSOR_UPDATE_INTERVAL) { + + return YES; + }else{ + [MMA_Log log:@"距离上次刷新间隔%lds,请稍等",[self timeDifference]]; + return NO; + } + + +} + + + + + + + + +/**是否越狱*/ +-(BOOL)isRoot{ + BOOL root = NO; + NSFileManager *fileManager=[NSFileManager defaultManager]; + NSArray *pathArray = @[@"/etc/ssh/sshd_config", + @"/usr/libexec/ssh-keysign", + @"/usr/sbin/sshd", + @"/usr/sbin/sshd", + @"/bin/sh", + @"/bin/bash", + @"/etc/apt", + @"/Application/Cydia.app/", + @"/Library/MobileSubstrate/MobileSubstrate.dylib" + ]; + for (NSString *path in pathArray) { + root = [fileManager fileExistsAtPath:path]; + // 如果存在这些目录,就是已经越狱 + if (root) { + + return root; + break; + } + } + + return root; +} +/**剩余电量*/ +-(NSString *)Electricity{ + [UIDevice currentDevice].batteryMonitoringEnabled = YES; + double deviceLevel = [UIDevice currentDevice].batteryLevel; + NSString * deviceLevelStr; + if (deviceLevel <0||deviceLevel>1) { + deviceLevelStr = @"-"; + }else{ + deviceLevelStr = [NSString stringWithFormat:@"%f",deviceLevel]; + } + return deviceLevelStr; +} +/**是否充电*/ +-(BOOL)isCharging{ + + UIDevice *Device = [UIDevice currentDevice]; + // Set battery monitoring on + Device.batteryMonitoringEnabled = YES; + + // Check the battery state + if ([Device batteryState] == UIDeviceBatteryStateCharging || [Device batteryState] == UIDeviceBatteryStateFull) { + // Device is charging + return true; + } else { + // Device is not charging + return false; + } + + + +} +/**是否模拟器*/ +-(BOOL)isSimulator{ + if (TARGET_IPHONE_SIMULATOR == 1 && TARGET_OS_IPHONE == 1) { + //模拟器 + return YES; + }else{ + //真机 + return NO; + } + + + +} + + + + + + + +-(NSInteger)timeDifference{ + if (!self.lastTime) { + + self.lastTime = [[[NSUserDefaults standardUserDefaults] objectForKey:SENSOR_LAST_TIME] integerValue]; + } + + + + NSInteger nowTime = [[NSDate date] timeIntervalSince1970]; + + + NSInteger timeDiff = nowTime - self.lastTime; + + // [MMA_Log log:@"相差 === %ld =====秒",(long)timeDiff]; + + return timeDiff; + + +} + +/**ary转字符串*/ +-(NSString*)stringWithAry:(NSArray*)ary{ + + @try { + NSString*str =@""; + + for(NSString*string in ary) { + + + + + if([str length] !=0) { + + str = [str stringByAppendingString:@","]; + + } + + str = [str stringByAppendingFormat:@"%@",string]; + + } + + str = [NSString stringWithFormat:@"[%@]",str]; + + return str; + } @catch (NSException *exception) { + + } @finally { + + } + + +} + +/**字典根据value进行排序*/ ++(NSArray*)ArrayWithDict:(NSDictionary*)dict{ + + NSArray*keys = [dict allValues]; + + + NSArray*sortedArray = [keys sortedArrayUsingComparator:^NSComparisonResult(id obj1,id obj2) { + MMA_Argument * o1 = obj1; + MMA_Argument * o2 = obj2; + NSString * v1 = o1.value ; + NSString * v2 = o2.value;; +// if (v1 < v2) +// return NSOrderedAscending; +// else if (v1 > v2) +// return NSOrderedDescending; +// else +// return NSOrderedSame; + return[v1 compare:v2 options:64];//正序 + }]; + + + + return sortedArray; + +} +/**字典根据value进行排序2*/ ++(NSArray*)ArrayWithDict2:(NSDictionary*)dict{ + + NSArray*keys = [dict allKeys]; + + + NSArray*sortedArray = [keys sortedArrayUsingComparator:^NSComparisonResult(id obj1,id obj2) { + + +// if (v1 < v2) +// return NSOrderedAscending; +// else if (v1 > v2) +// return NSOrderedDescending; +// else +// return NSOrderedSame; + return[obj1 compare:obj2 options:64];//正序 + }]; + + NSMutableArray *valueArray = [NSMutableArray array]; + for(NSString *sortSring in sortedArray){ + NSString *signSring = [NSString stringWithFormat:@"%@=%@",sortSring,[dict objectForKey:sortSring]]; + [valueArray addObject:signSring]; + } + + + return valueArray; + +} +-(void)saveLastTime{ + + self.lastTime = [[NSDate date] timeIntervalSince1970]; + [[NSUserDefaults standardUserDefaults] setInteger: self.lastTime forKey:SENSOR_LAST_TIME]; + +} + +@end diff --git a/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.h b/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.h index 6f2be84ae4ebc296808b080d9f358519e4ecf2e5..51240d8f2d8e199abc7eec4020d2187ed46a297f 100755 --- a/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.h +++ b/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.h @@ -23,7 +23,7 @@ @property (nonatomic, strong, readonly) NSString *scwh; @property (nonatomic, strong, readonly) NSString *appKey; @property (nonatomic, strong, readonly) NSString *appName; -@property (nonatomic, strong, readonly) NSString *openUDID; + @property (nonatomic, strong, readonly) NSString *location; @property (nonatomic, strong, readonly) NSString *term; @property (nonatomic, assign, readonly) NSInteger networkCondition; diff --git a/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.m b/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.m index 064ae3fa08717cf91e2d0b3f369cd8035bb5c751..cd1e5256a96873eec9615b8bb9c7442cc0432e60 100755 --- a/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.m +++ b/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.m @@ -8,15 +8,19 @@ #import "MMA_TrackingInfoService.h" #import "MMA_SSNetworkInfo.h" -#import "MMA_OpenUDID.h" + #import - +#if !TARGET_OS_MACCATALYST +#import +#endif + + #import "MMA_Reachability.h" #import "MMA_Macro.h" #import -#define MMA_LocalCacheOpenUDIDPersistKey @"kMMA_LocalCacheOpenUDIDPersistKey" + @implementation MMA_TrackingInfoService @@ -25,10 +29,8 @@ static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ _sharedInstance = [[self alloc] init]; - /// 在开始调用SDK的时候,异步持久化一次 openUDID - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [_sharedInstance persistOpenUDID]; - }); + + }); return _sharedInstance; @@ -54,9 +56,23 @@ - (NSString *)idfa { NSString *idfa = nil; - if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) { - idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - } + +#if !TARGET_OS_MACCATALYST + + if (@available(iOS 14, *)) { + + if ([ATTrackingManager trackingAuthorizationStatus] == ATTrackingManagerAuthorizationStatusAuthorized) { + idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; + } + + } else { + + if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) { + idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; + } + } +#endif + return idfa ? idfa : @""; } @@ -78,38 +94,6 @@ return [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey]; } -- (NSString *)openUDID { - - /// 说明: - /// open UDID 一般不会发生改变,只有在用户的手机恢复系统,或者删除所有包含 openUDID 的APP的时候,才会发生改变。 - /// 因为每次获取 open UDID 都比较耗时。因此,可以将之持久化保存起来。 - - /// 先获取缓存的 open UDID; - @try { - NSString *openUDID = [[NSUserDefaults standardUserDefaults] stringForKey:MMA_LocalCacheOpenUDIDPersistKey]; - /// 如果没有缓存,同步持久化保存。 - if(!openUDID||openUDID.length<=0){ - [self persistOpenUDID]; - } - - return openUDID ? openUDID : @""; - } @catch (NSException *exception) { - - } @finally { - - } - -} - -- (NSString *)persistOpenUDID { - - - NSString *openUDID = [MMA_OpenUDID value]; - [[NSUserDefaults standardUserDefaults] setObject:openUDID forKey:MMA_LocalCacheOpenUDIDPersistKey]; - [[NSUserDefaults standardUserDefaults] synchronize]; - - return openUDID; -} - (NSString *)location diff --git a/MobileTracking/MobileTracking/TaskQueue/MMA_Task.h b/MobileTracking/MobileTracking/TaskQueue/MMA_Task.h index d05a29ff372fef2d2910ef5625157f4bd68b53d9..dd66e8153a3c12dde40ab8066476421fc79e4b20 100755 --- a/MobileTracking/MobileTracking/TaskQueue/MMA_Task.h +++ b/MobileTracking/MobileTracking/TaskQueue/MMA_Task.h @@ -7,11 +7,22 @@ // #import - +//定义枚举类型 +typedef enum _taskType { + CLICK = 0, + IMPRESSION, + VIEWABLE, + NONVIEWABLE, + UNMEASURED, +} taskType; +#define TaskTypeAry @[@"CLICK",@"IMPRESSION",@"VIEWABLE",@"NONVIEWABLE",@"UNMEASURED"] @interface MMA_Task : NSObject @property (nonatomic, strong) NSString *url; @property (nonatomic, assign) NSTimeInterval timePoint; @property (nonatomic, assign) NSInteger failedCount; @property (nonatomic, assign) BOOL hasFailed; @property (nonatomic, assign) BOOL hasLock; +@property (nonatomic, copy) NSString * tType; +@property(nonatomic,copy)void(^succeedBlock)(id); +@property(nonatomic,copy)void(^failedBlock)(); @end diff --git a/MobileTracking/MobileTracking/Vendor/OpenUDID/MMA_OpenUDID.h b/MobileTracking/MobileTracking/Vendor/OpenUDID/MMA_OpenUDID.h deleted file mode 100755 index 1a18b2282c8bb15154c815f42b47574c4a632b4d..0000000000000000000000000000000000000000 --- a/MobileTracking/MobileTracking/Vendor/OpenUDID/MMA_OpenUDID.h +++ /dev/null @@ -1,65 +0,0 @@ -// -// OpenUDID.h -// openudid -// -// initiated by Yann Lechelle (cofounder @Appsfire) on 8/28/11. -// Copyright 2011 OpenUDID.org -// -// Main branches -// iOS code: https://github.com/ylechelle/OpenUDID -// - -/* - !!! IMPORTANT !!! - - IF YOU ARE GOING TO INTEGRATE OpenUDID INSIDE A (STATIC) LIBRARY, - PLEASE MAKE SURE YOU REFACTOR THE OpenUDID CLASS WITH A PREFIX OF YOUR OWN, - E.G. ACME_OpenUDID. THIS WILL AVOID CONFUSION BY DEVELOPERS WHO ARE ALSO - USING OpenUDID IN THEIR OWN CODE. - - !!! IMPORTANT !!! - -*/ - -/* - http://en.wikipedia.org/wiki/Zlib_License - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*/ - -#import - -// -// Usage: -// #include "OpenUDID.h" -// NSString* openUDID = [OpenUDID value]; -// - -#define kOpenUDIDErrorNone 0 -#define kOpenUDIDErrorOptedOut 1 -#define kOpenUDIDErrorCompromised 2 - -@interface MMA_OpenUDID : NSObject { -} -+ (NSString*) value; -+ (NSString*) valueWithError:(NSError**)error; -+ (void) setOptOut:(BOOL)optOutValue; - -@end diff --git a/MobileTracking/MobileTracking/Vendor/OpenUDID/MMA_OpenUDID.m b/MobileTracking/MobileTracking/Vendor/OpenUDID/MMA_OpenUDID.m deleted file mode 100755 index 4341300d3a1b55eed3fc0171ae17cb3b1aaef82f..0000000000000000000000000000000000000000 --- a/MobileTracking/MobileTracking/Vendor/OpenUDID/MMA_OpenUDID.m +++ /dev/null @@ -1,433 +0,0 @@ -// -// OpenUDID.m -// openudid -// -// initiated by Yann Lechelle (cofounder @Appsfire) on 8/28/11. -// Copyright 2011, 2012 OpenUDID.org -// -// Initiators/root branches -// iOS code: https://github.com/ylechelle/OpenUDID -// Android code: https://github.com/vieux/OpenUDID -// -// Contributors: -// https://github.com/ylechelle/OpenUDID/contributors -// - -/* - http://en.wikipedia.org/wiki/Zlib_License - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*/ - -#if __has_feature(objc_arc) -#error This file uses the classic non-ARC retain/release model; hints below... - // to selectively compile this file as non-ARC, do as follows: - // https://img.skitch.com/20120717-g3ag5h9a6ehkgpmpjiuen3qpwp.png -#endif - -#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) - -#import "MMA_OpenUDID.h" -#import // Need to import for CC_MD5 access -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR -#import -#import -#else -#import -#endif - -#define OpenUDIDLog(fmt, ...) -//#define OpenUDIDLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); -//#define OpenUDIDLog(fmt, ...) NSLog((@"[Line %d] " fmt), __LINE__, ##__VA_ARGS__); - -static NSString * kOpenUDIDSessionCache = nil; -static NSString * const kOpenUDIDDescription = @"OpenUDID_with_iOS6_Support"; -static NSString * const kOpenUDIDKey = @"OpenUDID"; -static NSString * const kOpenUDIDSlotKey = @"OpenUDID_slot"; -static NSString * const kOpenUDIDAppUIDKey = @"OpenUDID_appUID"; -static NSString * const kOpenUDIDTSKey = @"OpenUDID_createdTS"; -static NSString * const kOpenUDIDOOTSKey = @"OpenUDID_optOutTS"; -static NSString * const kOpenUDIDDomain = @"org.OpenUDID"; -static NSString * const kOpenUDIDSlotPBPrefix = @"org.OpenUDID.slot."; -static int const kOpenUDIDRedundancySlots = 100; - -@interface MMA_OpenUDID (Private) -+ (void) _setDict:(id)dict forPasteboard:(id)pboard; -+ (NSMutableDictionary*) _getDictFromPasteboard:(id)pboard; -+ (NSString*) _generateFreshOpenUDID; -@end - -@implementation MMA_OpenUDID - -// Archive a NSDictionary inside a pasteboard of a given type -// Convenience method to support iOS & Mac OS X -// -+ (void) _setDict:(id)dict forPasteboard:(id)pboard { -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR - [pboard setData:[NSKeyedArchiver archivedDataWithRootObject:dict] forPasteboardType:kOpenUDIDDomain]; -#else - [pboard setData:[NSKeyedArchiver archivedDataWithRootObject:dict] forType:kOpenUDIDDomain]; -#endif -} - -// Retrieve an NSDictionary from a pasteboard of a given type -// Convenience method to support iOS & Mac OS X -// -+ (NSMutableDictionary*) _getDictFromPasteboard:(id)pboard { -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR - id item = [pboard dataForPasteboardType:kOpenUDIDDomain]; -#else - id item = [pboard dataForType:kOpenUDIDDomain]; -#endif - if (item) { - @try{ - item = [NSKeyedUnarchiver unarchiveObjectWithData:item]; - } @catch(NSException* e) { - OpenUDIDLog(@"Unable to unarchive item %@ on pasteboard!", [pboard name]); - item = nil; - } - } - - // return an instance of a MutableDictionary - return [NSMutableDictionary dictionaryWithDictionary:(item == nil || [item isKindOfClass:[NSDictionary class]]) ? item : nil]; -} - -// Private method to create and return a new OpenUDID -// Theoretically, this function is called once ever per application when calling [OpenUDID value] for the first time. -// After that, the caching/pasteboard/redundancy mechanism inside [OpenUDID value] returns a persistent and cross application OpenUDID -// -+ (NSString*) _generateFreshOpenUDID { - - NSString* _openUDID = nil; - - // August 2011: One day, this may no longer be allowed in iOS. When that is, just comment this line out. - // March 25th 2012: this day has come, let's remove this "outlawed" call... - // August 2012: well, perhaps much ado about nothing; in any case WWDC2012 gave us something to work with; read below -#if TARGET_OS_IPHONE -// if([UIDevice instancesRespondToSelector:@selector(uniqueIdentifier)]){ -// _openUDID = [[UIDevice currentDevice] uniqueIdentifier]; -// } -#endif - - // - // !!!!! IMPORTANT README !!!!! - // - // August 2012: iOS 6 introduces new APIs that help us deal with the now deprecated [UIDevice uniqueIdentifier] - // Since iOS 6 is still pre-release and under NDA, the following piece of code is meant to produce an error at - // compile time. Accredited developers integrating OpenUDID are expected to review the iOS 6 release notes and - // documentation, and replace the underscore ______ in the last part of the selector below with the right - // selector syntax as described here (make sure to use the right one! last word starts with the letter "A"): - // https://developer.apple.com/library/prerelease/ios/#documentation/UIKit/Reference/UIDevice_Class/Reference/UIDevice.html - // - // The semantic compiler warnings are still normal if you are compiling for iOS 5 only since Xcode will not - // know about the two instance methods used on that line; the code running on iOS will work well at run-time. - // Either way, it's time that you junped on the iOS 6 bandwagon and start testing your code on iOS 6 ;-) - // - // WHAT IS THE SIGNIFICANCE OF THIS CHANGE? - // - // Essentially, this means that OpenUDID will keep on behaving the same way as before for existing users or - // new users in iOS 5 and before. For new users on iOS 6 and after, the new official public APIs will take over. - // OpenUDID will therefore be obsoleted when iOS reaches significant adoption, anticipated around mid-2013. - - /* - - September 14; ok, new development. The alleged API has moved! - This part of the code will therefore be updated when iOS 6 is actually released. - Nevertheless, if you want to go ahead, the code should be pretty easy to - guess... it involves including a .h file from a nine-letter framework that ends - with the word "Support", and then assigning _openUDID with the only identifier method called on the sharedManager of that new class... don't forget to add - the framework to your project! - -#if TARGET_OS_IPHONE - if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0")) { - _openUDID = [[[UIDevice currentDevice] identifierForA_______] UUIDString]; -# error ^ read comments above, fix accordingly, and remove this #error line - } -#endif - - */ - - // Next we generate a UUID. - // UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs - // (Interface Identifiers), are 128-bit values guaranteed to be unique. A UUID is made unique over - // both space and time by combining a value unique to the computer on which it was generated—usually the - // Ethernet hardware address—and a value representing the number of 100-nanosecond intervals since - // October 15, 1582 at 00:00:00. - // We then hash this UUID with md5 to get 32 bytes, and then add 4 extra random bytes - // Collision is possible of course, but unlikely and suitable for most industry needs (e.g. aggregate tracking) - // - if (_openUDID==nil) { - CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); - CFStringRef cfstring = CFUUIDCreateString(kCFAllocatorDefault, uuid); - const char *cStr = CFStringGetCStringPtr(cfstring,CFStringGetFastestEncoding(cfstring)); - unsigned char result[16]; - CC_MD5( cStr, strlen(cStr), result ); - CFRelease(uuid); - CFRelease(cfstring); - - _openUDID = [NSString stringWithFormat: - @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%08x", - result[0], result[1], result[2], result[3], - result[4], result[5], result[6], result[7], - result[8], result[9], result[10], result[11], - result[12], result[13], result[14], result[15], - (NSUInteger)(arc4random() % NSUIntegerMax)]; - } - - // Call to other developers in the Open Source community: - // - // feel free to suggest better or alternative "UDID" generation code above. - // NOTE that the goal is NOT to find a better hash method, but rather, find a decentralized (i.e. not web-based) - // 160 bits / 20 bytes random string generator with the fewest possible collisions. - // - - return _openUDID; -} - - -// Main public method that returns the OpenUDID -// This method will generate and store the OpenUDID if it doesn't exist, typically the first time it is called -// It will return the null udid (forty zeros) if the user has somehow opted this app out (this is subject to 3rd party implementation) -// Otherwise, it will register the current app and return the OpenUDID -// -+ (NSString*) value { - @try { - return [MMA_OpenUDID valueWithError:nil]; - - } @catch (NSException *exception) { - return @""; - } -} - -+ (NSString*) valueWithError:(NSError **)error { - - if (kOpenUDIDSessionCache!=nil) { - if (error!=nil) - *error = [NSError errorWithDomain:kOpenUDIDDomain - code:kOpenUDIDErrorNone - userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID in cache from first call",@"description", nil]]; - return kOpenUDIDSessionCache; - } - - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - - // The AppUID will uniquely identify this app within the pastebins - // - NSString * appUID = [defaults objectForKey:kOpenUDIDAppUIDKey]; - if(appUID == nil) - { - // generate a new uuid and store it in user defaults - CFUUIDRef uuid = CFUUIDCreate(NULL); - appUID = (NSString *) CFUUIDCreateString(NULL, uuid); - CFRelease(uuid); - [appUID autorelease]; - } - - NSString* openUDID = nil; - NSString* myRedundancySlotPBid = nil; - NSDate* optedOutDate = nil; - BOOL optedOut = NO; - BOOL saveLocalDictToDefaults = NO; - BOOL isCompromised = NO; - - // Do we have a local copy of the OpenUDID dictionary? - // This local copy contains a copy of the openUDID, myRedundancySlotPBid (and unused in this block, the local bundleid, and the timestamp) - // - id localDict = [defaults objectForKey:kOpenUDIDKey]; - if ([localDict isKindOfClass:[NSDictionary class]]) { - localDict = [NSMutableDictionary dictionaryWithDictionary:localDict]; // we might need to set/overwrite the redundancy slot - openUDID = [localDict objectForKey:kOpenUDIDKey]; - myRedundancySlotPBid = [localDict objectForKey:kOpenUDIDSlotKey]; - optedOutDate = [localDict objectForKey:kOpenUDIDOOTSKey]; - optedOut = optedOutDate!=nil; - OpenUDIDLog(@"localDict = %@",localDict); - } - - // Here we go through a sequence of slots, each of which being a UIPasteboard created by each participating app - // The idea behind this is to both multiple and redundant representations of OpenUDIDs, as well as serve as placeholder for potential opt-out - // - NSString* availableSlotPBid = nil; - NSMutableDictionary* frequencyDict = [NSMutableDictionary dictionaryWithCapacity:kOpenUDIDRedundancySlots]; - for (int n=0; n0)? [arrayOfUDIDs lastObject] : nil; - OpenUDIDLog(@"Freq Dict = %@\nMost reliable %@",frequencyDict,mostReliableOpenUDID); - - // if openUDID was not retrieved from the local preferences, then let's try to get it from the frequency dictionary above - // - if (openUDID==nil) { - if (mostReliableOpenUDID==nil) { - // this is the case where this app instance is likely to be the first one to use OpenUDID on this device - // we create the OpenUDID, legacy or semi-random (i.e. most certainly unique) - // - openUDID = [MMA_OpenUDID _generateFreshOpenUDID]; - } else { - // or we leverage the OpenUDID shared by other apps that have already gone through the process - // - openUDID = mostReliableOpenUDID; - } - // then we create a local representation - // - if (localDict==nil) { - localDict = [NSMutableDictionary dictionaryWithCapacity:4]; - [localDict setObject:openUDID forKey:kOpenUDIDKey]; - [localDict setObject:appUID forKey:kOpenUDIDAppUIDKey]; - [localDict setObject:[NSDate date] forKey:kOpenUDIDTSKey]; - if (optedOut) [localDict setObject:optedOutDate forKey:kOpenUDIDTSKey]; - saveLocalDictToDefaults = YES; - } - } - else { - // Sanity/tampering check - // - if (mostReliableOpenUDID!=nil && ![mostReliableOpenUDID isEqualToString:openUDID]) - isCompromised = YES; - } - - // Here we store in the available PB slot, if applicable - // - OpenUDIDLog(@"Available Slot %@ Existing Slot %@",availableSlotPBid,myRedundancySlotPBid); - if (availableSlotPBid!=nil && (myRedundancySlotPBid==nil || [availableSlotPBid isEqualToString:myRedundancySlotPBid])) { -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR - UIPasteboard* slotPB = [UIPasteboard pasteboardWithName:availableSlotPBid create:YES]; - [slotPB setPersistent:YES]; -#else - NSPasteboard* slotPB = [NSPasteboard pasteboardWithName:availableSlotPBid]; -#endif - - // save slotPBid to the defaults, and remember to save later - // - if (localDict) { - [localDict setObject:availableSlotPBid forKey:kOpenUDIDSlotKey]; - saveLocalDictToDefaults = YES; - } - - // Save the local dictionary to the corresponding UIPasteboard slot - // - if (openUDID && localDict) - [MMA_OpenUDID _setDict:localDict forPasteboard:slotPB]; - } - - // Save the dictionary locally if applicable - // - if (localDict && saveLocalDictToDefaults) - [defaults setObject:localDict forKey:kOpenUDIDKey]; - - // If the UIPasteboard external representation marks this app as opted-out, then to respect privacy, we return the ZERO OpenUDID, a sequence of 40 zeros... - // This is a *new* case that developers have to deal with. Unlikely, statistically low, but still. - // To circumvent this and maintain good tracking (conversion ratios, etc.), developers are invited to calculate how many of their users have opted-out from the full set of users. - // This ratio will let them extrapolate convertion ratios more accurately. - // - if (optedOut) { - if (error!=nil) *error = [NSError errorWithDomain:kOpenUDIDDomain - code:kOpenUDIDErrorOptedOut - userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Application with unique id %@ is opted-out from OpenUDID as of %@",appUID,optedOutDate],@"description", nil]]; - - kOpenUDIDSessionCache = [[NSString stringWithFormat:@"%040x",0] retain]; - return kOpenUDIDSessionCache; - } - - // return the well earned openUDID! - // - if (error!=nil) { - if (isCompromised) - *error = [NSError errorWithDomain:kOpenUDIDDomain - code:kOpenUDIDErrorCompromised - userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Found a discrepancy between stored OpenUDID (reliable) and redundant copies; one of the apps on the device is most likely corrupting the OpenUDID protocol",@"description", nil]]; - else - *error = [NSError errorWithDomain:kOpenUDIDDomain - code:kOpenUDIDErrorNone - userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID succesfully retrieved",@"description", nil]]; - } - kOpenUDIDSessionCache = [openUDID retain]; - return kOpenUDIDSessionCache; -} - -+ (void) setOptOut:(BOOL)optOutValue { - - // init call - [MMA_OpenUDID value]; - - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - - // load the dictionary from local cache or create one - id dict = [defaults objectForKey:kOpenUDIDKey]; - if ([dict isKindOfClass:[NSDictionary class]]) { - dict = [NSMutableDictionary dictionaryWithDictionary:dict]; - } else { - dict = [NSMutableDictionary dictionaryWithCapacity:2]; - } - - // set the opt-out date or remove key, according to parameter - if (optOutValue) - [dict setObject:[NSDate date] forKey:kOpenUDIDOOTSKey]; - else - [dict removeObjectForKey:kOpenUDIDOOTSKey]; - - // store the dictionary locally - [defaults setObject:dict forKey:kOpenUDIDKey]; - - OpenUDIDLog(@"Local dict after opt-out = %@",dict); - - // reset memory cache - kOpenUDIDSessionCache = nil; - -} - -@end diff --git a/MobileTracking/MobileTracking/Vendor/OpenUDID/README.md b/MobileTracking/MobileTracking/Vendor/OpenUDID/README.md deleted file mode 100755 index 0477d6af6263c9a1bf6529c89d762d6dc9e0a633..0000000000000000000000000000000000000000 --- a/MobileTracking/MobileTracking/Vendor/OpenUDID/README.md +++ /dev/null @@ -1,68 +0,0 @@ -##IMPORTANT NOTE - -Please read this blog post before considering using OpenUDID: - - http://blog.appsfire.com/udid-is-dead-openudid-is-deprecated-long-live-advertisingidentifier/ - -####OpenUDID project notes - - IMPORTANT: IF YOU ARE GOING TO INTEGRATE OpenUDID INSIDE A (STATIC) LIBRARY, - PLEASE MAKE SURE YOU REFACTOR THE OpenUDID CLASS WITH A PREFIX OF YOUR OWN, - E.G. ACME_OpenUDID. THIS WILL AVOID CONFUSION BY DEVELOPERS WHO ARE ALSO - USING OpenUDID IN THEIR OWN CODE. - -![image](http://appsfire.com/images/misc/OpenUDID_Industry_supporters_2.png) - -####Follow OpenUDID on Twitter -http://twitter.com/OpenUDID - -####Who is behind OpenUDID -The project was initiated by Yann Lechelle (co-founder Appsfire) on 8/28/11 - -- https://github.com/ylechelle - -Many have joined the effort since. Please browse this github projects to discover the many contributors (discussions, code, pull requests, alternative branches, etc…) - -- https://github.com/ylechelle/OpenUDID/network -- https://github.com/ylechelle/OpenUDID/contributors -- https://github.com/ylechelle/OpenUDID/issues - -####Master Branches & ports to other OSes -- iOS / MacOS code: https://github.com/ylechelle/OpenUDID -- Android code: https://github.com/vieux/OpenUDID -- CSharp.Net & SilverLight: https://github.com/jasonlamkk/OpenUDID.Net - -####Usage - - #include "OpenUDID.h" - NSString* openUDID = [OpenUDID value]; - -####Synopsis -OpenUDID is a drop-in replacement for the deprecated uniqueIdentifier property of the UIDevice class on iOS (a.k.a. UDID) and otherwise is an industry-friendly equivalent for iOS and Android, **and most recently Windows C# and Silverlight (see links above)**. - -The agenda for this community driven project is to: -- Provide a reliable proxy and replacement for a universal unique device identifier. That is, persistent and sufficiently unique, on a per device basis. -- NOT use an obvious other sensitive unique identifier (like the MAC address) to avoid further deprecation and to protect device-level privacy concerns -- Enable the same OpenUDID to be accessed by any app on the same device -- Supply open-source code to generate and access the OpenUDID, for iOS and Android -- Incorporate, from the beginning, a system that will enable user opt-out to match Apple’s initial intent - -####Context -If you’re not already familiar with UDID’s, it’s a critical piece of information used for analytics or CRM purposes. A developer could use a UDID as a means to track how much time a user spent in his free app before upgrading to the paid version. UDIDs are also helpful for tracking the source of a download when advertising on an ad network. This is a fairly universal need in a thriving ecosystem: developers need the traceability from clicks to downloads to ensure that they pay the right price for their promotion. Proper tracking and funnel conversion is what has made the web a better place, with healthy competition and quantifiable metrics. - -In the wake of Apple’s decision to deprecate UDID, some ad networks have already introduced their own proprietary solutions or worse adopted a low hanging fruit like the MAC address. The main motivation here was to find a UDID replacement not owned by any single provider, not bound to the device in the hardware sense. This open source initiative is to enable a better solution for thousands of other mobile app developers. - -#####Version History -- August 2011: launch of the initiative -- Sept. 9 2011: v1.0 of the code meeting all requirements -- March 25 2012: removing all traces of the offending call on iOS -- June 7 2013: call for deprecation announced here: - http://blog.appsfire.com/udid-is-dead-openudid-is-deprecated-long-live-advertisingidentifier/ - -####Contributions needed -Equivalent OpenUDID systems on Blackberry, other platforms, etc... - -####Seals to add on your sites if you use OpenUDID -![image](http://appsfire.com/images/misc/openudid_seal_large.png) -![image](http://appsfire.com/images/misc/openudid_seal_medium.png) -![image](http://appsfire.com/images/misc/openudid_seal_small.png) diff --git a/MobileTracking/Viewability/MMA_AdCalSize.m b/MobileTracking/Viewability/MMA_AdCalSize.m index bfd928f0766e5e837886d95836b3aca33945e48d..db7538614bea28335d0118be1789097d97bdbcdb 100644 --- a/MobileTracking/Viewability/MMA_AdCalSize.m +++ b/MobileTracking/Viewability/MMA_AdCalSize.m @@ -120,8 +120,8 @@ adNode.right = [self.sortedXValues[aY-1] floatValue]; adNode.len = 0; [self.nodeList setObject:adNode forKey:@(index)]; - - if (aX + 1 == aY) { + //X与Y相等时会发生 爆栈问题。 + if (aX + 1 >= aY) { return; } diff --git a/MobileTracking/Viewability/UIView+MMA_Monitor.m b/MobileTracking/Viewability/UIView+MMA_Monitor.m index 5a9b4178cd7369da80472daca0de1a979f6e1c08..fdf001c521cfce52cd8a392f0b05e1dfd832ce52 100644 --- a/MobileTracking/Viewability/UIView+MMA_Monitor.m +++ b/MobileTracking/Viewability/UIView+MMA_Monitor.m @@ -125,25 +125,46 @@ /** return is super -> */ - (BOOL)mma_isSuper:(UIView *)view { - NSArray *superviews = nil; - if (!superviews) { - superviews = [self mma_superviews]; - } - if ([superviews indexOfObject:view] == NSNotFound) { - return NO; - } - return YES; + + NSArray *superviews = nil; + if (!superviews) { + superviews = [self mma_superviews]; + } + + + + if ([superviews indexOfObject:view] == NSNotFound) { + return NO; + } + + return YES; + + } - (NSArray *)mma_superviews { - NSMutableArray *supers = [NSMutableArray array]; - [supers addObject:self.window]; - UIView *superview = self.superview; - while (superview) { - [supers addObject:superview]; - superview = superview.superview; + @try { + NSMutableArray *supers = [NSMutableArray array]; + + if (self.window) { + [supers addObject:self.window]; + } + UIView *superview = self.superview; + while (superview) { + [supers addObject:superview]; + superview = superview.superview; + } + return [supers copy]; + } @catch (NSException *exception) { + + return nil; + + } @finally { + } - return [supers copy]; + + + } /** height */ diff --git a/MobileTracking/Viewability/VAMaros.h b/MobileTracking/Viewability/VAMaros.h index 5530ea329149388cdca9814291a319c4480ea113..1783ce1f8ff188826c5aa96df7dd18a670be5262 100644 --- a/MobileTracking/Viewability/VAMaros.h +++ b/MobileTracking/Viewability/VAMaros.h @@ -16,7 +16,7 @@ #define VAPixelStringFromPoint(x) [VAMaros pointToPixelString:x] #define DLOG(FORMAT, ...) //printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); -#define NSLog(FORMAT, ...) //printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); +#define NSLog(FORMAT, ...)// printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); //#define NSLog(format,...) diff --git a/MobileTracking/Viewability/VAMonitor.h b/MobileTracking/Viewability/VAMonitor.h index b8c1f13e4a4a31482134fd693382826049773f0d..e69f7f6ec6b692d02241e08565de8fcee68546cd 100644 --- a/MobileTracking/Viewability/VAMonitor.h +++ b/MobileTracking/Viewability/VAMonitor.h @@ -13,11 +13,12 @@ #import "VAMonitorConfig.h" #import "MMA_Macro.h" #import "VAMaros.h" +#import "MMA_Task.h" @class VAMonitor; @protocol VAMonitorDataProtocol -- (void)monitor:(VAMonitor *)monitor didReceiveData:(NSDictionary *)monitorData; +- (void)monitor:(VAMonitor *)monitor task:(MMA_Task *)task didReceiveData:(NSDictionary *)monitorData succeed:(void(^)(id))succeedBlock failed:(void(^)())failedBlock; @end @@ -48,7 +49,9 @@ typedef NS_ENUM(NSUInteger, VAProgressStatus) { @property (nonatomic, copy, readonly) NSString *impressionID; @property (nonatomic, copy, readonly) NSString *adID; @property (nonatomic, copy, readonly) NSString *domain; - +@property(nonatomic,strong)MMA_Task * task; +@property (nonatomic,copy)void(^succeedBlock)(id); +@property (nonatomic,copy)void(^failedBlock)(id); @property (nonatomic, strong, readonly) VAMonitorTimeline *timeline; @property (nonatomic) VAMonitorStatus status; diff --git a/MobileTracking/Viewability/VAMonitor.m b/MobileTracking/Viewability/VAMonitor.m index b3053c9365af4349103c658b8907964009ee64ca..8132565286adb419b3bc9cfb33717fba198ab83c 100644 --- a/MobileTracking/Viewability/VAMonitor.m +++ b/MobileTracking/Viewability/VAMonitor.m @@ -127,8 +127,8 @@ if ([self canRecord:AD_VB_VIDEOPROGRESS]) { accessDictionary[[self keyQuery:AD_VB_VIDEOPROGRESS]] = uploadPar; } - if(self.delegate && [self.delegate respondsToSelector:@selector(monitor:didReceiveData:)]) { - [_delegate monitor:self didReceiveData:accessDictionary]; + if(self.delegate && [self.delegate respondsToSelector:@selector(monitor:task:didReceiveData:succeed:failed:)]) { + [_delegate monitor:self task:_task didReceiveData:accessDictionary succeed:self.succeedBlock failed:self.failedBlock]; } } @@ -218,8 +218,8 @@ } }]; - if(self.delegate && [self.delegate respondsToSelector:@selector(monitor:didReceiveData:)]) { - [_delegate monitor:self didReceiveData:accessDictionary]; + if(self.delegate && [self.delegate respondsToSelector:@selector(monitor:task:didReceiveData:succeed:failed:)]) { + [_delegate monitor:self task:_task didReceiveData:accessDictionary succeed:self.succeedBlock failed:self.failedBlock]; } self.status = VAMonitorStatusUploaded; diff --git a/MobileTracking/Viewability/ViewabilityService.m b/MobileTracking/Viewability/ViewabilityService.m index 4f9c0eca529a713136a0a7b153c0905f91d793ce..aaba3ea21e5aa058bd37a1d02f288c3d695d1019 100644 --- a/MobileTracking/Viewability/ViewabilityService.m +++ b/MobileTracking/Viewability/ViewabilityService.m @@ -81,7 +81,15 @@ static const char *view_capture_queue = "adview.capture.queue"; //可视化监测和进度监测如果有一个没有结束,则继续监测. } else if(tempStatus == VAMonitorStatusRuning || tempProgressStatus == VAProgressStatusRuning) { dispatch_async(_captureQueue, ^{ - [obj captureAdStatusAndVerify]; +#if DEBUG + + dispatch_async(dispatch_get_main_queue(), ^{ + [obj captureAdStatusAndVerify]; + }); +#else + [obj captureAdStatusAndVerify]; +#endif + NSLog(@"ID:%@视图捕获状态",obj.adID); }); diff --git a/MobileTracking/build.sh b/MobileTracking/build.sh index 3b70430688ce80fb4a6f014123cf58bfb30abb72..6e4efb7bf9575b48a2017d134db8b467e9d24ce5 100755 --- a/MobileTracking/build.sh +++ b/MobileTracking/build.sh @@ -12,10 +12,10 @@ iphonesimulator_path=${UNIVERSAL_OUTPUTFOLDER}/${CONFIGURATION}-iphonesimulator ${$targetName:?"mush set targetName"} xcodebuild -target $targetName clean # clean project -xcodebuild -target $targetName -sdk iphoneos13.0 # build iphoneos +xcodebuild -target $targetName -sdk iphoneos14.0 # build iphoneos #build iphonesimulator -xcodebuild -target $targetName -configuration ${CONFIGURATION} -sdk iphonesimulator13.0 -arch x86_64 -arch i386 +xcodebuild -target $targetName -configuration ${CONFIGURATION} -sdk iphonesimulator14.0 -arch x86_64 -arch i386 if [ ! -d "$universal_path" ]; then #判断文件是否存在 不存在创建 中括号两边要空格 mkdir "$universal_path" diff --git a/OutputRelease/MobileTracking.h b/OutputRelease/MobileTracking.h old mode 100644 new mode 100755 index 0b11d7edc98d80dc77d7288d1105b5fdb8f0ed2d..2223a46e959e1418043ae71753aaddc5c96930ca --- a/OutputRelease/MobileTracking.h +++ b/OutputRelease/MobileTracking.h @@ -6,7 +6,7 @@ // Copyright (c) 2014年 Admaster. All rights reserved. // -//#define MMA_SDK_VERSION @"V2.1.6" +//#define MMA_SDK_VERSION @"V2.2.0" #import @@ -21,18 +21,17 @@ - (void)enableLog:(BOOL)enableLog; // 点击 -- (void)click:(NSString *)url; +- (void)click:(NSString *)url succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; /* 普通曝光 url:监测的链接 adView:监测的广告视图对象 impressionType:曝光类型。Tracked Ads:0;曝光:1 */ -- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type; +- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; // 可视化监测曝光 -- (void)view:(NSString *)url ad:(UIView *)adView; - +- (void)view:(NSString *)url ad:(UIView *)adView succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; /* 视频可视化监测曝光 自动播放:1 @@ -40,7 +39,7 @@ 无法识别:0 */ -- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type; +- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; //停止可见监测 - (void)stop:(NSString *)url; diff --git a/OutputRelease/libMobileTracking.a b/OutputRelease/libMobileTracking.a index 3f535d58cc9195ed56e5e83dc63dcdee5505ffe5..1bfa7cfebcd0ec92af3d3415905d217873842d15 100644 Binary files a/OutputRelease/libMobileTracking.a and b/OutputRelease/libMobileTracking.a differ diff --git a/OutputRelease/libMobileTracking.xcframework/Info.plist b/OutputRelease/libMobileTracking.xcframework/Info.plist new file mode 100644 index 0000000000000000000000000000000000000000..502d42e1e31513153225bc6a0d3922c5ec3601ea --- /dev/null +++ b/OutputRelease/libMobileTracking.xcframework/Info.plist @@ -0,0 +1,62 @@ + + + + + AvailableLibraries + + + HeadersPath + Headers + LibraryIdentifier + ios-i386_x86_64-simulator + LibraryPath + libMobileTrackingSimulator.a + SupportedArchitectures + + i386 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + HeadersPath + Headers + LibraryIdentifier + ios-arm64_armv7_armv7s + LibraryPath + libMobileTracking.a + SupportedArchitectures + + arm64 + armv7 + armv7s + + SupportedPlatform + ios + + + HeadersPath + Headers + LibraryIdentifier + ios-x86_64-maccatalyst + LibraryPath + libMobileTrackingMacCatalyst.a + SupportedArchitectures + + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + maccatalyst + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/OutputRelease/libMobileTracking.xcframework/ios-arm64_armv7_armv7s/Headers/MobileTracking.h b/OutputRelease/libMobileTracking.xcframework/ios-arm64_armv7_armv7s/Headers/MobileTracking.h new file mode 100755 index 0000000000000000000000000000000000000000..2223a46e959e1418043ae71753aaddc5c96930ca --- /dev/null +++ b/OutputRelease/libMobileTracking.xcframework/ios-arm64_armv7_armv7s/Headers/MobileTracking.h @@ -0,0 +1,69 @@ +// +// MobileTracking.h +// MobileTracking +// +// Created by Wenqi on 14-3-11. +// Copyright (c) 2014年 Admaster. All rights reserved. +// + +//#define MMA_SDK_VERSION @"V2.2.0" + +#import + +@interface MobileTracking : NSObject + ++ (MobileTracking *)sharedInstance; + +// 配置远程XML配置文件地址 +- (void)configFromUrl:(NSString *)url; + +// 是否开启调试日志 +- (void)enableLog:(BOOL)enableLog; + +// 点击 +- (void)click:(NSString *)url succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +/* 普通曝光 + url:监测的链接 + adView:监测的广告视图对象 + impressionType:曝光类型。Tracked Ads:0;曝光:1 + */ +- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +// 可视化监测曝光 +- (void)view:(NSString *)url ad:(UIView *)adView succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; +/* 视频可视化监测曝光 + 自动播放:1 + + 手动播放:2 + + 无法识别:0 + */ +- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +//停止可见监测 +- (void)stop:(NSString *)url; + +// 普通曝光 +- (void)jsView:(NSString *)url ad:(UIView *)adView; + +// 视频可视化监测曝光 +- (void)jsViewVideo:(NSString *)url ad:(UIView *)adView; + +// 清空待发送任务队列和发送失败任务队列 +- (BOOL)clearAll; + +// 清空发送失败任务队列 +- (BOOL)clearErrorList; + +// 进入后台调用 +- (void)didEnterBackground; + +// 进入前台调用 +- (void)didEnterForeground; + +// 结束时调用 +- (void)willTerminate; + + +@end diff --git a/OutputRelease/libMobileTracking.xcframework/ios-arm64_armv7_armv7s/libMobileTracking.a b/OutputRelease/libMobileTracking.xcframework/ios-arm64_armv7_armv7s/libMobileTracking.a new file mode 100644 index 0000000000000000000000000000000000000000..88148557800be9c9fb5c12661150c8c8cef4251c Binary files /dev/null and b/OutputRelease/libMobileTracking.xcframework/ios-arm64_armv7_armv7s/libMobileTracking.a differ diff --git a/OutputRelease/libMobileTracking.xcframework/ios-i386_x86_64-simulator/Headers/MobileTracking.h b/OutputRelease/libMobileTracking.xcframework/ios-i386_x86_64-simulator/Headers/MobileTracking.h new file mode 100755 index 0000000000000000000000000000000000000000..2223a46e959e1418043ae71753aaddc5c96930ca --- /dev/null +++ b/OutputRelease/libMobileTracking.xcframework/ios-i386_x86_64-simulator/Headers/MobileTracking.h @@ -0,0 +1,69 @@ +// +// MobileTracking.h +// MobileTracking +// +// Created by Wenqi on 14-3-11. +// Copyright (c) 2014年 Admaster. All rights reserved. +// + +//#define MMA_SDK_VERSION @"V2.2.0" + +#import + +@interface MobileTracking : NSObject + ++ (MobileTracking *)sharedInstance; + +// 配置远程XML配置文件地址 +- (void)configFromUrl:(NSString *)url; + +// 是否开启调试日志 +- (void)enableLog:(BOOL)enableLog; + +// 点击 +- (void)click:(NSString *)url succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +/* 普通曝光 + url:监测的链接 + adView:监测的广告视图对象 + impressionType:曝光类型。Tracked Ads:0;曝光:1 + */ +- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +// 可视化监测曝光 +- (void)view:(NSString *)url ad:(UIView *)adView succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; +/* 视频可视化监测曝光 + 自动播放:1 + + 手动播放:2 + + 无法识别:0 + */ +- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +//停止可见监测 +- (void)stop:(NSString *)url; + +// 普通曝光 +- (void)jsView:(NSString *)url ad:(UIView *)adView; + +// 视频可视化监测曝光 +- (void)jsViewVideo:(NSString *)url ad:(UIView *)adView; + +// 清空待发送任务队列和发送失败任务队列 +- (BOOL)clearAll; + +// 清空发送失败任务队列 +- (BOOL)clearErrorList; + +// 进入后台调用 +- (void)didEnterBackground; + +// 进入前台调用 +- (void)didEnterForeground; + +// 结束时调用 +- (void)willTerminate; + + +@end diff --git a/OutputRelease/libMobileTracking.xcframework/ios-i386_x86_64-simulator/libMobileTrackingSimulator.a b/OutputRelease/libMobileTracking.xcframework/ios-i386_x86_64-simulator/libMobileTrackingSimulator.a new file mode 100644 index 0000000000000000000000000000000000000000..2116268e4b92ac950e829098a6716895e9775555 Binary files /dev/null and b/OutputRelease/libMobileTracking.xcframework/ios-i386_x86_64-simulator/libMobileTrackingSimulator.a differ diff --git a/OutputRelease/libMobileTracking.xcframework/ios-x86_64-maccatalyst/Headers/MobileTracking.h b/OutputRelease/libMobileTracking.xcframework/ios-x86_64-maccatalyst/Headers/MobileTracking.h new file mode 100755 index 0000000000000000000000000000000000000000..2223a46e959e1418043ae71753aaddc5c96930ca --- /dev/null +++ b/OutputRelease/libMobileTracking.xcframework/ios-x86_64-maccatalyst/Headers/MobileTracking.h @@ -0,0 +1,69 @@ +// +// MobileTracking.h +// MobileTracking +// +// Created by Wenqi on 14-3-11. +// Copyright (c) 2014年 Admaster. All rights reserved. +// + +//#define MMA_SDK_VERSION @"V2.2.0" + +#import + +@interface MobileTracking : NSObject + ++ (MobileTracking *)sharedInstance; + +// 配置远程XML配置文件地址 +- (void)configFromUrl:(NSString *)url; + +// 是否开启调试日志 +- (void)enableLog:(BOOL)enableLog; + +// 点击 +- (void)click:(NSString *)url succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +/* 普通曝光 + url:监测的链接 + adView:监测的广告视图对象 + impressionType:曝光类型。Tracked Ads:0;曝光:1 + */ +- (void)view:(NSString *)url ad:(UIView *)adView impressionType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +// 可视化监测曝光 +- (void)view:(NSString *)url ad:(UIView *)adView succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; +/* 视频可视化监测曝光 + 自动播放:1 + + 手动播放:2 + + 无法识别:0 + */ +- (void)viewVideo:(NSString *)url ad:(UIView *)adView videoPlayType:(NSInteger)type succeed:(void(^)(NSString * eventType))succeedBlock failed:(void(^)(NSString * errorMessage))failedBlock; + +//停止可见监测 +- (void)stop:(NSString *)url; + +// 普通曝光 +- (void)jsView:(NSString *)url ad:(UIView *)adView; + +// 视频可视化监测曝光 +- (void)jsViewVideo:(NSString *)url ad:(UIView *)adView; + +// 清空待发送任务队列和发送失败任务队列 +- (BOOL)clearAll; + +// 清空发送失败任务队列 +- (BOOL)clearErrorList; + +// 进入后台调用 +- (void)didEnterBackground; + +// 进入前台调用 +- (void)didEnterForeground; + +// 结束时调用 +- (void)willTerminate; + + +@end diff --git a/OutputRelease/libMobileTracking.xcframework/ios-x86_64-maccatalyst/libMobileTrackingMacCatalyst.a b/OutputRelease/libMobileTracking.xcframework/ios-x86_64-maccatalyst/libMobileTrackingMacCatalyst.a new file mode 100644 index 0000000000000000000000000000000000000000..f6bf454c8f70aa56ca89a6b1a06604ebbec55ae3 Binary files /dev/null and b/OutputRelease/libMobileTracking.xcframework/ios-x86_64-maccatalyst/libMobileTrackingMacCatalyst.a differ diff --git a/OutputRelease/sdkconfig.xml b/OutputRelease/sdkconfig.xml index d4a8aa05a6192faf486f0aaf04dbbb7f668cb330..66f5d87b4ba38f8a568c96f39c47e1a92ceeb1ab 100644 --- a/OutputRelease/sdkconfig.xml +++ b/OutputRelease/sdkconfig.xml @@ -781,398 +781,432 @@ - + + + + + isRoot + l1 + true + true + + + + isSimulator + l2 + true + true + + + + isHook + l3 + true + true + + + + isAdb + l4 + true + true + + & https://g.cn.miaozhen.com/x/k=adid + + + svl + = true - - girdsum - - - - - - - gridsumdissector.com - - - - fm6dOWUqZ - sign - - - true - - 604800 - - 1 - - md5 - raw - md5 - md5 - - - - - - - - OS - os - true - true - - - - TS - ts - true - true - - - - MAC - m - true - true - - - - - IDFA - if - true - true - - - - IMEI - im - true - true - - - - ANDROIDID - aid - true - true - - - - OAID - oa - true - true - - - - WIFI - wifi - true - true - - - - AKEY - ak - true - true - - - - ANAME - an - true - true - - - - - SCWH - scwh - true - true - - - - - WIFISSID - wfssid - true - true - - - - WIFIBSSID - wfbssid - true - true - - - - OPENUDID - oid - true - true - - - - TERM - term - true - true - - - - OSVS - osvs - true - true - - - - LBS - lbs - true - true - - - - MUID - mid - true - true - - - - MUDS - muds - true - true - - - - REDIRECTURL - u - true - true - - - SDKVS - sdkvs - true - true - - - - - - start - event=start - true - - - - end - event=end - true - - - - - - - Adplacement - ap - false - false - - - - - - - ImpressionID - viid - true - true - - - - - ImpressionType - vitype - true - true - - - - AdviewabilityRecord - vir - true - true - - - - AdviewabilityEvents - ve - true - true - - - - AdviewabilityTime - vts - true - true - - - - AdviewabilityFrame - vf - true - true - - - - AdviewabilityPoint - vp - true - true - - - - AdviewabilityAlpha - va - true - true - - - - AdviewabilityShown - vs - true - true - - - - AdviewabilityCoverRate - vc - true - true - - - - AdviewabilityShowFrame - vsf - true - true - - - - AdviewabilityLight - vl - true - true - - - - AdviewabilityForground - vfg - true - true - - - - Adviewability - vab - true - true - - - - AdMeasurability - vm - true - true - - - - AdviewabilityResult - vr - true - true - - - - - - - AdviewabilityConfigArea - vca - true - true - - - - AdviewabilityConfigThreshold - vct - true - true - - - - AdviewabilityVideoDuration - vcvd - true - true - - - - AdviewabilityVideoProgress - vcvp - true - true - - - - AdviewabilityVideoPlayType - vcpt - true - true - - - - AdviewabilityVideoProgressPoint - vcpp - true - true - - 18ri - - AdviewabilityStrongInteract - vcsi - true - true - - - - & - - = - - true - + + girdsum + + + + + + + gridsumdissector.com + + + + fm6dOWUqZ + sign + + + true + + 604800 + + 1 + + md5 + raw + md5 + md5 + + + + + + + + OS + os + true + true + + + + TS + ts + true + true + + + + MAC + m + true + true + + + + + IDFA + if + true + true + + + + IMEI + im + true + true + + + + ANDROIDID + aid + true + true + + + + OAID + oa + true + true + + + + WIFI + wifi + true + true + + + + AKEY + ak + true + true + + + + ANAME + an + true + true + + + + + SCWH + scwh + true + true + + + + + WIFISSID + wfssid + true + true + + + + WIFIBSSID + wfbssid + true + true + + + + OPENUDID + oid + true + true + + + + TERM + term + true + true + + + + OSVS + osvs + true + true + + + + LBS + lbs + true + true + + + + MUID + mid + true + true + + + + MUDS + muds + true + true + + + + REDIRECTURL + u + true + true + + + SDKVS + sdkvs + true + true + + + + + + start + event=start + true + + + + end + event=end + true + + + + + + + Adplacement + ap + false + false + + + + + + + ImpressionID + viid + true + true + + + + + ImpressionType + vitype + true + true + + + + AdviewabilityRecord + vir + true + true + + + + AdviewabilityEvents + ve + true + true + + + + AdviewabilityTime + vts + true + true + + + + AdviewabilityFrame + vf + true + true + + + + AdviewabilityPoint + vp + true + true + + + + AdviewabilityAlpha + va + true + true + + + + AdviewabilityShown + vs + true + true + + + + AdviewabilityCoverRate + vc + true + true + + + + AdviewabilityShowFrame + vsf + true + true + + + + AdviewabilityLight + vl + true + true + + + + AdviewabilityForground + vfg + true + true + + + + Adviewability + vab + true + true + + + + AdMeasurability + vm + true + true + + + + AdviewabilityResult + vr + true + true + + + + + + + AdviewabilityConfigArea + vca + true + true + + + + AdviewabilityConfigThreshold + vct + true + true + + + + AdviewabilityVideoDuration + vcvd + true + true + + + + AdviewabilityVideoProgress + vcvp + true + true + + + + AdviewabilityVideoPlayType + vcpt + true + true + + + + AdviewabilityVideoProgressPoint + vcpp + true + true + + 18ri + + AdviewabilityStrongInteract + vcsi + true + true + + + + & + + = + + true + diff --git a/README.md b/README.md index 8678f18eb4e0220e70b691fd2d34c6898007891c..de8186dcd45b2270ba653057998668d4b8e2c0c9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ### 步骤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** 静态库的绝对路径 +2. 在项目工程 App 的 Target Build Settings 中的 **Other Linker Flags** 选项里添加 **-lxml2** **-all_load** 或 **-lxml2** **-force_load** 静态库的相对路径 3. 添加SDK需要的Framework 在需要添加SDK的项目的 Xcode 开发环境中选择 TARGETS-->Build Phases-->Link Binary With Libraries--> + 添加以下framework框架: @@ -14,6 +14,7 @@ CoreTelephony.framework SystemConfiguration.framework WebKit.framework + AppTrackingTransparency.framework ``` @@ -24,7 +25,7 @@ 使用说明: #### 1、初始化方法 -在进行监测之前,必须进行初始化,通过以上的代码进行初始化操作 +在进行监测之前,必须进行初始化,通过以下的代码进行初始化操作 ``` [MobileTracking sharedInstance] @@ -47,12 +48,18 @@ SDK 会自动下载远程的配置文件,使用最新的配置文件进行参 * ad:参数为当前广告视图对象(**广告可见曝光监测为必传字段,普通广告监测默认缺省。**) * videoPlayType:参数为当前视频广告的播放类型(**视频广告可见曝光监测为可选字段,1-自动播放,2-手动播放,0-无法识别。**) * impressionType:参数为曝光的类型。(**普通广告监测的类型为必选字段,0-Tracked ads,1-曝光**) + * succeed:参数为监测成功回调block。(**eventType为对应的曝光类型**) + * failed:参数为监测失败回调block。 3.1 曝光监测 ``` // impressionType=1 表示这是曝光监测。此时如果传0,表示这是Tracked ads监测 -[[MobileTracking sharedInstance] view:@"http://example.com/xxxxxx” ad:adView impressionType:1]; +[[MobileTracking sharedInstance] view:@"http://example.com/xxxxxx” ad:adView impressionType:1 succeed:^(NSString *eventType) { + //监测代码发送成功 +} failed:^(NSString *errorMessage) { + //监测代码发送失败 +}]; ``` @@ -65,7 +72,11 @@ SDK 会自动下载远程的配置文件,使用最新的配置文件进行参 3.2 可见性广告监测 ``` -[[MobileTracking sharedInstance] view:@"http://example.com/xxxxxx” ad:adview]; +[[MobileTracking sharedInstance] view:@"http://example.com/xxxxxx” ad:adview succeed:^(NSString *eventType) { + //监测代码发送成功 +} failed:^(NSString *errorMessage) { + //监测代码发送失败 +}]; ```   备注:对广告进行可见性监测时,广告必须是满足开始渲染(Begin to render,简称BtR)条件的合法曝光,否则SDK不会执行可见监测。在调用可见曝光监测接口时,SDK会查验传入的广告View对象是否已开始渲染,如果是,则SDK会向监测方发出曝光上报,并继续进行可见监测,直到满足可见/不可见条件,再结束可见监测流程;如果不是,则SDK会向监测方发出Tracked Ads上报,并结束可见监测流程。 @@ -73,7 +84,11 @@ SDK 会自动下载远程的配置文件,使用最新的配置文件进行参 3.3 视频可见性广告监测 ``` -[[MobileTracking sharedInstance] viewVideo:@"http://example.com/xxxxxx” ad:adview videoPlayType:type]; +[[MobileTracking sharedInstance] viewVideo:@"http://example.com/xxxxxx” ad:adview videoPlayType:type succeed:^(NSString *eventType) { + //监测代码发送成功 +} failed:^(NSString *errorMessage) { + //监测代码发送失败 +}]; ``` 3.4 可见性广告JS监测