B4A Library GoogleAdvertisingIdClient

Hi group.

This small lib gives the info fields for the AdvertisingIdClient in the device.

The java code is quite small. :)

Code: Copy
public class AdvertiserId {

    public void Initialize(final BA ba, final String EventName) {
       BA.runAsync(ba, this, EventName + "_ready", new Object[] {"",false}, new Callable<Object[]>() {
            @Override
            public Object[] call() throws IOException,IllegalStateException,GooglePlayServicesNotAvailableException,GooglePlayServicesRepairableException   {
                AdvertisingIdClient.Info adInfo = AdvertisingIdClient.getAdvertisingIdInfo(ba.context);
                return new Object[] {adInfo.getId(), adInfo.isLimitAdTrackingEnabled() };
            }
        });
    }

}

it requires the same project setup as the admob lib.
 

Attachments

Back
Top