Next you need to copy MBSInit.framework to the Frameworks folder. In Xcode in the project settings, please add MBSInit.framework there to the list of libraries to link to. See the following screenshot with our two MBS files in the files list on the left and the MBSInit framework in the link list in the middle:
This makes sure the MBSInit framework is loaded at start of the application and initializes the notification system. Once your app runs, you'll see the following dialog asking for permissions:
If you click allow, UNNotification.AuthorizationGranted function will return 1 and UNNotification.AuthorizationError will be empty. If you like, query device token with UNNotification.RemoteNotificationsDeviceToken and than pass this token to the server for push notifications.
Please also check system settings for your application for whether notifications are allowed. Especially if you want more than just text, you may need to allow sound or badges:
Once you got the notification system initialized, you can show a local notification with a script. The following example script creates a new notification, sets title and body texts, a time interval and schedules the notification.
# Create a new notification
Set Variable [ $notification ; Value: MBS("UNNotification.New") ]
# Set Title and Body
Set Variable [ $r ; Value: MBS("UNNotification.SetTitle"; $notification; "Hello") ]
Set Variable [ $r ; Value: MBS("UNNotification.SetBody"; $notification; "Greetings from FileMaker") ]
# Set a time interval trigger
Set Variable [ $r ; Value: MBS("UNNotification.SetTimeIntervalTrigger"; $notification; 60; 0) ]
# and schedule
Set Variable [ $r ; Value: MBS("UNNotification.Schedule"; $notification; "test") ]
The notification shows while application is in background:
If you have questions, please do not hesitate to contact us.