Sub GetAdvertisingId As ResumableSub
Dim jo As JavaObject = Me
jo.RunMethod("GetAdvertisingId", Null)
Wait For AdvertisingId_Ready (Success As Boolean, Id As String)
If (Id=Null Or Id="" Or Id="000000000000000000000") Then Id=EigenFuncties.RandomString(21)
Return Id
End Sub
#if Java
import java.util.concurrent.Callable;
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;
public static void GetAdvertisingId() {
BA.runAsync(processBA, mostCurrent, "advertisingid_ready", new Object[] {false, ""}
, new Callable<Object[]>() {
@Override
public Object[] call() throws Exception {
String id = AdvertisingIdClient.getAdvertisingIdInfo(mostCurrent).getId();
return new Object[] {true, id};
}
}); }
#End If