How to check if the application opens for the first time

How to organize a check so that you do not ask for a request to send notifications every time you open an application, so that if a request has already been sent, then do not ask again.

In the Global Canvas there is an Application Launched Event that fires once when the app starts.

Also, your initial or first Page has a Page Mounted Event that should only execute once

Use these Events to run your One-Time-Only code

1 Like

Thank you so much. But a little bit different.

The proposed option is triggered when the application is opened once.

I meant to organize such a check so that the next time the application was opened, the request, for example, to send notifications would no longer arise.

So you should store a Status value in local storage, and read that on app startup to see if its been set already.

Yes, that’s what you need. But how can this be done? Thank you

There is a Set Item to Storage flow function, and a Get Item from Storage flow function. They are in the Marketplace. They just read/write a Key:Value to local storage.

It sounds great. But you can help with an example, and an extra subtlety: Because users can change the notification settings for my app at any time, how I can get my app’s authorization status at any time?

Here are the flow functions you would use.

At whatever point you choose you would just Set your App variable to whatever status you want, then Set item to storage with that variable value

Then at App startup you would just do Get Item from Storage, that same key, set your Notification Status variable = output of that Get Item, and just check what the value is.

Capture

1 Like

Ok, thanks. All work is good!

How to remove the badge from the app icon after opening the push-notification on iOS device?

I send push with badge -1, opening notification, but badge from icon of my app is still.

How I can remove badge after opening push notification automatically?

Did you ever figure this out?

how do we get the value of an item in storage if the value is set to true or false?

1 Like