Android Question FCM v1 - Unsubscribe from all topics

Puiu

New Member
Hi all!
In the old version of FCM, there was the possibility to unsubscribe from all the topics in which you were enrolled. With the new version, it seems (or I'm wrong) that you have to unsubscribe to each individual topic. How do I treat the following situation: an application is installed on a work phone. Each employee has their own username and password with which they log in on the same phone. Based on the userId, everyone connects to their own "topic". Until now it was simple: before connecting to a specific topic, I unsubscribed from all topics, then I connected to the desired topic. Now how can this be done? I don't know to which topic the user who used the application before me was connected...
Thanks for the ideas!
 

Puiu

New Member
I tried the following code before posting here:
Try
jo = jo.InitializeStatic("com.google.firebase.iid.FirebaseInstallations").RunMethod("getInstance", Null)
jo.RunMethod("deleteInstanceId", Null)
Catch
Log("ERROR:" & LastException)
End Try

but I get the error message:
Error occurred on line: 202 (Main)
java.lang.ClassNotFoundException: com.google$firebase$iid$FirebaseInstallations
at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:289)
at anywheresoftware.b4j.object.JavaObject.InitializeStatic(JavaObject.java:75)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:150)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8919)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

and

ERRORException) java.lang.Exception: java.lang.ClassNotFoundException: com.google$firebase$iid$FirebaseInstallations
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…