Skip to content

How to handle a message when user opens the app by tapping on a notification alert?

Olga Koroleva edited this page Apr 10, 2017 · 8 revisions

Mobile Messaging SDK has notificationTapHandler closure that takes as parameter MTMessage object. This closure will be executed when user opens the app by tapping on the notification alert. Default implementation marks the corresponding message as seen.

Default implementation can be substituted with custom implementation:

MobileMessaging.notificationTapHandler = { message in
	NSLog("Message with text: \(message.text) was tapped")
        ...
}
Clone this wiki locally