Appearance
Activity Delegates
When an activity is requested by your app, various events are invoked on the app during the "activity life-cycle". These delegate methods and event listeners allow you to handle different stages of activity presentation and user interactions.
Overview
Activity delegates provide callbacks for:
- Activity Presentation: When an activity is displayed to the user
- Activity Skip: When users interact with Skip
- Activity Completion: When an activity is completed or dismissed
- Deep Link Handling: When activities contain deep link data
- Error Handling: When errors occur during activity lifecycle
Activity Event Listeners
Add the following event listeners to your JavaScript code to get the state and deep link data of an Activity. The main event listeners are: UpshotActivityDidAppear
, UpshotActivityDidDismiss
, UpshotActivitySkip
, UpshotActivityError
, and UpshotDeepLink
.
dart
static const _channel = MethodChannel('flutter_upshot_plugin');
UpshotMethodChannel() {
_channel.setMethodCallHandler (_methodCallHandler);
}
Future <dynamic>_methodCallHandler(MethodCall call) async {
if (call.method == 'upshotActivityDeeplink ') {
//Triggered when Action contains deeplink
Map data = call.arguments as Map;
}
else if (call.method == 'upshotActivityDidAppear ') {
//Triggered when action presents
Map data = call.arguments as Map;
}
else if (call.method == 'upshotActivityDidDismiss ') {
//Triggered when action dismiss
Map data = call.arguments as Map;
}
else if (call.method == 'upshotActivitySkip ') {
//Triggered when action dismiss
Map data = call.arguments as Map;
}
}