I use the code below:
let request : GADRequest = GADRequest ()
request.testDevices = ["xxxxxxx",kGADSimulatorID]
But I am getting the below warning:
'testDevices' is deprecated: Use GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers.
Do I use a syntax to remove the warning?
This is a modification to 10623169's answer.
To get a valid ID, for the current device, that can be set in "testDevices", get the MD5 of this: UIDevice.current.identifierForVendor?.uuidString
The asIdentifier
value can be completely invalid if the user hasn't given permission for tracking. But the UIDevice.current.identifierForVendor
is a valid UUID for the app, that will persist across launches (but perhaps not if you delete the app and reinstall).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With