From Xojo Documentation


MobileNotifications.RequestAuthorization(ParamArray options as MobileNotifications.AuthorizationOptions)

New in 2020r2

Supported for all project types and targets.

Requests from the OS permission to send local notifications.


If the options you request will be visible the other (an alert, badge, sound, etc.) and the app hasn't made this request before, the OS will display a dialog asking the user to give permission. Otherwise, your request will succeed assuming the user has not otherwise disallowed the options you requested.

Because the user can change their notification settings for your app at any time, you should call RequestAuthorization in the Opening event each time your app launches.

The AuthorizationSucceeded event will be called if the request is successful.

Sample Code

Requesting authorization to display a notification via a badge and sound in the app's Opening event:

me.NotificationCenter.RequestAuthorization(MobileNotifications.AuthorizationOptions.Badge, MobileNotifications.AuthorizationOptions.Sound)

See Also

AuthorizationSucceeded event.