iOS Question Test iAdmob in Simulator

quimacama

Member
Licensed User
Longtime User
When I run in iOs Simulator my app with iAdmob in the log says:

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

How to implement this?
I write: AdView1.SetTestDevices(Array("@[ kGADSimulatorID ]")) , but it appears normal ad.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The above code will work.

Note that you can get it with this code:
B4X:
#if objc
#import <GoogleMobileAds/GoogleMobileAds.h>
- (NSObject*)simulatorId {
   return kGADSimulatorID;
}
#end if

Dim no As NativeObject = Me
ad.SetTestDevices(Array(no.RunMethod("simulatorId", Null)))

The value of kGADSimulatorID is Simulator so you can just enter the string directly.
 
Upvote 0
Top