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 Delegates
When an activity is requested by your app, various events are invoked on the app during the "activity life-cycle". These delegate methods 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 Delegate Methods
Implement the following delegate methods in your iOS application to handle activity lifecycle events:
objective-c
@import Upshot;
// Set up delegate
[[Brandkinesis sharedInstance] setActivityDelegate:self];
- (void)brandkinesisErrorLoadingActivity:(BrandKinesis * )brandkinesis withError:(NSError * )error {
//Delegate will be invoked incase of no ativity matched with the given request
}
- (void)brandkinesisActivityWillAppear:(BrandKinesis * )brandkinesis forActivityType:(BKActivityType )activityType {
//Delegate method will be invoked on Upshot.ai action about to present
}
- (void)brandKinesisActivityDidAppear:(BrandKinesis * )brandkinesis forActivityType:(BKActivityType )activityType {
//Delegate method will be invoked on Upshot.ai action present
}
- (void)brandKinesisActivitySkipped:(BrandKinesis * )brandkinesis forActivityType:(BKActivityType )activityType {
//Delegate method will be invoked on Upshot.ai action skipped
}
- (void)brandKinesisActivityDidDismiss:(BrandKinesis * )brandkinesis forActivityType:(BKActivityType )activityType {
//Delegate method will be invoked on Upshot.ai action dismiss
}
- (void)brandKinesisActivity:(BKActivityType)activityType performedActionWithParams:(NSDictionary * )params {
//Delegate methos will be invoked incase of action contains deeplink
}
- (void)brandkinesisCampaignDetailsLoaded() {
//Delegate methos will be invoked whenever campaign details loaded
}
- (void)brandKinesisOnPushClickInfo:(NSDictionary *)payload {
//Delegate methos will be invoked when push click has deeplink
}
swift
import Upshot
// Set up delegate
Brandkinesis.sharedInstance().setActivityDelegate(self)
// MARK: - UpshotActivityDelegate Methods
extension YourViewController: BrandKinesisDelegate {
// Activity Did Appear Delegate Method
func brandkinesisErrorLoadingActivity(_ brandkinesis:BrandKinesis, withError error:Error?) {
//Delegate will be invoked incase of no ativity matched with the given request
}
func brandkinesisActivityWillAppear(_ brandkinesis:BrandKinesis, for activityType:BKActivityType) {
//Delegate method will be invoked on Upshot.ai action about to present
}
func brandKinesisActivityDidAppear(_ brandkinesis:BrandKinesis, for activityType:BKActivityType) {
//Delegate method will be invoked on Upshot.ai action present
}
func brandKinesisActivitySkipped(_ brandkinesis:BrandKinesis, for activityType:BKActivityType) {
//Delegate method will be invoked on Upshot.ai action Skipped
}
func brandKinesisActivityDidDismiss(_ brandkinesis:BrandKinesis, for activityType:BKActivityType) {
//Delegate method will be invoked on Upshot.ai action dismiss
}
func brandKinesisActivity(_ activityType:BKActivityType, performedActionWithParams params:[AnyHashable : Any]) {
//Delegate methos will be invoked incase of action contains deeplink
}
func brandkinesisCampaignDetailsLoaded() {
//Delegate methos will be invoked whenever campaign details loaded
}
func brandKinesisOnPushClickInfo(_ payload: [AnyHashable : Any]) {
//Delegate methos will be invoked caurosel push click has deeplink
}
}