Sending Notification to Specific User with Onesignal

The firebase part is just not useful for the notification purpose, right?

This link says missing app_ID so I can’t understand the rest that’s writtten after

Also; do you know anything about opening an app specific screen when the notification is pressed?
It should be app_url but we don’t have those in thunkable, right?

from the onesignl official site:

data
object
All
A custom map of data that is passed back to your app.
Example: {"abc": "123", "foo": "bar"}
url
string
All
The URL to open in the browser when a user clicks on the notification.
Example: http://www.google.com
Note: iOS needs https or updated NSAppTransportSecurity in plist
This field supports inline substitutions.
Omit if including web_url or app_url
web_url
string
All Browsers
Same as url but only sent to web push platforms.
Including Chrome, Firefox, Safari, Opera, etc.
app_url
string
All Apps
Same as url but only sent to app platforms.
Including iOS, Android, macOS, Windows, ChromeApps, etc.

Hi, can you share this to remix and for better understanding

4 Likes

Hi and thanks for this nice turturial. I do have some questions though.
I dont get the answers from Thunkable so hope you can help me out.
I now have tryed to publish on Apple 5 to 6 times with no luck.
I found out that the 2-3 first mail was going to a mail I didnt check. So that I know now.
But the last times i didnt get the mail at all. When I found the first mails it was an error on the Notification and maybe that is why it wont go thru the last times, so I like to know some things from you please.

  1. Do I have to use the Web API if I use OneSignal. If yes can you help with better pictures of the variable block you use in your picture.
  2. If I use the Web API can I make scheduled notifications also?
  3. Do I have to use firebase to make the notification ID?
  4. In your tutorial you write " In the Property Field add “Authorization” and in the value field “Basic” & YOUR_AUTHORISATION_CODE which you can find here " BUT Where can I put in the code???
  5. Maybe a short explanation on how the notification work.

I have send the app to Android but it dont seems that the notification works. I have only used the get Notification ID block and uploaded it to airtable and not firebase. Is that why it wont work?
When i tested the app the notification arrived in the Thunkable Live app and not in the real App

Hi Funhall Viborg

Please see below answers to your questions:

1- Yes in order to send to one user only you need to use a WEB-API
2 - Yes you can schedule notifications straight from the one signal dashboard
3 - I use Firebase in this example but you don’t need to you just need to store the notification ID so you can get it again
4 - You put this in the header field of your WEB-API
5 - if you wanted to share the project I can assist further

Did you have time to help me. I have send you PM

I tried 50 times and I figured it out.

Just use Headers input.

First write to Property inputbox : “Authorization”
to Value inputbox: “YOUR_AUTHORISATION_CODE” which you can find here
and press ADD;

Secondly write to Property inputbox : “Content-Type”
to Value inputbox: “application/json”

to Body input paste the code show below:

  1. if you want to send your notification everybody use this:

{
“app_id”: “05a1a9c5-xxxx-xxxx-xxxxx-aad3xx5071f2”,
“included_segments”: [“All”],
“data”: {“foo”: “bar”},
“contents”: {“en”: “English Message”}
}

  1. If you want to send your message to a spesicif person use this:
    {
    “app_id”: “05a1a9c5-xxxx-xxxx-xxxxx-aad3xx5071f2”,
    “include_player_ids”: [“8c08f556-xxxx-xxxx-xxxx-2513x6x64x51”],
    “data”: {“foo”: “bar”},
    “contents”: {“en”: “English Message”}

Or you can use block like this.

wola!

5 Likes

Thanks for all the posts. I will try and get this working tomorrow in my app. I would like to notify specific users when event occurs within the app.

2 Likes

I do already have a question. Acording to the Doc’s you can only test IOS notifications after its been uploaded to the app store? is that still true? I was hoping by downloading and installing the app they might work?

Hi Jeffrey,

I’ve found them to work by just downloading the app through thunkable - it may be because the above utilises the API call rather than the pushnotification component,

Jacob

2 Likes

There was a problem in the JSON you submitted: unexpected character at line 1, column 3 it is saying.

I am not able to get what exactly is the problem in this.

Can someone help me please

{“app_id”: “b230cf39-782f-41d8-b99f-2df930fd6ca6",
“contents”: {“en”: “HKP this is the test message”},
“headings”: {“en”: “HKGT Internal"},
“url”: “”,
“include_player_ids”: [“20351ae5-310c-4af5-931b-1f4330dd4331"]}

The above is in BODY. I am not able to figure out why it is giving that error

Please help

The url property is blank, do you need that?

I don’t need that

But I tried it by removing that also. Same error is coming.

Even I tried removing contents and headings also.

Same error is coming

Finally it is working. I just moved app_id to query parameters and shifted include_player_ids to front. I didn’t know the reason but it worked

But in the popup if I click OK it is going to somewhere. Although I have not given anything in URL

1 Like

This is the code that @bymaho posted above. I notice yours is different. Do you think that may be what’s causing your issues?

1 Like

Hi All,

I am going through all these responses and I can set up for sending to a single user based upon an event. However, I have some further specific needs:

Imagine a news app which sends push notifications of specific stories based upon a users interests that they select when registering for the app. So, my questions would be:

  1. OneSignal has a segmentation option based upon User Tags that are inserted in the app. Is it possible for me to use this so that I can group segments of the user base together to customize the notifications different groups would receive?

  2. Assuming #1 is possible, then if a user clicks on the notification, how can I create the link between the OneSignal notification and a specific app page?

Thanks

I don’t have the answer to your question, but you should post on how to send a push message based upon an in-app event! That sounds really cool!

You can segment notifications either using the segment parameter or tag parameter you can see more here https://documentation.onesignal.com/reference#create-notification

However the answer to your second question. I haven’t found a way to provide deep links to the url in the app. Would be keen to see if the thunkable team know how this is done

@jared this is entirely possible to activate a notification from an in app event you can also use one signals api to delay a notification.

For example I use this to allow my users to submit a support ticket to another user, and they set a validity on the support ticket which I use to delay another notification which sends to them the day before the ticket expires to provide follow up. It’s useful

1 Like

@jacob1, I can see the documentation provided by OneSignal. However, I am curious of taking this a step further.

For the news app analogy (not what I am trying to make, but easy to use for explaining intent), imagine a set of preference selections in which I could select topics of interest. So these selections would then be stored in Firebase (appearing as True of False).

So I would then want to be able to send important news alert to a user that selected interest in a particular topic, but not to those that did not select this. I can easily add another layer to Firebase that marks users as A, B, C, D, etc. based upon their selections. But what I stumble on is how to use this same segmentation in OneSignal.

Any thoughts on how to do this?