Installing the Flowsense SDK is fairly simple. Carefully follow the next steps and start enjoying more precise engagement for your app.
Flowsense is a service that requires a set of authentication tokens to work. Please contact sales before attempting to install the plugin.
- Android version 16 or higher.
- Compatibility with the following dependency versions:
api 'com.google.code.gson:gson:2.8.2'
api 'io.sentry:sentry-android:1.7.2'
api 'com.google.android.gms:play-services-location:16.0.0'
api 'com.google.firebase:firebase-core:16.0.9'
api 'com.google.firebase:firebase-messaging:17.6.0'
api 'com.amazonaws:*:2.11.0'
Flowsense provides a token for each platform. Start the plugin passing the platform specific token:
if (Platform.isIOS) {
FlowsenseFlutterPlugin.shared.startFlowsenseService("your_ios_token");
} else {
FlowsenseFlutterPlugin.shared.startFlowsenseService("your_android_token");
}
If using geolocation, include the location authorization request in runtime:
// Request permission
FlowsenseFlutterPlugin.shared.requestAlwaysAuthorization();
// Start location tracking
FlowsenseFlutterPlugin.shared.startMonitoringLocation();
On iOS you must include three keys to your Info.plist in order to show the location permission message:
- Privacy - Location Always and When In Use Usage Description
- Privacy - Location Always Usage Description
- Privacy - Location When In Use Usage Description
Each of these keys must contain the message you wish to present to the user when location is requested.
You can pass an anonimized user identifier to Flowsense by:
FlowsenseFlutterPlugin.shared.updatePartnerUserId("your_anonimized_user_info");
You can pass a set of key-values to Flowsense in order to enrich the user information:
FlowsenseFlutterPlugin.shared.setKeyValue({"Last Purchase ID": "AIFTS-DF86F"});
FlowsenseFlutterPlugin.shared.setKeyValue({"Last Purchase Value": 63});
FlowsenseFlutterPlugin.shared.setKeyValue({"Registered User": false});
FlowsenseFlutterPlugin.shared.setKeyValue({"Last Purchase Date": new DateTime.now()});
FlowsenseFlutterPlugin.shared.commitChanges();
You can track specific app events by passing an event name and an optional set of data in the form:
FlowsenseFlutterPlugin.shared.inAppEvent("eventName", {
"buttonClicked": "OK",
"dateClicked": new DateTime.now()
});
For more information on Flowsense push, please refer to link and link.
Flowsense iOS SDK uses method swizzling by default. You can turn it off by adding to your app's Info.plist the following key: FlowsenseCallbackSwizzlingEnabled with a Boolean value of NO.
Note: by doing so, Flowsense won't be able to collect push analytics
On iOS, it is necessary to ask for push permission in runtime. Do so by requesting the token:
FlowsenseFlutterPlugin.shared.requestPushToken();
You can define a callback to retrieve the iOS token and to view the push permission status:
FlowsenseFlutterPlugin.shared.setPushTokenCallback((token){
});
FlowsenseFlutterPlugin.shared.setPushPermissionCallback((permission){
});
It is possible to define callbacks that are called when a notification is either received and/or clicked:
FlowsenseFlutterPlugin.shared.setPushReceivedCallback((notification){
});
FlowsenseFlutterPlugin.shared.setPushClickedCallback((notification){
});