# Push notifications when button click

**URL:** <https://community.thunkable.com/t/push-notifications-when-button-click/3474800>\
**Category:** Questions about Thunkable X\
**Created:** [January 13, 2025, 9:15pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800 "2025-01-13T21:15:49Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [January 17, 2025, 4:49pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/21 "2025-01-17T16:49:27Z")

</div>

Hi @brianl

I tried this

 ![Push Notifications Button Click](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/8/e80ee071a277b864099beea50c644d8041a82776.jpeg)  
but it didn’t return anything!!

Then I tried another … then it shows this message

 ![IMG_20250117_200626](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/4/546fb3efe0b3437b0499e5125b9964784ac15eaa.jpeg)

Notice that I put my one signal appID and key ID

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [January 17, 2025, 8:21pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/22 "2025-01-17T20:21:09Z")

</div>

Now … I’m just want to know what’s the wrong with this api calling?

---

<div class="post-metadata">

**Author:** ![brianl](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@brianl](https://community.thunkable.com/u/brianl)\
**Post date:** [January 17, 2025, 9:18pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/23 "2025-01-17T21:18:34Z")

</div>

Looks like you didn’t set up the auth correctly. If you check the API docs, it’ll say what you need for your header. In the picture example, the key will go in app variable API

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [January 17, 2025, 9:41pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/24 "2025-01-17T21:41:07Z")

</div>

Already i put the APP ID on app variable and the API KEY on another … it doesn’t work.

Also connected it to the blocks directly as text block … it also doesn’t work.

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [January 18, 2025, 11:32am UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/25 "2025-01-18T11:32:15Z")

</div>

Here is the how i got the one signal app id and api key … isn’t it right??

 ![IMG_20250118_132853](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/8/c8ec709eadd145011e1beaaee129951e4b3cc5f8.jpeg)  
 ![IMG_20250118_132802](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/6/f65b0d6223aba03bcf5c9b90e2eb63bd74a51e46.jpeg)

Or i have to fill in this ?

 ![IMG20250118130313](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/b/9bddea0a99a07f11995cab517343264a625240c5.jpeg)

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [January 19, 2025, 6:21pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/26 "2025-01-19T18:21:31Z")

</div>

I received an email from one signal that:

 ![IMG_20250119_195613](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/2/f286c9de9aa84075b980c6cb10cb7a235b91ed5c.jpeg)  
Then … i coded as it is shown below… typical for the email code “as i understood”  
 ![IMG_20250119_195557](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/4/f494e1973b5a529ef18ee28ce0271c069f14a68c.jpeg)

At the end … i didn’t get anything neither response nor error

Could anyone help??

---

<div class="post-metadata">

**Author:** ![finbarr.mccarthytl32](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@finbarr.mccarthytl32](https://community.thunkable.com/u/finbarr.mccarthytl32)\
**Post date:** [January 20, 2025, 4:33pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/27 "2025-01-20T16:33:07Z")

</div>

I have used push notifications but have done this server side. I use Xano and store the OneSignal Player ID there, so when I want to send a push notification to a user, I upload a record to Xano and have sent Xano to automatically send a push notification to the OneSignal Player ID. Push Notification does rely on Firebase but I don’t use Firebase or storing data, but I am sure something similar would be possible.  
It took me a couple of months to figure out that the OneSignal Player ID is automatically created when an app with Push Notifications enabled is installed on a device. This was not clear in the Thunkable documentation and even the Thunkable support desk appeared to be unaware of this at the time.  
I hope this helps.

---

<div class="post-metadata">

**Author:** ![brianl](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@brianl](https://community.thunkable.com/u/brianl)\
**Post date:** [January 21, 2025, 11:23pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/28 "2025-01-21T23:23:47Z")

</div>

What I would recommend is to try the following:

Set a text input to the push notification user id. Test it on a device to get that devices push notification user id. You can now send targeted push notifications if you copy down that string.

Then use something like Postman to try to send a push notification. You would want to do it similar or exactly the same as you would have it on Thunkable and then see the results. If it doesn’t work, then it has something to do with the API. If it works on Postman, let me know and I can give it a try when I have some time.

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [January 31, 2025, 3:34pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/29 "2025-01-31T15:34:26Z")

</div>

Hello @brianl and thank you for your help.

I tested it with postman with a “segment” name … It succeed … But with the player id it faild althiugh i copied it from one signal subscribtions page.

---

<div class="post-metadata">

**Author:** ![brianl](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@brianl](https://community.thunkable.com/u/brianl)\
**Post date:** [February 3, 2025, 7:19pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/30 "2025-02-03T19:19:10Z")

</div>

I’m not sure where you are copying from exactly, but I would keep trying to figure it out with Postman and then translate the knowledge to Thunkable

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [February 9, 2025, 4:23pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/31 "2025-02-09T16:23:44Z")

</div>

hi @brianl

it’s finally passed postman test and delivered to the subscriber with the subscription id …

i followed postman instructions and corrected the code … that was as the below at the end:

curl --request POST   
–url ‘[https://api.onesignal.com/notifications?c=push](https://api.onesignal.com/notifications?c=push)’   
–header ‘Authorization: key …’   
–header ‘accept: application/json’   
–header ‘content-type: application/json’   
–data ’  
{  
“app\_id”: “…”,  
“contents”: {  
“en”: “Good Morning new member”  
},  
“include\_subscription\_ids”: [“…”]  
}  
’

but when tried to make this code with thunkable blocks it failed…  
here is the thuncable full blocks i bullt

 ![IMG_20250209_180922](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/6/565ce5b73b83432fd87fe504a180aaa3ecd1c4bb.jpeg)

could you help me knowing the issue to fix it.

thanks

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 9, 2025, 5:30pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/32 "2025-02-09T17:30:20Z")

</div>

> [@tabibelkhirfaluc2](#):
>
> but when tried to make this code with thunkable blocks it failed…

What is the value of the green `error` block?

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [February 9, 2025, 5:58pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/33 "2025-02-09T17:58:27Z")

</div>

Unfortunately… it’s nothing.

It didn’t do anything

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 9, 2025, 6:12pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/34 "2025-02-09T18:12:49Z")

</div>

That’s because you’re setting Label6 to so many different values without any wait blocks. Only the **last** value is going to appear.

Create a new label and set Label7’s (or whatever it’s called) Text to `error`.

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [February 10, 2025, 8:09pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/35 "2025-02-10T20:09:07Z")

</div>

![17392180479342682056047575639000](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/0/70939ef25b0661feaa5837aa90936aaa5df08ad2.jpeg)  
I changed it but it still nothing

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 10, 2025, 9:12pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/36 "2025-02-10T21:12:08Z")

</div>

If you’re not getting an error, is it possible you’re getting a value in the `response` block? I haven’t used OneSignal so I’m not sure what the response is supposed to show but you should get something… a response, an error, a status…?

---

<div class="post-metadata">

**Author:** ![tabibelkhirfaluc2](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tabibelkhirfaluc2](https://community.thunkable.com/u/tabibelkhirfaluc2)\
**Post date:** [February 10, 2025, 9:24pm UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/37 "2025-02-10T21:24:01Z")

</div>

No … i didn’t get any

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 11, 2025, 5:26am UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/38 "2025-02-11T05:26:52Z")

</div>

Are you sure the code is firing? You can add debugging statements. I use this method: [Debugging in Thunkable X (Video)](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [May 12, 2025, 5:27am UTC](https://community.thunkable.com/t/push-notifications-when-button-click/3474800/39 "2025-05-12T05:27:14Z")

</div>

Closed on May 12, 2025, 5:27am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.thunkable.com/t/push-notifications-when-button-click/3474800.md?page=1)
