Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

UNNotification.RemoteNotificationsDeviceToken

Queries device token.

Component Version macOS Windows Linux Server iOS SDK
UNNotification 7.2 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "UNNotification.RemoteNotificationsDeviceToken" )

Parameters

none

Result

Returns text.

Description

Queries device token.
If the registration for remote notifications is successful, this function will return the hex encoded device token. You can pass the device token to your server sending the push notifications.
Text is empty if registration failed.
e.g. "416204F694DA65CC1AFD9E473C7E44C22DD66B61FD4DA61B255A89EE436B6F61"

See UNNotification.RemoteNotificationsError for the reason.

For this to work, your application must have entitlements for remote notifications. To add the required entitlements to your app, enable the Push Notifications capability in your Xcode project, in the Signing and Capabilities section. Enabling this option in iOS adds the APS Environment Entitlement to the app. In macOS, it adds the APS Environment (macOS) Entitlement.
There error message would be: no valid "aps-environment" entitlement string found for application.

For the plugin being able to request remote notification, you need to link in MBSInit.framework, which makes sure the plugin is loaded earlier. You can query UNNotification.DidMBSInit to see if the initialization happened and use UNNotification.RemoteNotificationsCallbackReceived to see if the callback arrived. Both functions are currently not documented.

For MacOS the plugin can't register for remote notifications as FileMaker Pro misses the required entitlement.

Examples

Show device token:

Show Custom Dialog ["Device Token"; MBS("UNNotification.RemoteNotificationsDeviceToken")]

See also

Blog Entries

This function is free to use.

Created 15th April 2017, last changed 14th January 2026


UNNotification.ReleaseAll - UNNotification.RemoteNotificationsError