Configure Local Notification

Queues or clears a local notification.

Options 

  • Action queues a local notification, or clears an existing queued notification.
  • Name specifies the name of the local notification to queue or clear. You must specify a unique name for each notification.
  • Script specifies the script that runs after the user interacts with the notification. The script also runs when the notification would have displayed if FileMaker Go is in the foreground or if notifications are disabled for FileMaker Go.
  • Delay specifies the number of seconds to wait before queuing the notification.
  • Title specifies the title of the notification alert.
  • Body specifies the text for the notification alert.
  • Button 1, 2, or 3 Label specifies the label for each button in the notification alert.
  • Button 1, 2, or 3 Foreground specifies whether tapping the button should move FileMaker Go to the foreground or keep it in the background. If the calculation result is 1 (true), tapping the button moves FileMaker Go to the foreground. If the result is 0 (false) or not specified, FileMaker Go stays in the background.

Compatibility 

Product Supported
FileMaker Pro No
FileMaker Go Yes
FileMaker WebDirect No
FileMaker Server No
FileMaker Cloud No
FileMaker Data API No
Custom Web Publishing No

Originated in version 

17.0

Description 

Use this script step to display a notification alert on a device when FileMaker Go is not running or is in the background. The notification is displayed after the optional delay, even if FileMaker Go is not running.

If you specify a script, the following multiline parameter is passed to the script.

 

Line number

Parameter value

1

The name of the notification.

2

One of the following values:

  • NotificationSelected - The user tapped the notification.
  • NotificationNotDisplayed - The notification was not displayed because FileMaker Go was in the foreground.
  • NotificationNotAllowed - Notifications are disabled for the iOS or iPadOS device.
  • <button label> - The user tapped the specified button in the notification alert.

3

1 if FileMaker Go was in the foreground when the script was queued; 0 if FileMaker Go was in the background when the script was queued.

4

The optional script parameter in the Specify Script dialog box.

Notes 

  • If a new notification has the same name as a queued notification, the previous notification is cleared before the new one is queued.
  • If the user taps the notification, FileMaker Go moves to the foreground and the specified script runs. If the notification is displayed but the user doesn't interact with it, the script does not run.

Example 1 

Queues a notification without any script or buttons.

Copy
Configure Local Notification [Action: Queue; Name: "BeaconDetected"; Delay: 30; Title: "Beacon Detected"; Body: $beaconMessage;]

Example 2 

Clears a queued notification.

Copy
Configure Local Notification [Action: Clear; Name: "BeaconDetected";]

Example 3 

Queues a notification with a 10-minute delay. Each time the user taps the Snooze button, the Process Notification script runs again to send the user a reminder after 10 minutes. The following multiline parameter is passed to the Process Notification script when the user taps the Snooze button:

RemindMe
Snooze
0

If the user taps the Prepare Now button, the Process Notification script runs the Prepare Report Now script.

Process Notification script:

Copy
Set Variable [$param; Value: Get ( ScriptParameter ) ]
Set Variable [$buttonLabel; Value: GetValue ( $param; 2 ) ]
If [ (ValueCount ( $param ) = 0) or (PatternCount ( $buttonLabel; "Snooze" ) > 0) ]
Configure Local Notification [Action: Queue; Name: "RemindMe"; Script: "Process Notification"; Delay: 600; Title: "Inventory Report"; Body: "Prepare the inventory report."; Button 1 Label: "Prepare Now"; Button 2 Label: "Snooze"; Button 1 Foreground: True ]
Else If [ Exact ($buttonLabel; "Prepare Now") ]
Perform Script [Specified: From list; "Prepare Report Now"; Parameter: ]
End If