fbsamples / audience-network

Open source projects to demonstrate SDK and sample code usages and integration, and to collaborate and support peers in this community.
https://developers.facebook.com/docs/audience-network
Other
318 stars 370 forks source link

Better way to get test device IDs #89

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello Sirs,

My clients and I are half this planet far away. When I sent them instructions to get test device IDs, this was exactly what they told me: Sorry Mr. , I think I'm stupid to go through your guide... Could we have better solution?

Could you have better way to get test device IDs?

Oh my god, it's test device IDs, it's not USA national books, it's not Mr. Trump's atomic button, it's not Mr. Trump secret affair, it's not rocket science. It's test device IDs.

Thank you all, Sir Talented Developers at Facebook,

ghost commented 5 years ago

Well,

Open SharedPreferences with "FBAdPrefs" name and read a string from "deviceIdHash" key. The value might not exist because the sdk generates it on the fly only when necessary. The value is generated by java.util.UUID.randomUUID and then toString to convert the UUID to string.

I have no time to decompress the rest of your smart ass code.

Well, next time your smart ass developers should try some encryption. But this time I'm happy enough.

Again, OMG, it's just a test ID. OMFG!!!.

phzhou commented 5 years ago

Hi @ghost do you still have problem of getting the device id? Please refer to the updated testing document for the process of testing with the test device ids, they are Google Advertising ID and IDFA for Apple devices. There are official APIs from these platforms to retrieve the ids by code. Thanks!

https://developers.facebook.com/docs/audience-network/testing#test-device