In-app message is a banner that can be displayed when your app is running. It may have various layout variants, because it is fully customizable by HTML. The campaign is triggered and displayed depending on the configuration settings.
publicstaticOnInAppListenerNULL=newOnInAppListener(){// This method is called after an in-app message is loaded and Synerise SDK asks for permission to show it.
@OverridepublicbooleanshouldShow(InAppMessageDatainAppMessageData){returntrue;}// This method is called after an in-app message appears.
@OverridepublicvoidonShown(InAppMessageDatainAppMessageData){//...
}// This method is called after an in-app message disappears.
@OverridepublicvoidonDismissed(InAppMessageDatainAppMessageData){//...
}// This method is called when a individual context for an in-app message is needed.
@OverridepublicHashMap<String,Object>onContextFromAppRequired(InAppMessageDatainAppMessageData){returnnewHashMap<>();}// This method is called when Synerise handles URL action from in-app messages.
@OverridepublicvoidonHandledOpenUrl(InAppMessageDatainAppMessageData){//...
}// This method is called when Synerise handles deeplink action from in-app messages.
@OverridepublicvoidonHandledOpenDeepLink(InAppMessageDatainAppMessageData){//...
}// This method is called when a custom action is handled from the in-app messages.
@OverridepublicvoidonCustomAction(Stringidentifier,HashMap<String,Object>params,InAppMessageDatainAppMessageData){//...
}};
varinAppCallbacks:OnInAppListener=object: OnInAppListener(){// This method is called after an in-app message is loaded and Synerise SDK asks for permission to show it.
overridefunshouldShow(inAppMessageData:InAppMessageData):Boolean{returntrue}// This method is called after an in-app message appears.
overridefunonShown(inAppMessageData:InAppMessageData){//...
}// This method is called after an in-app message disappears.
overridefunonDismissed(inAppMessageData:InAppMessageData){//...
}// This method is called when a individual context for an in-app message is needed.
overridefunonContextFromAppRequired(inAppMessageData:InAppMessageData):HashMap<String,Any>{returnHashMap()}// This method is called when Synerise handles URL action from in-app messages.
overridefunonHandledOpenUrl(inAppMessageData:InAppMessageData){//...
}// This method is called when Synerise handles deeplink action from in-app messages.
overridefunonHandledOpenDeepLink(inAppMessageData:InAppMessageData){//...
}// This method is called when a custom action is handled from the in-app messages.
overridefunonCustomAction(identifier:String?,params:HashMap<String?,Any?>?,inAppMessageData:InAppMessageData?){//...
}}
// MARK: - InjectorInAppMessageDelegate// This method is called after an in-app message is loaded and Synerise SDK asks for permission to show it.funcsnr_shouldInAppMessageAppear(data:InAppMessageData)->Bool{returntrue}// This method is called after an in-app message appears.funcsnr_inAppMessageDidAppear(data:InAppMessageData){//...}// This method is called after an in-app message disappears.funcsnr_inAppMessageDidDisappear(data:InAppMessageData){//...}// This method is called when an in-app message changes size.funcsnr_inAppMessageDidChangeSize(rect:CGRect){//...}// This method is called when a individual context for an in-app message is needed.funcsnr_inAppMessageContextIsNeeded(data:InAppMessageData)->[AnyHashable:Any]?{return[]}// This method is called when Synerise handles URL action from in-app messages.funcsnr_inAppMessageHandledAction(data:InAppMessageData,url:URL){//...}// This method is called when Synerise handles deeplink action from in-app messages.funcsnr_inAppMessageHandledAction(data:InAppMessageData,deeplink:String){//...}// This method is called when a custom action is handled from the in-app messages.funcsnr_inAppMessageHandledCustomAction(data:InAppMessageData,name:String,parameters:[AnyHashable:Any]){//...}
#pragma mark - SNRInjectorInAppMessageDelegate
// This method is called after an in-app message is loaded and Synerise SDK asks for permission to show it.
-(BOOL)SNR_shouldInAppMessageAppear:(SNRInAppMessageData*)data{//...
}// This method is called after an in-app message appears.
-(void)SNR_inAppMessageDidAppear:(SNRInAppMessageData*)data{//...
}// This method is called after an in-app message disappears.
-(void)SNR_inAppMessageDidDisappear:(SNRInAppMessageData*)data{//...
}// This method is called when an in-app message changes size.
-(void)SNR_inAppMessageDidChangeSize:(CGRect)rect{//...
}// This method is called when a individual context for an in-app message is needed.
-(nullableNSDictionary*)SNR_inAppMessageContextIsNeeded:(SNRInAppMessageData*)data{//...
}// This method is called when Synerise handles URL action from in-app messages.
-(void)SNR_inAppMessageHandledURLAction:(SNRInAppMessageData*)dataurl:(NSURL*)url{//...
}// This method is called when Synerise handles deeplink action from in-app messages.
-(void)SNR_inAppMessageHandledDeeplinkAction:(SNRInAppMessageData*)datadeeplink:(NSString*)deeplink{//...
}// This method is called when a custom action is handled from the in-app messages.
-(void)SNR_inAppMessageHandledCustomAction:(SNRInAppMessageData*)dataname:(NSString*)nameparameters:(NSDictionary*)parameters{//...
}
Synerise.injector.inAppMessageListener((listener){// This method is called after an in-app message appears.
listener.onPresent=(data){//...
};// This method is called after an in-app message disappears.
listener.onHide=(data){//...
};// This method is called when Synerise handles URL action from in-app messages.
listener.onOpenUrl=(data,url){//...
};// This method is called when Synerise handles deeplink action from in-app messages.
listener.onDeepLink=(data,deepLink){//...
};// This method is called when Synerise handles custom action from in-app messages.
listener.onCustomAction(data,name,parameters){//...
};});
Did this article answer your question?
😕
We are sorry to hear that
Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.
😉
Awesome!
Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.