diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index b082ba9e35a11b7ae53649148a787ab7ed6f7352..3b19f9429b75cf8ece9efc78000249579d923b38 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -26,15 +26,16 @@ 772E49C722F19F950009DFD2 /* videoAd.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 772E49C522F19F940009DFD2 /* videoAd.mp4 */; }; 77303F6722F98A3A00A51176 /* Advertisement.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 77303F6622F98A3A00A51176 /* Advertisement.mp4 */; }; 77303F6A22F98F2D00A51176 /* landingPageIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 77303F6922F98F2D00A51176 /* landingPageIcon.png */; }; - 7781CA6122C4BBD1002805DB /* sdkconfig.xml in Resources */ = {isa = PBXBuildFile; fileRef = 7781CA6022C4BBD1002805DB /* sdkconfig.xml */; }; AF353EDF1CFC24FB00969035 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF353EDE1CFC24FB00969035 /* AdSupport.framework */; }; AF4B464B218AB16400BE2F3F /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF353EE01CFC251C00969035 /* SystemConfiguration.framework */; }; AF4B464C218AB18300BE2F3F /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF353ED91CFC24E400969035 /* CoreLocation.framework */; }; AF6EA2E51EF655AD000DF811 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AF6EA2E41EF655AD000DF811 /* Images.xcassets */; }; AF7D89611EF655F50069A7DC /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AF7D89601EF655F50069A7DC /* Launch Screen.storyboard */; }; AFB3717E1F3854E10092930F /* admaster.js in Resources */ = {isa = PBXBuildFile; fileRef = AFB3717D1F3854E10092930F /* admaster.js */; }; - C765ABEC23262CDA0066E906 /* libMobileTrackingSimulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABB195518DAFA0300C7CAA9 /* libMobileTrackingSimulator.a */; }; + C726E4B5238665E1000EC447 /* sdkconfig.xml in Resources */ = {isa = PBXBuildFile; fileRef = C726E4B4238665E1000EC447 /* sdkconfig.xml */; }; C765ABED23262CE00066E906 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C765ABE923262CC20066E906 /* WebKit.framework */; }; + C78B6BB0236C303F0022BD30 /* libMobileTrackingSimulator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABB195518DAFA0300C7CAA9 /* libMobileTrackingSimulator.a */; }; + C78B6BC5236C33A60022BD30 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C78B6BC0236C33A60022BD30 /* CoreMotion.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -66,13 +67,6 @@ remoteGlobalIDString = 2A81721B18DAEB3A00E0EFEC; remoteInfo = MobileTrackingSimulator; }; - 77BDFC40230D44CE00079FDF /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 2A0C4E5218D6D19700200F18 /* MobileTracking.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 2A8171FF18DAEB3A00E0EFEC; - remoteInfo = MobileTrackingSimulator; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -107,7 +101,6 @@ 772E49C522F19F940009DFD2 /* videoAd.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = videoAd.mp4; sourceTree = ""; }; 77303F6622F98A3A00A51176 /* Advertisement.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = Advertisement.mp4; sourceTree = ""; }; 77303F6922F98F2D00A51176 /* landingPageIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = landingPageIcon.png; sourceTree = ""; }; - 7781CA6022C4BBD1002805DB /* sdkconfig.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = sdkconfig.xml; sourceTree = ""; }; AF2DFF4021955F0300B10C3F /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; }; AF353ED91CFC24E400969035 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; AF353EDE1CFC24FB00969035 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; @@ -115,7 +108,10 @@ AF6EA2E41EF655AD000DF811 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; AF7D89601EF655F50069A7DC /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; AFB3717D1F3854E10092930F /* admaster.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = admaster.js; sourceTree = ""; }; + C726E4B4238665E1000EC447 /* sdkconfig.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = sdkconfig.xml; 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; }; + C78B6BC0236C33A60022BD30 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -123,8 +119,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C78B6BC5236C33A60022BD30 /* CoreMotion.framework in Frameworks */, C765ABED23262CE00066E906 /* WebKit.framework in Frameworks */, - C765ABEC23262CDA0066E906 /* libMobileTrackingSimulator.a in Frameworks */, + C78B6BB0236C303F0022BD30 /* libMobileTrackingSimulator.a in Frameworks */, AF4B464C218AB18300BE2F3F /* CoreLocation.framework in Frameworks */, AF4B464B218AB16400BE2F3F /* SystemConfiguration.framework in Frameworks */, AF353EDF1CFC24FB00969035 /* AdSupport.framework in Frameworks */, @@ -167,6 +164,8 @@ 2A0C4E1C18D6D18700200F18 /* Frameworks */ = { isa = PBXGroup; children = ( + C74B7838237557EA0031DE10 /* Photos.framework */, + C78B6BC0236C33A60022BD30 /* CoreMotion.framework */, C765ABE923262CC20066E906 /* WebKit.framework */, AF2DFF4021955F0300B10C3F /* libxml2.tbd */, AF353EE01CFC251C00969035 /* SystemConfiguration.framework */, @@ -200,8 +199,8 @@ 772E49B722F195970009DFD2 /* VideoViewController.m */, 772E49B422F195950009DFD2 /* VideoViewController.xib */, AFB3717D1F3854E10092930F /* admaster.js */, + C726E4B4238665E1000EC447 /* sdkconfig.xml */, 2A0C4E2F18D6D18700200F18 /* Main.storyboard */, - 7781CA6022C4BBD1002805DB /* sdkconfig.xml */, AF7D89601EF655F50069A7DC /* Launch Screen.storyboard */, AF6EA2E41EF655AD000DF811 /* Images.xcassets */, 2A0C4E2418D6D18700200F18 /* Supporting Files */, @@ -262,7 +261,6 @@ buildRules = ( ); dependencies = ( - 77BDFC41230D44CE00079FDF /* PBXTargetDependency */, ); name = Demo; productName = Demo; @@ -366,13 +364,13 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7781CA6122C4BBD1002805DB /* sdkconfig.xml in Resources */, 77303F6722F98A3A00A51176 /* Advertisement.mp4 in Resources */, 772E49BD22F1959B0009DFD2 /* VideoViewController.xib in Resources */, AF6EA2E51EF655AD000DF811 /* Images.xcassets in Resources */, 772E49C222F1959B0009DFD2 /* NormalViewController.xib in Resources */, 77303F6A22F98F2D00A51176 /* landingPageIcon.png in Resources */, 772E49C722F19F950009DFD2 /* videoAd.mp4 in Resources */, + C726E4B5238665E1000EC447 /* sdkconfig.xml in Resources */, 2A0C4E2818D6D18700200F18 /* InfoPlist.strings in Resources */, AFB3717E1F3854E10092930F /* admaster.js in Resources */, AF7D89611EF655F50069A7DC /* Launch Screen.storyboard in Resources */, @@ -421,11 +419,6 @@ target = 2A0C4E1918D6D18700200F18 /* Demo */; targetProxy = 2A0C4E4018D6D18700200F18 /* PBXContainerItemProxy */; }; - 77BDFC41230D44CE00079FDF /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = MobileTrackingSimulator; - targetProxy = 77BDFC40230D44CE00079FDF /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ diff --git a/Demo/Demo/Demo-Info.plist b/Demo/Demo/Demo-Info.plist index 07537ff0a683c2340a3207dbcddfab33fc245a09..0a47c6876db741dc4aa7fd03ef07834c1be77a37 100755 --- a/Demo/Demo/Demo-Info.plist +++ b/Demo/Demo/Demo-Info.plist @@ -26,6 +26,8 @@ ???? CFBundleVersion 1.0 + LSApplicationCategoryType + LSRequiresIPhoneOS NSAppTransportSecurity @@ -33,6 +35,10 @@ NSAllowsArbitraryLoads + NSCameraUsageDescription + 光线 + NSLocationWhenInUseUsageDescription + 是否允许App通过您的地理位置信息获取您周边的相关数据 UILaunchStoryboardName Launch Screen UIMainStoryboardFile @@ -46,7 +52,5 @@ UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown - NSLocationWhenInUseUsageDescription - 是否允许App通过您的地理位置信息获取您周边的相关数据 diff --git a/Demo/Demo/sdkconfig.xml b/Demo/Demo/sdkconfig.xml index d46bf37c6d1eb27affbe55ef93b174bd26903780..4a540a2cc2214d17b7b71095a814a3e04cac6ed3 100644 --- a/Demo/Demo/sdkconfig.xml +++ b/Demo/Demo/sdkconfig.xml @@ -2,17 +2,17 @@ - + - + 0 60 60 - + @@ -28,23 +28,23 @@ 20 - + admaster - + - + admaster.com.cn - + @@ -52,7 +52,7 @@ 0b - + true @@ -60,7 +60,7 @@ 259200 0 - + @@ -72,18 +72,18 @@ md5 - + - - https://p.attri.mobi/a - - 24 - - true + + https://p.attri.mobi/a + + 24 + + true - + @@ -175,7 +175,7 @@ true true - + @@ -227,7 +227,7 @@ true - + @@ -243,8 +243,8 @@ true - - + + @@ -254,10 +254,10 @@ false - + - + ImpressionID @@ -265,7 +265,7 @@ true true - + @@ -352,7 +352,7 @@ true - + @@ -397,7 +397,7 @@ true - + - + - + , @@ -420,7 +420,7 @@ true - + miaozhen @@ -441,21 +441,21 @@ 604800 1 - + md5 raw md5 md5 - - + + - - /apl/ - - 24 - false + + /apl/ + + 24 + false @@ -511,7 +511,7 @@ true true - + OAID @@ -519,7 +519,7 @@ true true - + ADID @@ -771,7 +771,7 @@ true true - + AdviewabilityStrongInteract @@ -779,20 +779,144 @@ true true - + - - & - - - https://g.cn.miaozhen.com/x/k=adid - + + + + + isRoot + l1 + true + true + + + + Electricity + l2 + true + true + + + + isCharging + l3 + true + true + + + + isSimulator + l4 + true + true + + + + isHook + l5 + true + true + + + + isFlash + l6 + true + true + + + + Accelerometer + l7 + true + true + + + + Magnetometer + l8 + true + true + + + + Direction + l9 + true + true + + + + GyroActive + l10 + true + true + + + + Brightness + l11 + true + true + + + + Pressure + l12 + true + true + + + + Temperature + l13 + true + true + + + + Proximity + l14 + true + true + + + + DeviceMotion + l15 + true + true + + + + LineAccelerometer + l16 + true + true + + + + RotationVector + l17 + true + true + + + + & + + + https://g.cn.miaozhen.com/x/k=adid + + + svl = - + true - + girdsum @@ -800,7 +924,6 @@ gridsumdissector.com - @@ -814,10 +937,10 @@ 1 - raw - md5 + md5 + raw md5 - raw + md5 @@ -830,63 +953,79 @@ 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 + + + + + ADID + adid + true + true + + WIFI wifi true true - + AKEY ak true true - + ANAME an true true - + SCWH @@ -894,56 +1033,56 @@ true true - + OPENUDID oid true true - + ODIN odin true true - + TERM term true true - + OSVS osvs true true - + LBS lbs true true - + MUID mid true true - + MUDS muds true true - + REDIRECTURL u @@ -961,17 +1100,17 @@ start - m201 + event=start true end - m203 + event=end true - + @@ -981,7 +1120,7 @@ false - + @@ -989,6 +1128,20 @@ viid true true + + + + ImpressionType + vitype + true + true + + + + AdviewabilityRecord + varecord + true + true @@ -1047,6 +1200,13 @@ true true + + + AdviewabilityForground + vfg + true + true + AdviewabilityLight @@ -1054,69 +1214,68 @@ true true + AdviewabilityForground - vfg - true - true - - - - Adviewability - vab + vafg true true - + - AdMeasurability - vm + AdviewabilityResult + varesult true true - - - - + AdviewabilityConfigArea - vca + vaconfarea true true - + AdviewabilityConfigThreshold - vct + vaconfth true true - + AdviewabilityVideoDuration - vcvd + vavd true true - + AdviewabilityVideoProgress - vcvp + vavp true true - + AdviewabilityVideoPlayType - vcpt + vavpt true true - + AdviewabilityVideoProgressPoint - vcpp + vavpp + true + true + + + + + AdviewabilityStrongInteract + vasi true true @@ -1128,8 +1287,8 @@ true - - + + adbug @@ -1164,28 +1323,28 @@ true true - + TS t true true - + MAC n true true - + IDFA z true true - + IDFAMD5 0j @@ -1198,21 +1357,21 @@ true true - + WIFI w true true - + AKEY x true true - + ANAME y @@ -1226,7 +1385,7 @@ true true - + OPENUDID o @@ -1239,14 +1398,14 @@ true true - + OSVS q true true - + LBS l @@ -1287,9 +1446,9 @@ false false - + - + ImpressionID @@ -1297,7 +1456,7 @@ true true - + AdviewabilityEvents 2j @@ -1370,7 +1529,7 @@ true true - + @@ -1379,8 +1538,8 @@ true - - + + rtbasia @@ -1408,12 +1567,12 @@ raw @@ -1678,7 +1837,651 @@ true - - - + + nielsen + + + + + uat.cr-nielsen.com + + + + 4A5DBD140 + pk + + + true + + 604800 + + 1 + + md5 + raw + md5 + raw + + + + + + + + + OS + os + + true + + true + + + + TS + ts + true + true + + + + MAC + mac + true + true + + + + IDFA + idfa + true + true + + + + IMEI + imei + true + true + + + + ANDROIDID + androidid + true + true + + + + WIFI + wifi + true + true + + + + AKEY + akey + true + true + + + + ANAME + aname + true + true + + + + + SCWH + scwh + true + true + + + + OPENUDID + openudid + true + true + + + + ODIN + odin + true + true + + + + TERM + term + true + true + + + + OSVS + osvs + true + true + + + + LBS + lbs + true + true + + + + MUID + muid + true + true + + + + MUDS + muds + true + true + + + + REDIRECTURL + ref + true + true + + + SDKVS + sdkvs + true + true + + + + + + start + start + true + + + + end + end + true + + + + + + + Adplacement + hat_pid + false + false + + + + + + + ImpressionID + imp_id + true + true + + + ImpressionType + vit + true + true + + + + + AdviewabilityEvents + vbe + true + true + + + + AdviewabilityTime + vts + true + true + + + + AdviewabilityFrame + vbf + true + true + + + + AdviewabilityPoint + vbp + true + true + + + + AdviewabilityAlpha + vba + true + true + + + + AdviewabilityShown + vbs + true + true + + + + AdviewabilityCoverRate + vbc + true + true + + + + AdviewabilityShowFrame + vsf + true + true + + + + AdviewabilityLight + vbl + true + true + + + + AdviewabilityForground + vfg + true + true + + + + Adviewability + vvb + true + true + + + + AdMeasurability + vmb + 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 + + + + & + + = + + true + + + + TalkingData + + + + + + + .lnk0.com + + + DbXiUlEVN + s + + + false + + 604800 + + 1 + + md5 + raw + md5 + raw + + + + + + + + OS + osversion + true + true + + + TS + time + true + true + + + MAC + mac_md5 + true + true + + + IDFA + idfa + true + true + + + IMEI + imei_md5 + true + true + + + RAWIMEI + m3 + true + false + + + ANDROIDID + androidid + true + true + + + WIFI + nm + true + false + + + AKEY + pname + true + true + + + ANAME + aname + true + false + + + + SCWH + scwh + true + false + + + + WIFISSID + ssid + true + false + + + + WIFIBSSID + bssid + true + false + + + OPENUDID + openudid + true + false + + + TERM + devicetype + true + false + + + OSVS + osvs + true + false + + + LBS + mm + true + false + + + SDKVS + sdkvs + true + false + + + REDIRECTURL + o + true + false + + + + + + start + mb=start + false + + + + end + mb=end + false + + + + + Adplacement + adid + false + false + + + + + ImpressionID + vimpid + true + false + + + AdviewabilityRecord + va + true + false + + + AdviewabilityEvents + vct + true + false + + + AdviewabilityTime + 1 + true + false + + + AdviewabilityFrame + 2 + true + false + + + AdviewabilityPoint + 3 + true + false + + + AdviewabilityAlpha + 4 + true + false + + + AdviewabilityShown + 5 + true + false + + + AdviewabilityCoverRate + 6 + true + false + + + AdviewabilityShowFrame + 7 + true + false + + + AdviewabilityForground + 8 + true + false + + + AdviewabilityResult + vx + true + false + + + Adviewability + isview + true + false + + + AdMeasurability + ism + true + false + + + AdviewabilityConfigArea + vcr + true + false + + + AdviewabilityConfigThreshold + vtime + true + false + + + AdviewabilityVideoDuration + vb + true + false + + + AdviewabilityVideoProgress + vc + true + false + + + AdviewabilityVideoPlayType + vpt + true + false + + + AdviewabilityVideoProgressPoint + vj + true + false + + + + & + + = + + true + + + + diff --git a/MobileTracking/.DS_Store b/MobileTracking/.DS_Store index 75106d4601851c70c24acdfd5cb79a85aae0bdf4..12f586da1938a63dc89738e8fb592944ca67627c 100644 Binary files a/MobileTracking/.DS_Store and b/MobileTracking/.DS_Store differ diff --git a/MobileTracking/MobileTracking.xcodeproj/project.pbxproj b/MobileTracking/MobileTracking.xcodeproj/project.pbxproj index 6fdbaae3268582847bd44430af5f006f1d711e4f..95f42a84d366633e69337dd3a4b7e547481434f2 100755 --- a/MobileTracking/MobileTracking.xcodeproj/project.pbxproj +++ b/MobileTracking/MobileTracking.xcodeproj/project.pbxproj @@ -251,6 +251,8 @@ 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 = ""; }; + 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; }; /* End PBXFileReference section */ @@ -319,6 +321,8 @@ 2A632A1A18CEB10B00BE2533 /* Frameworks */ = { isa = PBXGroup; children = ( + C74B7835237557510031DE10 /* PhotosUI.framework */, + C74B78322375573A0031DE10 /* Photos.framework */, C765ABDF23262B660066E906 /* WebKit.framework */, 2ABFE29718CF2B5F007BD457 /* CoreLocation.framework */, 2ABFE28118CF1778007BD457 /* UIKit.framework */, diff --git a/MobileTracking/MobileTracking/Config/MMA_SDKConfig.h b/MobileTracking/MobileTracking/Config/MMA_SDKConfig.h index 7c670ff69490812f6df5c3f593e0965af2bd0fc1..1538dad2777c2f6af7a414ffdc1d041edd847892 100755 --- a/MobileTracking/MobileTracking/Config/MMA_SDKConfig.h +++ b/MobileTracking/MobileTracking/Config/MMA_SDKConfig.h @@ -50,6 +50,7 @@ @property (nonatomic, strong) NSMutableDictionary *arguments; @property (nonatomic, strong) NSMutableDictionary *Adplacement; @property (nonatomic, strong) NSMutableDictionary *viewabilityarguments; +@property (nonatomic, strong) NSMutableDictionary *sensorarguments; @end /*--------------加密签名设置--------------*/ @interface MMA_Signature : NSObject @@ -76,6 +77,7 @@ @property (nonatomic, strong) MMA_Config *config ; @property (nonatomic, strong) NSString *separator; @property (nonatomic, strong) NSString *equalizer; +@property (nonatomic, strong) NSString *antidevice; @property (nonatomic, assign) Boolean timeStampUseSecond; @property (nonatomic, strong) NSString *jsname; @property (nonatomic, strong) NSString *jsurl; diff --git a/MobileTracking/MobileTracking/Config/MMA_XMLReader.m b/MobileTracking/MobileTracking/Config/MMA_XMLReader.m index 7c7513ae9737d72546eed8e4b659e7bec2cebe8b..e77b41ff11ffa28e8617255c11cda4117c9695c5 100755 --- a/MobileTracking/MobileTracking/Config/MMA_XMLReader.m +++ b/MobileTracking/MobileTracking/Config/MMA_XMLReader.m @@ -128,6 +128,7 @@ company.separator = [[[element elementsForName:@"separator" ] firstObject] stringValue]; company.equalizer = [[[element elementsForName:@"equalizer" ] firstObject] stringValue]; + company.antidevice = [[[element elementsForName:@"antidevice" ] firstObject] stringValue]; if (company.equalizer == nil) { company.equalizer = @""; } @@ -201,6 +202,19 @@ [company.config.viewabilityarguments setValue:argument forKey:argument.key]; } + + company.config.sensorarguments = [NSMutableDictionary dictionary]; + NSArray *sensorarguments = [element nodesForXPath:@"config/sensorarguments/argument" error:nil]; + for(MMA_GDataXMLElement *el in sensorarguments){ + MMA_Argument *argument = [[MMA_Argument alloc] init]; + argument.key = [self StringTrimFromElement:el name:@"key"]; + argument.value = [self StringTrimFromElement:el name:@"value"]; + argument.urlEncode = [[self StringTrimFromElement:el name:@"urlEncode"] boolValue]; + argument.isRequired = [[self StringTrimFromElement:el name:@"isRequired"] boolValue]; + [company.config.sensorarguments setValue:argument forKey:argument.key]; + } + + [sdkConfig.companies setValue:company forKey:company.name]; } } diff --git a/MobileTracking/MobileTracking/MMA_Macro.h b/MobileTracking/MobileTracking/MMA_Macro.h index 174dbd943c3764ef5da81ce1d664f57b61e465f5..9013bb90752f9ad60a1d9d0f7c1cda4d570c47d4 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.3" +#define MMA_SDK_VERSION @"V2.1.4" #define NOTIFICATION_VB @"viewability_notification" #define NOTIFICATION_EXPOSE @"expose_notification" @@ -34,6 +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 NETWORK_STATUS_WIFI 1 #define NETWORK_STATUS_3G 0 @@ -90,8 +92,53 @@ #define AD_VB_VIDEOPLAYTYPE @"AdviewabilityVideoPlayType" //可视监测传入的视频播放类型 #define AD_VB_VIDEOPROGRESS @"AdviewabilityVideoProgress" //可视视频播放进度监测事件类型字段 (string)播放 1/4:25 播放 1/2:50播放 3/4:75 播放完成:100 - - + + + + + + + + + +/**IVT参数*/ +/**是否越狱*/ +#define IVT_isRoot @"isRoot" +/**剩余电量*/ +#define IVT_electricity @"electricity" +/**是否充电*/ +#define IVT_isCharging @"isCharging" +/**是否模拟器*/ +#define IVT_isSimulator @"isSimulator" +/**是否hook*/ +#define IVT_isHook @"isHook" +/**是否刷机*/ +#define IVT_isFlash @"isFlash" +/**加速度*/ +#define IVT_Accelerometer @"Accelerometer" +/**磁场*/ +#define IVT_Magnetometer @"Magnetometer" +/**方向*/ +#define IVT_direction @"direction" +/**陀螺仪*/ +#define IVT_gyroActive @"gyroActive" +/**光线*/ +#define IVT_brightness @"brightness" +/**气压*/ +#define IVT_pressure @"pressure" +/**温度*/ +#define IVT_temperature @"temperature" +/**距离*/ +#define IVT_proximity @"proximity" +/**重力*/ +#define IVT_deviceMotion @"deviceMotion" +/**线性加速度*/ +#define IVT_lineAccelerometer @"lineAccelerometer" +/**旋转矢量*/ +#define IVT_RotationVector @"RotationVector" + +#define IVT_ARRAY @[IVT_isRoot,IVT_electricity,IVT_isCharging,IVT_isSimulator,IVT_isHook,IVT_isFlash,IVT_Accelerometer,IVT_Magnetometer,IVT_direction,IVT_gyroActive,IVT_brightness,IVT_pressure,IVT_temperature,IVT_proximity,IVT_deviceMotion,IVT_lineAccelerometer,IVT_RotationVector] + //switch #define AD_VB_POLICY @"viewabilityTrackPolicy" //可视化监测采集策略 diff --git a/MobileTracking/MobileTracking/MobileTracking.h b/MobileTracking/MobileTracking/MobileTracking.h index 1874c8757cb1f067feadb665120493df236bf80e..510de4883c55547c8f619c5e82f27bb3df5470f2 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.3" +//#define MMA_SDK_VERSION @"V2.1.4" #import diff --git a/MobileTracking/MobileTracking/MobileTracking.m b/MobileTracking/MobileTracking/MobileTracking.m index aa75316eb1d60fcce0c1ee4641df9ec3e36d79af..5fcfb5069c8b9ce4d72600da1b4665c9df30a8be 100755 --- a/MobileTracking/MobileTracking/MobileTracking.m +++ b/MobileTracking/MobileTracking/MobileTracking.m @@ -26,6 +26,7 @@ #import "VAMonitorConfig.h" #import "ViewabilityJSService.h" #import "VAViewCapture.h" + @interface MobileTracking() @@ -93,12 +94,13 @@ [self initTimer]; [self openLBS]; [self initViewabilityService]; + } return self; } - + - (void)initSdkConfig { @try { @@ -222,6 +224,7 @@ - (void)handleSendQueueTimer:(NSTimer *)timer { + @try { NSInteger netStatus = [self.trackingInfoService networkCondition]; if (netStatus == NETWORK_STATUS_NO) { return; @@ -248,6 +251,10 @@ [[MMA_RequestQueue mainQueue] addOperation:operation]; } } + + } + @catch (NSException *exception) { + } } - (void)didEnterBackground @@ -388,9 +395,14 @@ // 去掉字段2g 如果有2j 去掉AdMeasurability Adviewability AdviewabilityEvents ImpressionID四个字段生成链接 - (MMA_VBOpenResult *)vbFilterURL:(NSString *)url isForViewability:(BOOL)viewability isVideo:(BOOL)isVideo videoPlayType:(NSInteger)type{ + + @try { MMA_Company *company = [self confirmCompany:url]; + + + MMA_VBOpenResult *res = [[MMA_VBOpenResult alloc] init]; res.config = self.viewabilityConfig; // 初始化默认配置为当前的配置 res.url = url; @@ -562,6 +574,11 @@ } res.canOpen = NO; } + + + + + res.url = filterURL; return res; } @catch (NSException *exception) { @@ -573,6 +590,8 @@ - (void)click:(NSString *)url { + + MMA_VBOpenResult *result = [self vbFilterURL:url isForViewability:NO isVideo:NO videoPlayType:0]; url = [NSString stringWithString:result.url]; MMA_Company *company = [self confirmCompany:url]; @@ -654,111 +673,114 @@ // viewability曝光不需要redirectURL已在前面剔除,普通曝光需要redirectURL - (void)view:(NSString *)url ad:(UIView *)adView isVideo:(BOOL)isVideo videoPlayType:(NSInteger)type handleResult:(MMA_VBOpenResult *)result impressionType:(NSInteger)impressionType{ - @try { - /** - * 获取是否含有使用viewability字段 - */ - result.config.videoPlayType = type; - - + + @try { + /** + * 获取是否含有使用viewability字段 + */ + result.config.videoPlayType = type; + + - 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; - } - - /** - * 获取广告位ID,如果没有扔回MMA - */ - NSString *adID = [self getAdIDForURL:url]; - if(!adID || !adID.length) { - [self filterURL:url]; - [MMA_Log log:@"adplacement get failed: %@" ,@"no adplacement"]; - return; - } - - NSString *domain = company.domain[0]; - if(!domain || !domain.length) { - domain = @""; - } - /** - * 拼接impressionID - */ - NSString *impressKey = [NSString stringWithFormat:@"%@-%@",domain,adID]; - - //iOS:MD5(idfa+idfv+广告位ID+时间戳(ms)) - NSString * timestamp = [NSString stringWithFormat:@"%.0f",[[NSDate date] timeIntervalSince1970] * 1000]; - NSString * compString = [NSString stringWithFormat:@"%@%@%@%@",[self.trackingInfoService idfa],[self.trackingInfoService idfv],adID,timestamp]; - NSString *impressID = [MMA_Helper md5HexDigest:compString]; - _impressionDictionary[impressKey] = impressID; - /** - * 发送正常的url 监测使用去噪impressionID曝光url,拼接AD_VB (2f),AD_VB_RESULT(vx) - */ - -// impressionType=0视为Tracked ads;impressionType=1视为曝光 - if (impressionType == 0) { - [self handleImpressionType:@"0" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; - } else if (impressionType == 1){ - if(!adView || ![adView isKindOfClass:[UIView class]]) { -// view=nil或者view非法的情况下,未达到CBR条件,如果是可见监测停止监测 - [self handleImpressionType:@"0" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; - return; - } else { -// 达到CBR条件,如果是可见监测继续监测 - [self handleImpressionType:@"1" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; - } - } - - /** - * Viewability功能模块 - */ - if(useViewabilityService) { - - NSMutableDictionary *keyvalueAccess = [NSMutableDictionary dictionary]; - [VIEW_ABILITY_KEY enumerateObjectsUsingBlock:^(NSString *obj, NSUInteger idx, BOOL * _Nonnull stop) { - MMA_Argument *argument = company.config.viewabilityarguments[obj]; - if(argument.key&& argument.key.length && argument.value && argument.value.length) { - keyvalueAccess[obj] = argument.value; + 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; } - }]; - - // 如果view非法或为空 不可测量参数置为0 - if(!adView || ![adView isKindOfClass:[UIView class]]) { - return; -// NSDictionary *dictionary = @{ -// AD_VB_EVENTS : @"[]", -// AD_VB : @"0", -// AD_VB_RESULT : @"2", -// IMPRESSIONID : impressID, -// AD_MEASURABILITY : @"0" -// }; -// NSMutableDictionary *accessDictionary = [NSMutableDictionary dictionary]; -// [dictionary enumerateKeysAndObjectsUsingBlock:^(NSString * key, id obj, BOOL * _Nonnull stop) { -// NSString *accessKey = keyvalueAccess[key]; -// if(accessKey && accessKey.length) { -// accessDictionary[accessKey] = obj; -// } -// }]; -// NSString *url = [self monitorHandleWithURL:result.url data:accessDictionary redirectURL:@""]; -// [self filterURL:url]; + + /** + * 获取广告位ID,如果没有扔回MMA + */ + NSString *adID = [self getAdIDForURL:url]; + if(!adID || !adID.length) { + [self filterURL:url]; + [MMA_Log log:@"adplacement get failed: %@" ,@"no adplacement"]; + return; + } + + NSString *domain = company.domain[0]; + if(!domain || !domain.length) { + domain = @""; + } + /** + * 拼接impressionID + */ + NSString *impressKey = [NSString stringWithFormat:@"%@-%@",domain,adID]; + + //iOS:MD5(idfa+idfv+广告位ID+时间戳(ms)) + NSString * timestamp = [NSString stringWithFormat:@"%.0f",[[NSDate date] timeIntervalSince1970] * 1000]; + NSString * compString = [NSString stringWithFormat:@"%@%@%@%@",[self.trackingInfoService idfa],[self.trackingInfoService idfv],adID,timestamp]; + NSString *impressID = [MMA_Helper md5HexDigest:compString]; + _impressionDictionary[impressKey] = impressID; + /** + * 发送正常的url 监测使用去噪impressionID曝光url,拼接AD_VB (2f),AD_VB_RESULT(vx) + */ + + // impressionType=0视为Tracked ads;impressionType=1视为曝光 + if (impressionType == 0) { + [self handleImpressionType:@"0" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; + } else if (impressionType == 1){ + if(!adView || ![adView isKindOfClass:[UIView class]]) { + // view=nil或者view非法的情况下,未达到CBR条件,如果是可见监测停止监测 + [self handleImpressionType:@"0" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; + return; + } else { + // 达到CBR条件,如果是可见监测继续监测 + [self handleImpressionType:@"1" URL:result.url impression:impressID redirectURL:result.redirectURL additionKey:useViewabilityService]; + } + } + + /** + * Viewability功能模块 + */ + if(useViewabilityService) { + + NSMutableDictionary *keyvalueAccess = [NSMutableDictionary dictionary]; + [VIEW_ABILITY_KEY enumerateObjectsUsingBlock:^(NSString *obj, NSUInteger idx, BOOL * _Nonnull stop) { + MMA_Argument *argument = company.config.viewabilityarguments[obj]; + if(argument.key&& argument.key.length && argument.value && argument.value.length) { + keyvalueAccess[obj] = argument.value; + } + }]; + + // 如果view非法或为空 不可测量参数置为0 + if(!adView || ![adView isKindOfClass:[UIView class]]) { + return; + // NSDictionary *dictionary = @{ + // AD_VB_EVENTS : @"[]", + // AD_VB : @"0", + // AD_VB_RESULT : @"2", + // IMPRESSIONID : impressID, + // AD_MEASURABILITY : @"0" + // }; + // NSMutableDictionary *accessDictionary = [NSMutableDictionary dictionary]; + // [dictionary enumerateKeysAndObjectsUsingBlock:^(NSString * key, id obj, BOOL * _Nonnull stop) { + // NSString *accessKey = keyvalueAccess[key]; + // if(accessKey && accessKey.length) { + // accessDictionary[accessKey] = obj; + // } + // }]; + // NSString *url = [self monitorHandleWithURL:result.url data:accessDictionary redirectURL:@""]; + // [self filterURL:url]; + } + VAMonitor *monitor = [VAMonitor monitorWithView:adView isVideo:isVideo url:result.url redirectURL:@"" impressionID:impressID adID:adID keyValueAccess:[keyvalueAccess copy] config:result.config domain:domain]; + monitor.delegate = self; + [_viewabilityService addVAMonitor:monitor]; + + + } + + + + } @catch (NSException *exception) { + [MMA_Log log:@"##view:ad: exception:%@" ,exception]; + } - VAMonitor *monitor = [VAMonitor monitorWithView:adView isVideo:isVideo url:result.url redirectURL:@"" impressionID:impressID adID:adID keyValueAccess:[keyvalueAccess copy] config:result.config domain:domain]; - monitor.delegate = self; - [_viewabilityService addVAMonitor:monitor]; - - - } - - - - } @catch (NSException *exception) { - [MMA_Log log:@"##view:ad: exception:%@" ,exception]; - - } +// }]; +// } - (void)handleImpressionType:(NSString *)impressionType URL:(NSString *)url impression:(NSString *)impressionID redirectURL:(NSString *)redirectURL additionKey:(BOOL)additionKey { @@ -893,8 +915,9 @@ [MMA_Log log:@"%@" ,@"company is nil,please check your 'sdkconfig.xml' file"]; return; } - - [self pushTask:url]; + [self pushTask:url]; + + } - (MMA_Company *)confirmCompany:(NSString *)url @@ -957,7 +980,7 @@ } } /********************************************/ - + /*确保过滤掉xml文件里需要重新拼接的字段*/ NSArray *arr = [trackURL componentsSeparatedByString:company.separator]; @@ -1074,11 +1097,16 @@ } } + + // 添加签名加密模块 NSString *signString = [MMASign sign:trackURL ts:ts sdkv:MMA_SDK_VERSION]; [MMA_Log log:@"signString: %@" ,signString]; [trackURL appendFormat:@"%@%@%@%@", company.separator, company.signature.paramKey, company.equalizer, signString]; + + + if (redirecturl !=nil&&![redirecturl isEqualToString:@""]) { [trackURL appendString:redirecturl]; } diff --git a/MobileTracking/MobileTracking/Service/MMA_LocationService.m b/MobileTracking/MobileTracking/Service/MMA_LocationService.m index dfcf5bdaaba61a2ea2d9f04e8e682aa3c0778791..8b16bde36b58daa2b66777aa84b835f0b2857c1e 100644 --- a/MobileTracking/MobileTracking/Service/MMA_LocationService.m +++ b/MobileTracking/MobileTracking/Service/MMA_LocationService.m @@ -37,16 +37,22 @@ } - (CLLocationManager *)locationManager { + dispatch_async(dispatch_get_main_queue(), ^{ if (!_locationManager) { _locationManager = [[CLLocationManager alloc] init]; // 不主动弹出弹窗,需要在允许的时候获取 // if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { // [_locationManager requestWhenInUseAuthorization]; // } - [_locationManager setDelegate:self]; - [_locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; - [_locationManager setDistanceFilter:kCLDistanceFilterNone]; + + [_locationManager setDelegate:self]; + [_locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; + [_locationManager setDistanceFilter:kCLDistanceFilterNone]; + + + } + }); return _locationManager; } - (void)start { diff --git a/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.m b/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.m index ca9946aca164257f9511c95daca2506ea0aefee2..e941ee2d1ec81732779c946b487f68c863ceccc4 100755 --- a/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.m +++ b/MobileTracking/MobileTracking/Service/MMA_TrackingInfoService.m @@ -14,7 +14,10 @@ #import "MMA_Reachability.h" #import "MMA_Macro.h" #import -static NSString *openUDID = nil; + + +#define MMA_LocalCacheOpenUDIDPersistKey @"kMMA_LocalCacheOpenUDIDPersistKey" + @implementation MMA_TrackingInfoService + (MMA_TrackingInfoService *)sharedInstance { @@ -22,9 +25,15 @@ static NSString *openUDID = nil; 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; } + - (NSString *)macAddress { @@ -68,24 +77,41 @@ static NSString *openUDID = nil; { return [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey]; } - -- (NSString *)openUDID -{ - if (openUDID) { - - return openUDID; - }else{ - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - openUDID = [MMA_OpenUDID value]; - }); - +- (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 { + } - - - return openUDID ? openUDID : @""; + } +- (NSString *)persistOpenUDID { + + + NSString *openUDID = [MMA_OpenUDID value]; + [[NSUserDefaults standardUserDefaults] setObject:openUDID forKey:MMA_LocalCacheOpenUDIDPersistKey]; + [[NSUserDefaults standardUserDefaults] synchronize]; + + return openUDID; +} + + - (NSString *)location { CLLocation *currentLocation = [[MMA_LocationService sharedInstance] getCurrentLocation]; diff --git a/MobileTracking/MobileTracking/TaskQueue/MMA_TaskQueue.m b/MobileTracking/MobileTracking/TaskQueue/MMA_TaskQueue.m index ace3c4fcf6a8480c0eb963778844e4bc88f673ec..e65f381d4bed633fb1d170ee138b9e6cd308d647 100755 --- a/MobileTracking/MobileTracking/TaskQueue/MMA_TaskQueue.m +++ b/MobileTracking/MobileTracking/TaskQueue/MMA_TaskQueue.m @@ -28,9 +28,13 @@ - (void)push:(MMA_Task *)task { - if ([self.queue indexOfObject:task] == NSNotFound) { - [self.queue addObject:task]; + @synchronized(self.queue) { + if ([self.queue indexOfObject:task] == NSNotFound) { + [self.queue addObject:task]; + } + } + } - (MMA_Task *)pop diff --git a/MobileTracking/Viewability/MMA_AdCalSize.m b/MobileTracking/Viewability/MMA_AdCalSize.m index ab48b5b06f67ad16eab0ef121ba9d32aa97e48c8..bfd928f0766e5e837886d95836b3aca33945e48d 100644 --- a/MobileTracking/Viewability/MMA_AdCalSize.m +++ b/MobileTracking/Viewability/MMA_AdCalSize.m @@ -140,9 +140,9 @@ MMA_AdNode *adNode = [self.nodeList objectForKey:@(index)]; MMA_AdNode *leftNode = [self.nodeList objectForKey:@(index<<1)]; MMA_AdNode *rightNode = [self.nodeList objectForKey:@(index<<1|1)]; -// if (adNode == nil) { -// return; -// } + if (adNode == nil) { + return; + } // if (leftNode == nil) { // return; // } diff --git a/MobileTracking/Viewability/MMA_AdViewResult.m b/MobileTracking/Viewability/MMA_AdViewResult.m index 4965a8af4d7b80ae4e64d4abac09a5e4b314f075..2163a02130d3667696a970cabbb1bbfe9cf6b2a5 100644 --- a/MobileTracking/Viewability/MMA_AdViewResult.m +++ b/MobileTracking/Viewability/MMA_AdViewResult.m @@ -47,7 +47,9 @@ } // 使用CGFloat小数点,小数点14位可能出现偏差,所以修改为float - self.ad_showing = !self.isShowing || view.mma_sHeight != view.mma_height || view.mma_sWidth != view.mma_width; + self.ad_showing = !self.isShowing; + /**开启下面方法 视图跑到窗口外时会出现bug*/ +// self.ad_showing = !self.isShowing || view.mma_sHeight != view.mma_height || view.mma_sWidth != view.mma_width; self.showOnWindow = view.mma_showOnKeyWindow; self.originFrame = view.frame; @@ -58,7 +60,7 @@ #pragma mark - method - (void)enqueueView:(UIView *)view { - + // @try { if (!_adView) { @@ -71,7 +73,8 @@ [self.viewList addObject:view.mma_properties]; CGRect coverRect = [self.adView mma_intersectionWithView:view]; - if (!CGRectEqualToRect(coverRect, CGRectZero)) { + // NSLog(@"ViewSizeWidth:%f",coverRect.size.width); + if (!CGRectEqualToRect(coverRect, CGRectZero)&&coverRect.size.width>0) { if (![self.adView mma_isSuper:view]) { // 限制最大view数量阈值 if (self.viewCoverList.count < 60) { diff --git a/MobileTracking/Viewability/ViewabilityService.m b/MobileTracking/Viewability/ViewabilityService.m index f0d67ba1b418cb5c353ec4e39694235164be27e4..4f9c0eca529a713136a0a7b153c0905f91d793ce 100644 --- a/MobileTracking/Viewability/ViewabilityService.m +++ b/MobileTracking/Viewability/ViewabilityService.m @@ -184,16 +184,23 @@ static const char *view_capture_queue = "adview.capture.queue"; - (void)processCacheMonitorsWithDelegate:(id )delegate { dispatch_async(_captureQueue, ^{ if([[NSFileManager defaultManager] fileExistsAtPath:VA_MONITOR_SAVE_PATH isDirectory:nil]) { - NSDictionary *cacheMonitors = [NSKeyedUnarchiver unarchiveObjectWithData:[NSData dataWithContentsOfFile:VA_MONITOR_SAVE_PATH]]; - NSLog(@"读取%lu条缓存数据",(unsigned long)[[cacheMonitors allKeys] count]); - [cacheMonitors enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, VAMonitor * _Nonnull obj, BOOL * _Nonnull stop) { - obj.delegate = delegate; - // 如果已经上传过监测数据,则不再上传 - if(obj.status != VAMonitorStatusUploaded) { - [obj stopAndUpload]; - } - }]; - [[NSFileManager defaultManager] removeItemAtPath:VA_MONITOR_SAVE_PATH error:nil]; + @try { + NSDictionary *cacheMonitors = [NSKeyedUnarchiver unarchiveObjectWithData:[NSData dataWithContentsOfFile:VA_MONITOR_SAVE_PATH]]; + NSLog(@"读取%lu条缓存数据",(unsigned long)[[cacheMonitors allKeys] count]); + [cacheMonitors enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, VAMonitor * _Nonnull obj, BOOL * _Nonnull stop) { + obj.delegate = delegate; + // 如果已经上传过监测数据,则不再上传 + if(obj.status != VAMonitorStatusUploaded) { + [obj stopAndUpload]; + } + }]; + [[NSFileManager defaultManager] removeItemAtPath:VA_MONITOR_SAVE_PATH error:nil]; + } @catch (NSException *exception) { + + } @finally { + + } + } }); } diff --git a/OutputRelease/MobileTracking.h b/OutputRelease/MobileTracking.h index 1874c8757cb1f067feadb665120493df236bf80e..510de4883c55547c8f619c5e82f27bb3df5470f2 100644 --- 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.3" +//#define MMA_SDK_VERSION @"V2.1.4" #import diff --git a/OutputRelease/libMobileTracking.a b/OutputRelease/libMobileTracking.a index 148338a7b5c7c876405a6d7f451d0f7695e22315..df4061dcc1337717fdea3dfc3b04ab444b3ff5ff 100644 Binary files a/OutputRelease/libMobileTracking.a and b/OutputRelease/libMobileTracking.a differ diff --git a/OutputRelease/sdkconfig.xml b/OutputRelease/sdkconfig.xml index d46bf37c6d1eb27affbe55ef93b174bd26903780..4a540a2cc2214d17b7b71095a814a3e04cac6ed3 100644 --- a/OutputRelease/sdkconfig.xml +++ b/OutputRelease/sdkconfig.xml @@ -2,17 +2,17 @@ - + - + 0 60 60 - + @@ -28,23 +28,23 @@ 20 - + admaster - + - + admaster.com.cn - + @@ -52,7 +52,7 @@ 0b - + true @@ -60,7 +60,7 @@ 259200 0 - + @@ -72,18 +72,18 @@ md5 - + - - https://p.attri.mobi/a - - 24 - - true + + https://p.attri.mobi/a + + 24 + + true - + @@ -175,7 +175,7 @@ true true - + @@ -227,7 +227,7 @@ true - + @@ -243,8 +243,8 @@ true - - + + @@ -254,10 +254,10 @@ false - + - + ImpressionID @@ -265,7 +265,7 @@ true true - + @@ -352,7 +352,7 @@ true - + @@ -397,7 +397,7 @@ true - + - + - + , @@ -420,7 +420,7 @@ true - + miaozhen @@ -441,21 +441,21 @@ 604800 1 - + md5 raw md5 md5 - - + + - - /apl/ - - 24 - false + + /apl/ + + 24 + false @@ -511,7 +511,7 @@ true true - + OAID @@ -519,7 +519,7 @@ true true - + ADID @@ -771,7 +771,7 @@ true true - + AdviewabilityStrongInteract @@ -779,20 +779,144 @@ true true - + - - & - - - https://g.cn.miaozhen.com/x/k=adid - + + + + + isRoot + l1 + true + true + + + + Electricity + l2 + true + true + + + + isCharging + l3 + true + true + + + + isSimulator + l4 + true + true + + + + isHook + l5 + true + true + + + + isFlash + l6 + true + true + + + + Accelerometer + l7 + true + true + + + + Magnetometer + l8 + true + true + + + + Direction + l9 + true + true + + + + GyroActive + l10 + true + true + + + + Brightness + l11 + true + true + + + + Pressure + l12 + true + true + + + + Temperature + l13 + true + true + + + + Proximity + l14 + true + true + + + + DeviceMotion + l15 + true + true + + + + LineAccelerometer + l16 + true + true + + + + RotationVector + l17 + true + true + + + + & + + + https://g.cn.miaozhen.com/x/k=adid + + + svl = - + true - + girdsum @@ -800,7 +924,6 @@ gridsumdissector.com - @@ -814,10 +937,10 @@ 1 - raw - md5 + md5 + raw md5 - raw + md5 @@ -830,63 +953,79 @@ 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 + + + + + ADID + adid + true + true + + WIFI wifi true true - + AKEY ak true true - + ANAME an true true - + SCWH @@ -894,56 +1033,56 @@ true true - + OPENUDID oid true true - + ODIN odin true true - + TERM term true true - + OSVS osvs true true - + LBS lbs true true - + MUID mid true true - + MUDS muds true true - + REDIRECTURL u @@ -961,17 +1100,17 @@ start - m201 + event=start true end - m203 + event=end true - + @@ -981,7 +1120,7 @@ false - + @@ -989,6 +1128,20 @@ viid true true + + + + ImpressionType + vitype + true + true + + + + AdviewabilityRecord + varecord + true + true @@ -1047,6 +1200,13 @@ true true + + + AdviewabilityForground + vfg + true + true + AdviewabilityLight @@ -1054,69 +1214,68 @@ true true + AdviewabilityForground - vfg - true - true - - - - Adviewability - vab + vafg true true - + - AdMeasurability - vm + AdviewabilityResult + varesult true true - - - - + AdviewabilityConfigArea - vca + vaconfarea true true - + AdviewabilityConfigThreshold - vct + vaconfth true true - + AdviewabilityVideoDuration - vcvd + vavd true true - + AdviewabilityVideoProgress - vcvp + vavp true true - + AdviewabilityVideoPlayType - vcpt + vavpt true true - + AdviewabilityVideoProgressPoint - vcpp + vavpp + true + true + + + + + AdviewabilityStrongInteract + vasi true true @@ -1128,8 +1287,8 @@ true - - + + adbug @@ -1164,28 +1323,28 @@ true true - + TS t true true - + MAC n true true - + IDFA z true true - + IDFAMD5 0j @@ -1198,21 +1357,21 @@ true true - + WIFI w true true - + AKEY x true true - + ANAME y @@ -1226,7 +1385,7 @@ true true - + OPENUDID o @@ -1239,14 +1398,14 @@ true true - + OSVS q true true - + LBS l @@ -1287,9 +1446,9 @@ false false - + - + ImpressionID @@ -1297,7 +1456,7 @@ true true - + AdviewabilityEvents 2j @@ -1370,7 +1529,7 @@ true true - + @@ -1379,8 +1538,8 @@ true - - + + rtbasia @@ -1408,12 +1567,12 @@ raw @@ -1678,7 +1837,651 @@ true - - - + + nielsen + + + + + uat.cr-nielsen.com + + + + 4A5DBD140 + pk + + + true + + 604800 + + 1 + + md5 + raw + md5 + raw + + + + + + + + + OS + os + + true + + true + + + + TS + ts + true + true + + + + MAC + mac + true + true + + + + IDFA + idfa + true + true + + + + IMEI + imei + true + true + + + + ANDROIDID + androidid + true + true + + + + WIFI + wifi + true + true + + + + AKEY + akey + true + true + + + + ANAME + aname + true + true + + + + + SCWH + scwh + true + true + + + + OPENUDID + openudid + true + true + + + + ODIN + odin + true + true + + + + TERM + term + true + true + + + + OSVS + osvs + true + true + + + + LBS + lbs + true + true + + + + MUID + muid + true + true + + + + MUDS + muds + true + true + + + + REDIRECTURL + ref + true + true + + + SDKVS + sdkvs + true + true + + + + + + start + start + true + + + + end + end + true + + + + + + + Adplacement + hat_pid + false + false + + + + + + + ImpressionID + imp_id + true + true + + + ImpressionType + vit + true + true + + + + + AdviewabilityEvents + vbe + true + true + + + + AdviewabilityTime + vts + true + true + + + + AdviewabilityFrame + vbf + true + true + + + + AdviewabilityPoint + vbp + true + true + + + + AdviewabilityAlpha + vba + true + true + + + + AdviewabilityShown + vbs + true + true + + + + AdviewabilityCoverRate + vbc + true + true + + + + AdviewabilityShowFrame + vsf + true + true + + + + AdviewabilityLight + vbl + true + true + + + + AdviewabilityForground + vfg + true + true + + + + Adviewability + vvb + true + true + + + + AdMeasurability + vmb + 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 + + + + & + + = + + true + + + + TalkingData + + + + + + + .lnk0.com + + + DbXiUlEVN + s + + + false + + 604800 + + 1 + + md5 + raw + md5 + raw + + + + + + + + OS + osversion + true + true + + + TS + time + true + true + + + MAC + mac_md5 + true + true + + + IDFA + idfa + true + true + + + IMEI + imei_md5 + true + true + + + RAWIMEI + m3 + true + false + + + ANDROIDID + androidid + true + true + + + WIFI + nm + true + false + + + AKEY + pname + true + true + + + ANAME + aname + true + false + + + + SCWH + scwh + true + false + + + + WIFISSID + ssid + true + false + + + + WIFIBSSID + bssid + true + false + + + OPENUDID + openudid + true + false + + + TERM + devicetype + true + false + + + OSVS + osvs + true + false + + + LBS + mm + true + false + + + SDKVS + sdkvs + true + false + + + REDIRECTURL + o + true + false + + + + + + start + mb=start + false + + + + end + mb=end + false + + + + + Adplacement + adid + false + false + + + + + ImpressionID + vimpid + true + false + + + AdviewabilityRecord + va + true + false + + + AdviewabilityEvents + vct + true + false + + + AdviewabilityTime + 1 + true + false + + + AdviewabilityFrame + 2 + true + false + + + AdviewabilityPoint + 3 + true + false + + + AdviewabilityAlpha + 4 + true + false + + + AdviewabilityShown + 5 + true + false + + + AdviewabilityCoverRate + 6 + true + false + + + AdviewabilityShowFrame + 7 + true + false + + + AdviewabilityForground + 8 + true + false + + + AdviewabilityResult + vx + true + false + + + Adviewability + isview + true + false + + + AdMeasurability + ism + true + false + + + AdviewabilityConfigArea + vcr + true + false + + + AdviewabilityConfigThreshold + vtime + true + false + + + AdviewabilityVideoDuration + vb + true + false + + + AdviewabilityVideoProgress + vc + true + false + + + AdviewabilityVideoPlayType + vpt + true + false + + + AdviewabilityVideoProgressPoint + vj + true + false + + + + & + + = + + true + + + + diff --git a/README.md b/README.md index e0613366948accf8ae65b36032ad28c0ecc0b604..ce46af45a38e4ce8d52196faa833f22d3ba25737 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,11 @@ CoreTelephony.framework SystemConfiguration.framework WebKit.framework + CoreMotion.framework + CoreMedia.framework + AVFoundation.framework ``` - +4. 需要在info.plist 新增NSMotionUsageDescription(Privacy - Motion Usage Description) 键值对,并进行说明。 ### 步骤2:使用方法 在使用的文件中引用 diff --git "a/\347\211\271\345\210\253\347\211\210/Bitcode/iphoneos/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/Bitcode/Release-iphoneos/libMobileTracking.a" similarity index 78% rename from "\347\211\271\345\210\253\347\211\210/Bitcode/iphoneos/libMobileTracking.a" rename to "\347\211\271\345\210\253\347\211\210/Bitcode/Release-iphoneos/libMobileTracking.a" index bcbfb23fe7ce03f49fa174ca64a1f500003138cc..4ed93ca3a15ef221abb10506e4b54213074025bc 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/Bitcode/iphoneos/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/Bitcode/Release-iphoneos/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/Bitcode/iphonesimulator/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/Bitcode/Release-iphonesimulator/libMobileTracking.a" similarity index 78% rename from "\347\211\271\345\210\253\347\211\210/Bitcode/iphonesimulator/libMobileTracking.a" rename to "\347\211\271\345\210\253\347\211\210/Bitcode/Release-iphonesimulator/libMobileTracking.a" index c4f858f030fb792aaf7de60dd01645af38e0b876..715c8f96169634533ba4962ad3e3de0884957289 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/Bitcode/iphonesimulator/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/Bitcode/Release-iphonesimulator/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/Bitcode/universal/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/Bitcode/Release-universal/libMobileTracking.a" similarity index 80% rename from "\347\211\271\345\210\253\347\211\210/Bitcode/universal/libMobileTracking.a" rename to "\347\211\271\345\210\253\347\211\210/Bitcode/Release-universal/libMobileTracking.a" index 148338a7b5c7c876405a6d7f451d0f7695e22315..df4061dcc1337717fdea3dfc3b04ab444b3ff5ff 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/Bitcode/universal/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/Bitcode/Release-universal/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/noBitcode/iphoneos/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/noBitcode/Release-iphoneos/libMobileTracking.a" similarity index 64% rename from "\347\211\271\345\210\253\347\211\210/noBitcode/iphoneos/libMobileTracking.a" rename to "\347\211\271\345\210\253\347\211\210/noBitcode/Release-iphoneos/libMobileTracking.a" index cc4e26bfade76653bf4cf419c4c00fa10c5e3c68..ca90050ef1d2d0437d7a1ff1759fb06175a76e8c 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/noBitcode/iphoneos/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/noBitcode/Release-iphoneos/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/noBitcode/iphonesimulator/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/noBitcode/Release-iphonesimulator/libMobileTracking.a" similarity index 62% rename from "\347\211\271\345\210\253\347\211\210/noBitcode/iphonesimulator/libMobileTracking.a" rename to "\347\211\271\345\210\253\347\211\210/noBitcode/Release-iphonesimulator/libMobileTracking.a" index d3bae2ea57971c0bcd6fc1f6b8d010ca5d90bca2..d7b7c9521de5a864e1db0bcaa634fbb547b14fce 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/noBitcode/iphonesimulator/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/noBitcode/Release-iphonesimulator/libMobileTracking.a" differ diff --git "a/\347\211\271\345\210\253\347\211\210/noBitcode/universal/libMobileTracking.a" "b/\347\211\271\345\210\253\347\211\210/noBitcode/Release-universal/libMobileTracking.a" similarity index 68% rename from "\347\211\271\345\210\253\347\211\210/noBitcode/universal/libMobileTracking.a" rename to "\347\211\271\345\210\253\347\211\210/noBitcode/Release-universal/libMobileTracking.a" index 0b838ca20a7bbe91aa2a6f312a5e1c1254473a9e..b9073398601180a6925caed1e0e454c62ed3cf1f 100644 Binary files "a/\347\211\271\345\210\253\347\211\210/noBitcode/universal/libMobileTracking.a" and "b/\347\211\271\345\210\253\347\211\210/noBitcode/Release-universal/libMobileTracking.a" differ