ios - Finding Google DFP SDK device ID for testDevices and test ads -


i'm trying debug , develop app google's dfp sdk using google's test ad units. doing requires device's identifier (as google defines it) added request.testdevices[] property of dfprequest object.

recent versions of dfp sdk added log message display current device's id, , added support kgadsimulatorid running in sim. allows developer run app, copy device id console, modify code add testdevices[] array. however, no documentation or facility exists detecting id @ run-time , consistently register current device receive test ads.

how can equivalent of google's -[gaddevice deviceidentifier] call (this isn't public method), id can add testdevices[] array , make app call test ads on device?

google's sdk uses prescribed [asidentifiermanager sharedmanager].advertisingidentifier property basis identifier. creates md5 hash advertising identifier. following code allows app call test ads on device running on, if isusingtestads flag set:

dfprequest *request = [dfprequest request]; ... if (isusingtestads) {     nsstring *currentdeviceid = [self md5withstring:[[asidentifiermanager sharedmanager].advertisingidentifier uuidstring]];     request.testdevices = @[ kgadsimulatorid,                       // ios simulator                              currentdeviceid                             ]; ... 

the md5withstring function generic, available anywhere.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -