plugin_screeb 0.0.4 plugin_screeb: ^0.0.4 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.
Getting Started #
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|
...
target.build_configurations.each do |config|
...
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
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 #
PluginScreeb.initSdk("<android-channel-id", "<ios-channel-id");
SetIdentity command #
PluginScreeb.setIdentity("userId");
SendTrackingEvent command #
// Event example without properties
PluginScreeb.sendTrackingEvent("eventId");
// Event example with properties
PluginScreeb.sendTrackingEvent("eventId", <String, dynamic>{
'isConnected': true,
'age': 27,
'company' : 'Screeb',
'technology' : 'iOS',
'flutterAccount' : true
});
SendTrackingScreen command #
// Screen event example without properties
PluginScreeb.sendTrackingScreen("screen_name");
// Screen event example with properties
PluginScreeb.sendTrackingScreen("screen_name", <String, dynamic>{
'isConnected': true,
'age': 27,
'company' : 'Screeb',
'technology' : 'iOS',
'flutterAccount' : true
});
VisitorProperty command #
// VisitorProperty example
PluginScreeb.visitorProperty("screen_name", <String, dynamic>{
'isConnected': true,
'age': 27,
'company' : 'Screeb',
'technology' : 'iOS',
'flutterAccount' : true
});