Push notifications
With this plugin you can also manage the push notification section of MBurger, this is a wrapper around MPush, the underlying platform, so you should refer to the MPush documentation to understand the concepts and to start the push integration. In order to use MBMessagesSwift
instead of MPushSwift
you have to do the following changes:
Set the push token like this:
And then register your device to topics (all the other function have a similar syntax change):
MBurger has 2 default topics that you should use in order to guarantee the correct functtionality of the engagement platform:
MBMessages.projectPushTopic
: this topic represents all devices registred to push notifications for this projectMBMessages.devicePushTopic
: this topic represents the current device
MBPTopic additional parameters
When creating topic you can specify additional parameters:
title
: a title fot that topic that will be displayed in the dashboard, if not specified it has the same value as the topic idsingle
: If the topic identify a single user or a group of users, defaults tofalse
User interaction with a push
With MBMessagesSwift
you can setup a callback that will be called when the user interacts with a push notification or opens the app from a push. You can setup the code like this, the payload variable will be the payload of the push:
In order to this to function you will have to tell MBMessagesSwift
that a notification has arrived so you need to add this in those lines in your UNUserNotificationCenterDelegate
class, often the AppDelegate
.
Last updated