Push notifications

478 views
Skip to first unread message

Влад Киселев

unread,
Mar 1, 2016, 12:45:04 AM3/1/16
to DroidScript
by steve, need help)) Please tell me how you can create push notifications? that the application has been closed, but the notice came?

nikhil baby

unread,
Mar 1, 2016, 3:04:57 AM3/1/16
to DroidScript
set alarms for it

Влад Киселев

unread,
Mar 1, 2016, 3:31:19 AM3/1/16
to DroidScript
through setAlarm application opens in the I need to keep it open, only to notice there was

Dave Smart

unread,
Mar 1, 2016, 3:32:27 AM3/1/16
to DroidScript
For push notifications you will probably be best off using an online service like 'Firebase' and keep a DroidScript service running in the background to listen for it.

Влад Киселев

unread,
Mar 1, 2016, 6:25:40 AM3/1/16
to DroidScript
I unfortunately do not quite understand how to work with firebase ((may still have some way to the launch my app in the background

Gerard Hernandez

unread,
Mar 3, 2016, 5:40:25 PM3/3/16
to DroidScript
To work with push notification youll need a way to implement GCM inside DS either raw or using some provider nativeSDK like Parse or Backendless among others, by creating a brad new plugin for that (and share with the rest of us ;) ) , It will be quite difficult.

On the other hand, as Dave said, you can connect to the service itself and request the update.

I have tried firebase before, Its quite powerful, but the JS api theyprovide its , hmm, awful, AT LEAST FOR ME, so what I usually do is to work with the REST API. Nevertheless polling for updates is not a good idea if you have a real-time requirement..

You may want to try Server Sent Events, droidscript under the hood have a webview that is capable of those. In other words, it lets you create a listener for server events, depending on the api you may need authentication/authorization in a token or something. Particle and Twitter have them..


depending on your  need you may need to make request as well, I was able also to use Fetch in DS by adding the Fetch file. Its a big feature and you can configure it pretty easily.

Some info about how to use it.

Where to get it ( there are many versions) but I liked this

Hope that helps

Rodrigo Faustino

unread,
May 24, 2016, 4:59:24 PM5/24/16
to DroidScript
because so long that nobody put anything in this forum?
I'm studying the onesignal

can be very useful, but do not know how to make even the droidscript understand it, this api is very simple managed to make the android studio but droidscript not help please

Dave Smart

unread,
May 25, 2016, 3:42:24 AM5/25/16
to DroidScript
Hi Guys,

I think for true Push messaging in DS (without using a background service) we (droidscript.org) will have to add Google Play Services and various manifests entries for this to work.  

We are willing to do this but we need to agree on the best 3rd party solution to achieve this.  I don't want to do it directly with Google's API's because it is far too complicated (same with Firebase push messaging), so we need to use a 3rd party service that does not require us or you guys to setup back-end servers to handle messaging.

So I had a quick look at 'OneSignal' and it does not look to bad, does anyone else have an opinion?

Gerard Hernandez

unread,
May 25, 2016, 11:43:45 AM5/25/16
to DroidScript
Backendless is a very nice solution to backend storage, is the recommended alternative to the now defunct Facebook Parse. the problem is that most of the providers rely in GCM under the hood.

Onesignal appears to not rely on them, wich is good, at the end ServerSideEvents (Server to Client one way async messaging) and WebSockets(Server to Client two way async communication) are better options, but hose require a back end server, wich makes them less attractive.

OneSignal poses as an alternative to Parse, but im not sure how long they will be in the business, I guess its worth to try, but we all need to be aware that is a 3rd party unrelated to DS and if it fails or its shutdown, pretty much nothing can be done other than changing to a compatible NON-GCM provider.

Gerard Hernandez

unread,
May 25, 2016, 11:56:33 AM5/25/16
to DroidScript
I just took a real quick view at OneSignal REST api, and it appears to do polling on notifications, it doesnt use WS or SSE ( Particle api uses SSE)

OneSignal Android API on the other side do require GCM,

The problem with the GCM is the key, even when our apps could use a new build option to put very own key in the manifest  when developing we will be using the default one.

That will be total mess because for the current amount of users trying this out, we will run out of the quota.

with too many free hosting options, I would consider using SSE.
Take a look here.


The only concern to me is security, a homebrew server will be very vulnerable with out proper security measurements.

M8

unread,
Dec 11, 2016, 4:42:20 PM12/11/16
to DroidScript
Reply all
Reply to author
Forward
Message has been deleted
0 new messages