Hi
When I use web socket server (B4J) to send a message with FCM I get bellow error :
I attached my source code , how can I solve this error ?
When I use web socket server (B4J) to send a message with FCM I get bellow error :
B4X:
{"data": {"receivertoken": "receivertoken-here","pmsenderid": "SenderId HERE","body": "hi my friend !"},
"to": "AcQQ4p4WI1g:APA91bGhKhiydgATbIkNgzu5F6WGF5pm_HxLM9lNSA7bHM0dg89sCbpgpEQc3srf4J92oZkyKd3DId5HqroBmWMWkGCVMHYvxOY1nYrcV6GnTJ--x2T61igugVdDwgCM-D-OJPzZThze"
}
java.lang.RuntimeException: java.lang.IllegalStateException: Toolkit not initialized
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:195)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:273)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:268)
at javafx.application.Platform.runLater(Platform.java:83)
at anywheresoftware.b4j.objects.FxBA.postRunnable(FxBA.java:17)
at anywheresoftware.b4a.keywords.Common.CallSubDelayed4(Common.java:500)
at anywheresoftware.b4a.keywords.Common.CallSubDelayed2(Common.java:484)
at b4j.example.httpjob._postbytes(httpjob.java:215)
at b4j.example.httpjob._poststring(httpjob.java:261)
at b4j.example.b4a._v6(b4a.java:123)
at b4j.example.b4a._pm_message(b4a.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
... 10 more
I attached my source code , how can I solve this error ?