parse-server-modules / parse-server-onesignal-push-adapter

OneSignal push adapter for parse-server
MIT License
32 stars 28 forks source link

Does this support iOS 10 push notifications #35

Open otymartin opened 7 years ago

otymartin commented 7 years ago

@flovilmart For instance, I noticed I cant specify "Title", "subtitle", "body" in my push data. I can only pass in an "alert" message.

jjdp commented 7 years ago

https://github.com/parse-server-modules/parse-server-onesignal-push-adapter/blob/b1d053952d20f9266e94ac56d0109ca22b8bb867/src/OneSignalPushAdapter.js#L58

you need to edit the adapter for your own params if you want access to more options by onesignal's api

otymartin commented 7 years ago

@jjdp ahh man. can you give me an example, i really dont know javascript at all :(

jjdp commented 7 years ago

Something like this

if(data['subtitle']) {
    post['subtitle'] = data['subtitle'];
    delete data['subtitle'];
}

just pass your property in data for

Parse.Push.send({
    where: query,
    data: data,
}, { useMasterKey: true });
otymartin commented 7 years ago

@jjdp thank much appreciated :)

otymartin commented 7 years ago

@jjdp

Maybe im inputting the wrong param but i tried borrwoing your syntax because I want bold titles in my notifications however it doesnt work. any idea?


if(data['title']) {
    post['title'] = data['title'];
    delete data['title'];
}```
jjdp commented 7 years ago

read one signal's params in the link

fasa23 commented 5 years ago

I think your OneSignalPushAdapter.js should have something like this:

   if (data['title']) {
    post['headings'] = { en: data['title'] };
    delete data['title'];
   }

I tried it but I had no luck, I contacted One Signal support and they told me "this module is very outdated and we don't officially support it."

Any ideas?

otymartin commented 5 years ago

@fasa23 I use it from the client instead, no server side integration needed. I thought push notifications had to go through my own servers but not the case with oneSignal which is great.