# Push Notification Icon

**URL:** <https://community.thunkable.com/t/push-notification-icon/1768914>\
**Category:** Questions about Thunkable X\
**Tags:** push-notifications, object\
**Created:** [March 5, 2022, 7:25pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914 "2022-03-05T19:25:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 5, 2022, 7:25pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/1 "2022-03-05T19:25:45Z")

</div>

I’m proud to say I’ve got the push notifications working from this thread

> [@Sending Notification to Specific User with Onesignal](https://community.thunkable.com/t/sending-notification-to-specific-user-with-onesignal/150022/61):
>
> Thanks a million to [jacob1](http://community.thunkable.com/u/jacob1) for this great idea! Like many others, I struggled to get this working. Below is a picture of my “all block” solution to sending a push message ('cuz this is Thunkable, right?) You will notice that the Headers do not include the Authorization parameter. Interestingly, when using the include\_player\_ids parameter, the API key is not required. One less piece of secure information you do not need to include in your app. I tried to use the query parameters bloc…

I am still trying to figure out how to adjust the small\_icon in Thunkable. Here’s the notes on that currently from OneSignal - [Notification icons](https://documentation.onesignal.com/docs/customize-notification-icons)

Does anyone know off hand how to do this? I imagine it’s simple now that everything is setup. I’ve tried a few variations to no avail.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 5, 2022, 8:00pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/2 "2022-03-05T20:00:14Z")

</div>

Thunkable is using `React Native` and therefore you need to get the APK and edit it with an APK editor then update the following paths and then recompile

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/4/041c5da798b07b92e545b91a34b7e3535591b871.png)

This will not work for iOS.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 5, 2022, 10:20pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/3 "2022-03-05T22:20:10Z")

</div>

Is there a way to set the push notification delay for send\_after to be set as seconds since 1970?

That would help because I won’t have to convert the time units to a normal date format, plus the trouble of what happens toward the end of a month for example… If I want to send 14 days before April 2, 2022 then I have to convert the month April into March because you can’t subtract 14 days from 2.

Same goes for every other unit of time, hours, minutes, seconds, years and so on.

Would be nice if I could just easily do seconds since 1970.

Thanks

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 6, 2022, 12:39am UTC](https://community.thunkable.com/t/push-notification-icon/1768914/4 "2022-03-06T00:39:31Z")

</div>

Also wondering if a push notification can send a user to a certain screen or something within the app. I need to re title this thread to ‘all things push notifications’ I guess ha

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 6, 2022, 4:00am UTC](https://community.thunkable.com/t/push-notification-icon/1768914/5 "2022-03-06T04:00:56Z")

</div>

And also how to cancel a scheduled push notification.  
I need to allow users to cancel appointments and of course the scheduled push notifications reminders that go along with it

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 6, 2022, 7:27pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/6 "2022-03-06T19:27:17Z")

</div>

I decided to use a Unix rest API for the 1970 issue because OneSignal doesn’t accept Unix times it seems, I’m creating multiple reminders, so I have to convert the original appointment date to Unix, then subtract the seconds for each reminder and make a list of those.  
Then, that list of seconds subtracted Unix times is used to convert back into normal date/time and a 2nd list is created of those. Then I run that list through OneSignal with the send\_after parameter.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 6, 2022, 7:51pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/7 "2022-03-06T19:51:12Z")

</div>

You could easily pass the following to a JavaScript code which will give you the future date you want

```auto
new Date(2022, 3 - 1, 6 + 14).toUTCString()

```

The **Date** constructor takes the following arguments

- first argument, year in 4 digit
- second argument, month in 0 based so March is 2
- third argument is days ( in the example I am passing todays date “6” + 14 days from today
- the `toUTCString()` is required by OneSignal because it recognizes GMT only.

The command is case sensitive so you need to supply it in proper case.

In the third argument you can supply the day with the number of days required using **+** to move to the future or **-** to move to the past.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 6, 2022, 7:55pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/8 "2022-03-06T19:55:19Z")

</div>

I actually need to move back in time though, because the appointment date is set for example April 1st.  
I want a push reminder for the day before on March 31.

But also, in what block do you enter this?

> [@muneer](#):
>
> `new Date(2022, 3 - 1, 6 + 14).toUTCString()`

Thanks again

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 6, 2022, 8:00pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/9 "2022-03-06T20:00:04Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/1/211b487e2804e378b8a64a2a5ec3d7f6a3226a73.png)  
This is what you will supply the JavaScript code and the result is shown in the screen. It will give you the correct date whether forward or backward.

See my demo project  
[https://x.thunkable.com/projectPage/621c9b6c73ba2500119d10ef](https://x.thunkable.com/projectPage/621c9b6c73ba2500119d10ef)

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 6, 2022, 8:22pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/10 "2022-03-06T20:22:54Z")

</div>

Thank you for this, one last one… is there a quick and easy way to get a list of all scheduled notifications and a way to delete any or all of those scheduled notifications?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 6, 2022, 10:15pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/11 "2022-03-06T22:15:11Z")

</div>

> [@overshield](#):
>
> easy way to get a list of all scheduled notifications

Yes, try this API end points

```auto
curl --include \
     --header "Authorization: Basic YOUR_REST_API_KEY" \
     "https://onesignal.com/api/v1/notifications?app_id=YOUR_APP_ID"

```

## sample output

200 OK

> **Sample output**
>
> ```auto
> {
> "total_count": 553,
> "offset": 0,
> "limit": 1,
> "notifications": [
> {
> ...
> "app_id": "3beb3078-e0f1-4629-af17-fde833b9f716",
> ...
> "chrome_web_icon": "https://img.onesignal.com/t/73b9b966-f19e-4410-8b5d-51ebdef4652e.png",
> ...
> "ios_interruption_level":"active",
> "ios_relevance_score": 0.0,
> "name": "Campaign: New Shoe Releases", 
> "contents": {
> "en": "Come by and check out our new Jordan's!!! (Shoes) 🎃🙊👻"
> },
> "converted": 0,
> "data": {
> "your_data_key": "your_data_value"
> },
> ...,
> "errored": 1,
> "excluded_segments": [
> "3 Days Inactive"
> ],
> "failed": 0,
> ...
> "headings": {
> "en": "Thomas' Greatest Site in the World!! 😜😁"
> },
> "id": "e664a747-324c-406a-bafb-ab51db71c960",
> ...
> "included_segments": [
> "all"
> ],
> ...
> "queued_at": 1557946677,
> "remaining": 0,
> "send_after": 1557946620,
> "completed_at": 1557946677,
> "successful": 386,
> ...
> "url": "https://mysite.com",
> ...
> "platform_delivery_stats": {
> "edge_web_push": {
> "successful": 2,
> "failed": 0,
> "errored": 0,
> "converted": 2,
> "received": 2
> 
> },
> "chrome_web_push": {
> "successful": 26,
> "failed": 0,
> "errored": 0,
> "converted": 26,
> "received": 26
> },
> "firefox_web_push": {
> "successful": 1,
> "failed": 0,
> "errored": 0,
> "converted": 1,
> "received": 1
> },
> "android": {
> "successful": 198,
> "errored": 1,
> "failed": 0,
> "converted": 198,
> "received": 198
> },
> "safari_web_push": {
> "successful": 3,
> "failed": 0,
> "errored": 0,
> "converted": 3,
> "received": 3
> },
> "ios": {
> "successful": 2,
> "errored": 3,
> "failed": 0,
> "converted": 2,
> "received": 2
> }
> },
> "ios_attachments": {
> "id": "https://img.onesignal.com/n/44843933-68d4-450c-af5c-5e5c1a9d946e.jpg"
> }
> }
> ]
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 6, 2022, 10:33pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/12 "2022-03-06T22:33:30Z")

</div>

I’m not sure what to do with curl and include.

And how do I delete them?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 7, 2022, 3:57am UTC](https://community.thunkable.com/t/push-notification-icon/1768914/13 "2022-03-07T03:57:04Z")

</div>

> [@overshield](#):
>
> what to do with curl and include.

This is what you require (according to documentation)

```auto
https://onesignal.com/api/v1/notifications?app_id=YOUR_APP_ID&limit=:limit&offset=:offset&kind=:kind

```

Parameters are:

- limit is the max number of notifications to poll. Max is 50
- offset is the page number to start in case you have more than 50 entries
- kind should be set to **1** to get notifications set by API not by dashboard

> [@overshield](#):
>
> how do I delete them?

To delete use:

```auto
https://onesignal.com/api/v1/notifications/:id?app_id=:app_id

```

You will need to supply the notification ID in place of **:id** along with App ID.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 7, 2022, 4:06pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/14 "2022-03-07T16:06:19Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/f/ffb280c4698e9d54a6688d96afaea5df17570372.png)

I’ve tried using Delete and Post here but I get an error both ways. I’m manually entering the notification ID & my App\_ID and getting a 500 error if I do Delete, and a 404 if I do Post

Am I supposed to use a generate JSON from object in the WebAPI body somewhere?

EDIT: Turns out it was delete, I was just dealing with quite a long delay between loading my new blocks for the app to load. Getting 200 now! Thanks

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 7, 2022, 4:17pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/15 "2022-03-07T16:17:49Z")

</div>

Glad you’re making progress in it.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 7, 2022, 4:27pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/16 "2022-03-07T16:27:59Z")

</div>

> [@muneer](#):
>
> Yes, try this API end points
> 
> ```auto
> curl --include \
> --header "Authorization: Basic YOUR_REST_API_KEY" \
> "https://onesignal.com/api/v1/notifications?app_id=YOUR_APP_ID"
> 
> ```
> 
> ## sample output
> 
> 200 OK
> 
> Sample output
> 
> ```auto
> {
> "total_count": 553,
> "offset": 0,
> "limit": 1,
> "notifications": [
> {
> ...
> "app_id": "3beb3078-e0f1-4629-af17-fde833b9f716",
> ...
> "chrome_web_icon": "https://img.onesignal.com/t/73b9b966-f19e-4410-8b5d-51ebdef4652e.png",
> ...
> "ios_interruption_level":"active",
> "ios_relevance_score": 0.0,
> "name": "Campaign: New Shoe Releases", 
> "contents": {
> "en": "Come by and check out our new Jordan's!!! (Shoes) 🎃🙊👻"
> },
> "converted": 0,
> "data": {
> "your_data_key": "your_data_value"
> },
> ...,
> "errored": 1,
> "excluded_segments": [
> "3 Days Inactive"
> ],
> "failed": 0,
> ...
> "headings": {
> "en": "Thomas' Greatest Site in the World!! 😜😁"
> },
> "id": "e664a747-324c-406a-bafb-ab51db71c960",
> ...
> "included_segments": [
> "all"
> ],
> ...
> "queued_at": 1557946677,
> "remaining": 0,
> "send_after": 1557946620,
> "completed_at": 1557946677,
> "successful": 386,
> ...
> "url": "https://mysite.com",
> ...
> "platform_delivery_stats": {
> "edge_web_push": {
> "successful": 2,
> "failed": 0,
> "errored": 0,
> "converted": 2,
> "received": 2
> 
> },
> "chrome_web_push": {
> "successful": 26,
> "failed": 0,
> "errored": 0,
> "converted": 26,
> "received": 26
> },
> "firefox_web_push": {
> "successful": 1,
> "failed": 0,
> "errored": 0,
> "converted": 1,
> "received": 1
> },
> "android": {
> "successful": 198,
> "errored": 1,
> "failed": 0,
> "converted": 198,
> "received": 198
> },
> "safari_web_push": {
> "successful": 3,
> "failed": 0,
> "errored": 0,
> "converted": 3,
> "received": 3
> },
> "ios": {
> "successful": 2,
> "errored": 3,
> "failed": 0,
> "converted": 2,
> "received": 2
> }
> },
> "ios_attachments": {
> "id": "https://img.onesignal.com/n/44843933-68d4-450c-af5c-5e5c1a9d946e.jpg"
> }
> }
> ]
> }
> 
> ```

This is what I’m getting when I try to make a list of all notifications with those parameters.  
It’s a 200 but there’s tons of information I don’t want/need right now

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/0/b0ed95086518348e97e6b689664d04663248124b.jpeg)

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 7, 2022, 4:42pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/17 "2022-03-07T16:42:39Z")

</div>

Trying a combination of the following is not giving me a result I can use so far

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/3/5316cd411a7ac475d8378e31dcbf2bda9604c2b8.png)  
a

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 7, 2022, 5:51pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/18 "2022-03-07T17:51:57Z")

</div>

`notifications` is an array (a list) so you need to use the list component to retrieve the information in it.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 7, 2022, 5:55pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/19 "2022-03-07T17:55:56Z")

</div>

If I put it in a for each item j, I get object Object

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 7, 2022, 6:19pm UTC](https://community.thunkable.com/t/push-notification-icon/1768914/20 "2022-03-07T18:19:33Z")

</div>

`Notification` is a list of objects so if you want to loop through it you should also use the object properties blocks to extract information from the entries of the list.

Example

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/b/1bfcf7982eafd273f2be69139cba501fbd417f21.png)

Gives me  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/2/52bfe3f256f6f7aec5b9d6a9eeecf03a851c28c4.png)

[Next page](https://community.thunkable.com/t/push-notification-icon/1768914.md?page=2)
