Show test ads on real device

最后都变了- 提交于 2019-12-22 06:59:58

问题


This is my code:

let request = GADRequest()
request.testDevices = [kGADSimulatorID, "XXXX2F32d69CCA859FFB559D0FEA3CF6483D08A6"]
adView.load(request)

Where XXXX is my UDID of my iPhone. Why do I get real ads and not test ads on my iPhone? Test ads on the simulator works. Thank you. Tried the UDID in uppercase and lowercase.


回答1:


This fixed it for me!

Product -> Scheme -> Arguments -> Environment Variables if there is a key: OS_ACTIVITY_MODE, disable/remove it.




回答2:


As mentioned in admob guide

while running the app in device you get the below log

<Google> To get test ads on this device, call: request.testDevices = @[
@"2077ef9a63d2b398840261c8221a0c9b" ];

use that id instead of UDID.




回答3:


As I understood your, I concate your UDID and ID in the log. This is wrong.

You this - pure ID :

let request = GADRequest()
        request.testDevices = [kGADSimulatorID, "2F32d69CCA859FFB559D0FEA3CF6483D08A6"]
        adView.load(request)

https://firebase.google.com/docs/admob/ios/targeting



来源:https://stackoverflow.com/questions/43156883/show-test-ads-on-real-device

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!