Hi guys,please tell me the ways which I can use to notify the mobile app(android),that data on server was changed?
Hi Katya,I have read that
But there is some points
At first how can I send push notification from java code?
You can use Backendless Android SDK (it was built in CodeRunner SDK).
Please follow the next documentation.
Also you can get information from Backendless Blog: https://backendless.com/what-is-backend-as-a-service/backendless-push-notifications/
Regards,
Kate.
Hi Katya,I am trying to implement as you (and documentation) suggest.
But I am little but confused,first of all what appId and key I must to put in my java code.
I tried with android secret key,but I am getting this error (from CodeRunner)
SEVERE: Version is disabled or provided wrong application info (application id o
r secret key)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.backendless.coderunner.runtime.task.EventInvocationTask.runImpl(E
ventInvocationTask.java:97)
at com.backendless.coderunner.runtime.concurrent.ExtendedRunnable.run(Ex
tendedRunnable.java:22)
at java.lang.Thread.run(Unknown Source)
Caused by: BackendlessException{ code: '2002', message: 'Version is disabled or
provided wrong application info (application id or secret key)' }
at com.backendless.Invoker$SyncResponder.errorHandler(Invoker.java:127)
........
Also I am sending you my code,it was taken from docs.Thanks
If you run invocation from CodeRunner (inside business logic) you should use Code Runner Secret Key (Manage -> App Settings -> Secret Keys -> Code Runner Secret Key).
And please look at Bootstrap.java file: init application method was already added in this file with correct parameters.
Just for clarification,you want to say that there is no need to init app in handler?And app has already initialized?
Also one question too :))
Do I need to set up Android Push Notification google key,if I am going to send push notifications only from server?
Hi Vardan,
the init app call is already done for you in Bootstrap.java - it is a file added to your project by code generator.
As for setting up the push notification google key, yes, it is still necessary.
Regards,
Mark