B4A Library FirebaseNotifications - Push messages / Firebase Cloud Messaging (FCM)

Status
Not open for further replies.

dar2o3

Active Member
Licensed User
I can get a list of topics to which I subscribe?
I have an application in which customers subscribe to receive information by provinces, you can subscribe or unsubscribe as they want, I would check when there are no clients subscribed to a particular topic this topic no longer exists.

Is there a limit when creating new topics?
 

Noorul HAQUE

Member
Licensed User
Hi All

I am trying to develop Android App with Firebase Push messaging, I have done following I am using B4A6

1) Created account and App in Firebase
2) downloaded google json file , copied to App folder
3) Edited Manifest file added Google Play Services Base, Firebase Base, Firebase Notification
4) in #Region Project Attributes I added #AdditionalJar: com.google.android.gms : play-services
5) now when I am making Private fm As FirebaseMessaging it showing : unknow type , are you missing a library reference ?

Please advice me if any thing I am missing ...
 

KMatle

Expert
Licensed User

AscySoft

Active Member
Licensed User
how come
B4X:
Message.SentTime
is pointing always to 1970? How to retrive actual date/time from this object?
 

Erel

Administrator
Staff member
Licensed User
I see it too. Message.SentTime returns 0. It looks like a bug in FCM.
 

Erel

Administrator
Staff member
Licensed User
Only strings. However you can use B4XSerializator to serialize an object as an array of bytes and then use StringUtils.EncodeBase64 to encode it as a string.
 

jayel

Active Member
Licensed User
I get this on compiling :
B4A version: 6.00
Parsing code. (0.00s)
Compiling code. Error
Error parsing google-services.json:
Error parsing json file. Make sure that the package name is correct.
Package name is "#ApplicationLabel: testpush"
And project name in firebase is also testpush

Probably a stupid question, but do you have any pointers what the solution is please?
 

jayel

Active Member
Licensed User
android side is compiling but the FCMPush on B4J give this on compiling :
Waiting for debugger to connect...
Program started.
java.lang.NoClassDefFoundError: android/app/Service
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2499)
at java.lang.Class.privateGetPublicFields(Class.java:2530)
at java.lang.Class.getFields(Class.java:1420)
at anywheresoftware.b4a.shell.Shell$FieldCache.getField(Shell.java:813)
at anywheresoftware.b4a.shell.Shell.setStateBeforeUserSub(Shell.java:385)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:288)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.main(main.java:29)
Caused by: java.lang.ClassNotFoundException: android.app.Service
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 28 more
java.lang.RuntimeException: java.lang.NoClassDefFoundError: android/app/Service
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.main(main.java:29)
Caused by: java.lang.NoClassDefFoundError: android/app/Service
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Program terminated (StartMessageLoop was not called).
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2499)
at java.lang.Class.privateGetPublicFields(Class.java:2530)
at java.lang.Class.getFields(Class.java:1420)
at anywheresoftware.b4a.shell.Shell$FieldCache.getField(Shell.java:813)
at anywheresoftware.b4a.shell.Shell.setStateBeforeUserSub(Shell.java:385)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:288)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
... 3 more
Caused by: java.lang.ClassNotFoundException: android.app.Service
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 28 more

 
Status
Not open for further replies.
Top