-
Notifications
You must be signed in to change notification settings - Fork 21
How to display modal mirror push notification manually
Alexander Boldyrev edited this page Oct 31, 2024
·
1 revision
Supported on iOS since version 9.1.0
-
Disable automatic modal Mirror push notification displaying:
- Implement
MMMessageHandlingDelegate
protocol and returnfalse
from its methodshouldShowModalInAppNotification(for message: MM_MTMessage)
:
class MyMessageHandlingDelegate : MMMessageHandlingDelegate { func shouldShowModalInAppNotification(for message: MM_MTMessage) -> Bool { return false } }
- Pass the delegate object to MobileMessaging SDK:
let messageHandler = MyMessageHandlingDelegate() MobileMessaging.messageHandlindDelegate = messageHandler
- Implement
-
At the moment
MM_MTMessage
is received by your app, retrieve it either of the following ways:- by implementing
MMMessageHandlingDelegate
protocol methoddidReceiveNewMessage(message: MM_MTMessage)
class MyMessageHandlingDelegate : MMMessageHandlingDelegate { func didReceiveNewMessage(message: MM_MTMessage) { // save `message` into your variable } }
- by subscribing to
MMNotificationMessageReceived
notification (learn more about iOS NotificationCenter) and retrieving the message from the notification user data (example)
- by implementing
-
Display modal Mirror push notification for message you retrieved on the previous step:
MobileMessaging.showModalInAppNotification(forMessage: message)
If you have any questions or suggestions, feel free to send an email to [email protected] or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
- Geofencing service
- Privacy settings
- In-app chat
- WebRTC Calls and UI