Push Notification Icon

Voilà!

Ok, now is there a way to automate the Delete process, where my arrow is pointing, as well?

It got kind of convoluted to try to debug with all those notifications sitting in there.

1 Like

I should be clear on my previous post, the blocks do cancel all the scheduled notifications like I’m wanting, but they’re still in there with the option to delete. I’m wondering if there’s a way to programmatically delete them once they’ve been canceled.

Other than waiting for time to pass them by and remove them that way

1 Like

The OneSignal documentation does not have a delete option for the notifications. It says that cancelled notification will be deleted from the log within 30 days.

1 Like

You may try this which will clear the record of the player_id. I have not tried it and there is nothing clear in the documentation.

https://onesignal.com/api/v1/players/:onesignal_player_id?app_id=YOUR_APP_ID

I get this error when trying a few variations of that.

1 Like

This indicates a problem in the header settings either in the Web API component or in the Headers block of the Web API.

Sorry for having to come back to this, I’m noticing when I use the new Date() it will display an hour, but the minutes and seconds are always 0
I’ve tried modifying it to be Date_time and several variations of such, but I can’t seem to get it right.

Is there a simple method to also being able to adjust the minutes and seconds?

For example new Date(2022, 4, 8, +2, +15, +10).toUTCString()

Thanks again

edit: I’m also noticing the hour is rounding the hour up to the next hour

1 Like

I see it with minutes and seconds

image

The function will not add minutes and seconds by itself. but will use the values you pass as the minutes and seconds to show the time.

Another easier way to add some minutes to the date is to get the date unix number such as ** 1652025690** and add the number of seconds you want to it.

For adding 30 minutes you would add 30*60 = 1800 seconds so the number will be 1652027490
when you then issue the command new Date(1652027490000).toUTCString() it will show the wanted time.

[Note]
1- Date numbers in JavaScript is in millisecond so if your date is in seconds then you need to multiply by 1000.
2- If the date number is already in millisecond then 30 minutes will be 1800000 not just 1800.

1 Like

I’m discovering this crashes on all my Android devices I test it on

I had to modify it a little for my needs

Anything in particular instantly stand out as to why this would be an issue?

1 Like

I’ve now found if there’s text in the URL of the web viewer it would cause the crash.
If the text was blank from the design page, I could edit the text through the blocks, but then any time I navigated away from the screen it would crash.

I ended up having to create a clone of the original web viewer, then edit that clone’s url, then set the value from post message, then remove said clone, and it works every time now even when I navigate away from the screen and back.

Hopefully this will help someone in the future

1 Like

Is there a way to go backwards with this same method?

Example take a datetime such as Mon, 04 Jul 2022 17:30:00 GMT and convert to seconds since 1970.

Thanks

2 Likes

When you use the date JavaScript function without any parameters it will give you back the date in milliseconds. You will need to divide by a 1000 to show it in seconds.

The following JavaScript code will get you the date in seconds
new Date(“Mon, 04 Jul 2022 17:30:00 GMT”).getTime() / 1000

2 Likes

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