Configure Marketing Cloud Engagement
Runtime Toggles
Set the Event Delegate
Track View States
Prevent or Delay Display
Customize Fonts
Configure Push Permission Authorization
Event Tracking
Handle URLs
Data Protection and Privacy
Changelog
Track when in-app messages are opened and closed by implementing delegate methods. These methods notify your app when an in-app message appears or closes. Use this information to manage the view hierarchy for your app and to respond to lifecycle events.
In-app messages are shown as the top view controller in the hierarchy of your app. Use these delegate methods to:
Use this code to track message view states in version 11 of the SDK for iOS.
The SDK supports the didShow and didClose methods.
1func didShow(inAppMessage message: InAppMessageDetails) {
2 // message shown
3}
4
5func didClose(inAppMessage message: InAppMessageDetails, action: InAppMessageCloseAction) {
6 // message closed
7}Use this code to track message view states in version 10 or lower of the SDK for iOS.
1func sfmc_didShow(inAppMessage message: [AnyHashable : Any]) {
2 // message shown
3}
4
5func sfmc_didClose(inAppMessage message: [AnyHashable : Any]) {
6 // message closed
7}