Hi All,
The Thunkable X documentation only shows you the possibility of using OneSignal to send notifications on bulk to your list of subscribed or active users. However many applications require the ability to send a notification to a specific user based on an action that occurs within the app.
For example when I request an Uber, a notification is sent directly to me when my Uber is one minute away. We can do similar with OneSignal and Thunkable by doing the below (Note: you can’t live test Push Notifications - I suggest you make this the last thing you build into your app)
1 - Follow the documentation for setting up your OneSignal account here
2 - Paste your API key into the Onesignal on your app
3 - In order to send Push Notifications on a triggered event we are going to use OneSignals REST API, place a WEB API component into your app and fill in the details as shown below:
URL: https://onesignal.com/api/v1/notifications
In the Property Field add “Authorization” and in the value field “Basic” & YOUR_AUTHORISATION_CODE which you can find here
Then repeat the Process with “Content-Type” in the property field and “application/json” in the value field. These will be your Headers for the API call.
4 - When a user signs up for the app we capture some details in Firebase - we store their PushID against their data so we can reuse this to send notifications in our app:
5 - Now we are ready to trigger an event and send a notification to the user, we use the WEB API we created and update the BODY of the API call below:
{ “app_id”: “FIND_YOUR_APP_ID_HERE”, “contents”: {“en”: “ADD_YOUR_NOTIFICATION_MESSAGE”}, “headings”: {“en”: “ADD_NOTIFICATION_HEADING”}, “url”: “”, “include_player_ids”: [“ADD_USERS_PUSHID”] }
Edit the above to reflect what your notification says and include your APP ID and the users PUSH ID that we saved earlier when they created an account, then you create a post call and the user will receive a notification when this particular action occurs,
Please reach out if you have any questions
Jacob