1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| if (uni.getSystemInfoSync().platform == 'ios') { var NSUUID = plus.ios.importClass('NSUUID'); var UIDevice = plus.ios.importClass("UIDevice"); var currentDevice = UIDevice.currentDevice() var identifierForVendor = currentDevice.identifierForVendor().UUIDString(); var ASIdentifierManager = plus.ios.importClass("ASIdentifierManager"); var sharedManager = ASIdentifierManager.sharedManager(); if (sharedManager.isAdvertisingTrackingEnabled()) { var advertisingIdentifier = sharedManager.advertisingIdentifier(); var idfa2 = plus.ios.invoke(advertisingIdentifier, "UUIDString"); } }
|