Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I send notification from user to user on onesignal?

I use OneSignal to send notification from server and users to users.

In my app,users can send notification to eachother.

it is possible with send tag? if so how can i do that?

I do not want to use user ids. (How can find each user ids from another user?)

I want to do that like parse.com. One user setchannel and other user send notification to that channel.

Thanks in advance

like image 348
Ersin Gülbahar Avatar asked May 15 '16 20:05

Ersin Gülbahar


People also ask

How do I add someone to my OneSignal account?

Find your device for Mobile App Using the OneSignal SDK User Data Methods, plugin your device to Xcode or Android Studio and log the player id of your device in the console. Then copy the Player Id without quotes and see above to add it as a Test User.

How do I send a test alert to OneSignal?

Install Your SDK Copy the alpha numeric code that OneSignal generates called Your App ID in the image below. On Thunkable, open the Push Notifications dialog and paste this ID into the Android App ID field. Click the Live Test button. Once the app is on your phone, go back to One Signal.


1 Answers

You can call sendTag from the OneSignal SDK with your channel name as the key and 1 as the value.

You can then make a POST call to OneSignal's create notification REST API. Set the tags field according to the documentation page to target your 'channel'. This call needs to be made from your server since targeting tags requires your OneSignal App REST API key.

like image 176
jkasten Avatar answered Oct 16 '22 08:10

jkasten