ForeSee Developer Portal

Everything you need to configure and optimize your ForeSee products. Home of developer documentation, implementation guides, and release notes.

Blueprint

Invitation Modes

As touched on in some of the previous topics, Trigger supports the following invitation modes:

Contact (previously 'On-Exit')

Most common

The invitation asks for an email address or a mobile number. After submitting the information, the invitation is dismissed and the user is sent back to the app to continue from the point where the invitation was presented. No survey presents in this mode. Instead, after a period of time, the user is sent an email or an SMS text message with a link to the survey. The default time period is five minutes after the invitation is accepted. However, you can request a different value be configured by ForeSee Support. Detailed information on the SMS messages can be found here: SMS Details.

Contact invitation tip!

Contact details can be supplied to the SDK using the ForeSee setContactDetails:forType: method ahead of any user interaction. The format for these contact details should be name@domain.com, 555-123-1234 or 5551231234. If contact details are given to the SDK in this way, they are pre-populated for the user on the second screen of the Contact invitation. The type argument should be one of kFSEmail or kFSPhoneNumber (defined in FSContactType).

When using these methods with custom invitations, you should also set a preferred type using setPreferredContactType:type:. This tells the SDK what type of contact details you want to send for the user.

Updated invitation styling (SDK v5.1+):

Original invitation styling (SDK v5.0 and before):

Your surveys must be configured on the ForeSee servers for this option to work properly. Contact invitation mode may be enabled in the configuration file, but a survey link isn't delivered unless properly configured remotely as well.

Contact (E-mail-only)

The CONTACT invitation mode also supports an e-mail-only option. To enable this mode, add the following line to your foresee_configuration.json (at the root level):

  "emailOnlyContactNotification": true

In this mode, the user sees only an option to enter an e-mail address (no phone number).

In-Session (previously 'Immediate')

Default invitation mode. The survey is displayed at the point where the user accepts the invitation. The survey is displayed in a WebView. It is automatically dismissed when the survey is complete, or the user abandons the survey by tapping the Back button.

Updated invitation styling (SDK v5.1+):

Original invitation styling (SDK v5.0 and before):

Exit Invite (New!)

The invitation displays as a local notification and after the user exits the app. If the user accepts the invitation, they are taken to a survey page. [This does not work for those who have disabled their setting for local notifications.] Both hard exits and pushing the app to the background count towards the launchCount display criteria, and both trigger the survey. The local notification appears 10 seconds after the user ends their app session. The verbiage of the invitation can be customized as well.

Exit Survey (previously 'Local')

In this mode, when the user accepts the survey invitation, a local system notification is queued. Once the user exits the app, they see a local system notification informing them that they can take a survey. [This does not work for those who have disabled their setting for local notifications.] Both hard exits and pushing the app to the background count towards the launchCount display criteria, and both trigger the survey. The local notification appears 10 seconds after the user ends their app session and it is immediately deployed if the invitation is accepted. The verbiage of the invitation can be customized as well.

Updated invitation styling (SDK v5.1+):

Original invitation styling (SDK v5.0 and before):

For Exit Invite and Exit Survey modes, the following steps must be taken to ensure the invitation appears correctly.

When using local notifications, your AppDelegate should adopt the UNUserNotificationCenterDelegate protocol and register itself as the delegate for handling notifications:

  [UNUserNotificationCenter currentNotificationCenter].delegate = self;

You should also implement the following methods for handling notifications:

- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
         withCompletionHandler:(nonnull void (^)(void))completionHandler
{
  [ForeSee showSurveyForNotificationResponse:response];
  completionHandler();
}

// Called when a notification is delivered to the foregrounded app
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
      willPresentNotification:(UNNotification *)notification
        withCompletionHandler:(nonnull void (^)(UNNotificationPresentationOptions))completionHandler
{
  NSLog(@"User Info : %@",notification.request.content.userInfo);
  completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}

In the rare case where the user force-quits your app in the time between accepting your invite and the time they receive the local notification, the ForeSee SDK may no longer be running when userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: executes. You must restart the ForeSee SDK to capture these users (e.g. by executing [ForeSee start] (or using whatever method you use to start the SDK under normal circumstances)).

Finally, you may also wish to prompt the user for notification permissions at a time that's appropriate for your app:

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
[center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert)
                      completionHandler:^(BOOL granted, NSError * _Nullable error) {
                        if (!error) {
                          NSLog(@"Registered for notifications");
                        }
                      }];

If you do not add this final snippet to your project, then the user is prompted as they accept the invitation.

Invitation Styling

For the invitation types that have a top banner image, the recommended size is 450 pixels by 125 pixels. If an appropriate brand image isn't available, a solid color can be used instead.
The recommended size for the client logo is 200 pixels x 200 pixels. The actual display size is different than those dimensions, but they provide guidance as to the height x width ratio.

Invitation Modes


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.