Sending Notification to Specific User with Onesignal

thanks for answering me
yes i’m thunkable pro
my android device is registered to a signal
I did a test from the onesignal website and it worked perfectly
I did the tests live
do not compile the application

Try the following changes:

  1. Change Content-Type from “aplication/json” to “application/json”
  2. Change the screen to Scrollable = true
  3. Add a label below the button
  4. Change the WebAPI call to the following
  5. On the android device, reload the application and click the button. Only click once, it will take a few seconds to finish.
  6. Send me a screen capture of what the device message says.
1 Like

Thank you very much brother, thanks for the help, thanks for the help, you helped me solve
the problem was as you said
I have written aplication/json and was application/json
I just did the test and if it worked :smiley: :smiley: :smiley:
Thank you very much You’re the best, Greetings from Argentina I send you a hug

1 Like

Does this same method work for iOS? I just have to change the app id
Anyway thank you very much, you helped me with what I needed :smiley: :laughing: :grin: :grin: :smile:

I haven’t tested it on iOS, because I have not set up my Apple Developer Account. If you are able to make iOS work, please post that information to the Discussion group so others can learn from your experience!

Cheers!

great, i will try to test on ios, thanks

I was wondering if I can send a notification to specific user when he is not on the app.
do you explanation here about per user notification work when the user is not active?

Yes the push messages work even when the user does not have the app running.

Thank you for your reply.
I have another question, let’s say that I make it work and I want to send a notification to that specific user, where do I do it, and how? will I be able to do this in the OneSignal website?
sorry if question was too much. I will appreciate any answer.

Thanks

There are probably a number of approaches, but here is mine.

  1. When a user logs into my app, I create a user profile in firebase which includes the Firebase UserID and the One Signal User ID (among other properties).
  2. When User A wants to send a push message to User B, my app gets the User B One Signal User ID from Firebase. User A’s application instance sends a push message to User B’s One Signal User ID.

I hope that helps

Happy Thunking!

1 Like

Hi, I’m new here, this information really helped me a lot. I tested my application using these blocks and it works in my application.
Thank you so much.

I have the blocks setup properly but when I click the button the push notification is not sent if the app is closed or if the phone is locked. I need to rephrase that, the notification is sent, but my phone does not show me the notification from outside the app or if the phone is locked, I won’t get the notification until I open up the app again, then it just displays similar to an alert warning.
I checked onesignal and I see that the notifications are in fact going through properly, it says “delivered” in green under the status column.

What am I doing wrong?

could this be an issue with your phone settings?

I thought about that too but I get other push notifications regularly

1 Like

Does anyone have a solution on sending notification for more than 30 days in the future. One signal does not support that.

A solution incorporating airtable and integromat may work for you @funhall

App sends entry to airtable for when to send a message to a particular userID

Integromat checks it weekly for new entries

When new entry is in the appropriate time frame -> create OneSignal push message

1 Like

This all looks a little flaky. I tried the solution proposed by @jacob1 and couldn’t get that to work. I got error messages about invalid character at line 1 column 3. I tried the solution proposed by @drted and couldnt get that to send anything. So I combined the two methods.
If you are having issues getting this to work try this approach.

  1. In the query parameters of your web_api component add parameter app_id. in the value field add your onesignal api id

  2. In the headers section add two items:-

         (i) Authorisation.  In the value field enter the word Basic followed by a space then paste your 
         REST API KEY.  Note I spelt authorisation with an "s".  I dont know if that is important or if 
         being in the UK, spellcheck did it.
    
        (ii) Content-Type.  In the value field enter application/json.
    

Then in the blocks section I have this.


Also of note, the app variable PushToDrivers is a list of driver pushID’s from our database. We check this list each time we send a notification to see who is logged on so we only send to drivers who are working.

This approach appears to work so give it a go if you are stuck.

Cheers

1 Like

I hv got it!

Check this out