plugin_screeb 0.0.13 plugin_screeb: ^0.0.13 copied to clipboard
A flutter plugin to integrate Screeb mobile sdk for Android and/or iOS.
Screeb flutter plugin #
A flutter plugin to integrate Screeb mobile sdk for Android and/or iOS.
Configuration #
iOS specific configuration #
You should set IOS target build configuration BUILD_LIBRARY_FOR_DISTRIBUTION
to YES
in your Podfile
to avoid runtime crash:
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
When upgrading a Screeb plugin version, it can be useful to run in /ios directory :
pod update Screeb
Android specific configuration #
The Android sdk needs to be notified of activities lifecycle changes to be correctly started.
It is mandatory to pass the Application context to the plugin in your custom Application class
in the onCreate
function :
override fun onCreate() {
super.onCreate()
PluginScreebPlugin.setAppContext(this)
}
Usage #
Several commands are available in Screeb flutter plugin api :
initSdk command #
// Simple init command with no additionnal parameters
PluginScreeb.initSdk("<android-channel-id>", "<ios-channel-id>", null);
// Init command with identity and properties parameters
PluginScreeb.initSdk("<android-channel-id>", "<ios-channel-id>", "identity", <String, dynamic>{
'isConnected': true,
'age': 27,
'company' : 'Screeb',
'technology' : 'iOS',
'flutterAccount' : true
});
setIdentity command #
// Identity example without properties
PluginScreeb.setIdentity("userId");
// Identity example with properties
PluginScreeb.setIdentity("userId", <String, dynamic>{
'isConnected': true,
'age': 27,
'company' : 'Screeb',
'technology' : 'iOS',
'flutterAccount' : true
});
trackEvent command #
// Event example without properties
PluginScreeb.trackEvent("eventId");
// Event example with properties
PluginScreeb.trackEvent("eventId", <String, dynamic>{
'isConnected': true,
'age': 27,
'company' : 'Screeb',
'technology' : 'iOS',
'flutterAccount' : true
});
trackScreen command #
// Screen event example without properties
PluginScreeb.trackScreen("screen_name");
// Screen event example with properties
PluginScreeb.trackScreen("screen_name", <String, dynamic>{
'isConnected': true,
'age': 27,
'company' : 'Screeb',
'technology' : 'iOS',
'flutterAccount' : true
});
setProperty command #
// VisitorProperty example
PluginScreeb.setProperty(<String, dynamic>{
'isConnected': true,
'age': 27,
'company' : 'Screeb',
'technology' : 'iOS',
'flutterAccount' : true
});