Hi,
During compiling I got an error:
This is the code I use:
Using this code within the Starter Service there is no error.
Someone can help? Need more info: please let me know.
Kind regards,
André
During compiling I got an error:
B4X:
Compileren gegenereerde Java code. Error
B4A line: 19
End Sub
javac 1.8.0_371
src\ciris\chauffeur\firebasemessaging.java:344: error: incompatible types: firebasemessaging cannot be converted to Context
String id = AdvertisingIdClient.getAdvertisingIdInfo(mostCurrent).getId();
^
This is the code I use:
B4X:
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
Using this code within the Starter Service there is no error.
Someone can help? Need more info: please let me know.
Kind regards,
André