Integrate MPush
To integrate MPush to your implementation you need to add this in your AppDelegate
1
import MPushSwift
2
​
3
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
4
...
5
MPush.token = "YOUR_PUSH_TOKEN"
6
...
7
}
8
​
9
...
10
​
11
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
12
MPush.registerDevice(deviceToken: deviceToken, success: {
13
MPush.register(toTopic: "YOUR_TOPIC")
14
// OR if you have more than one topic
15
// MPush.register(toTopics: ["TOPIC1", "TOPIC2"])
16
})
17
}
Copied!
You're set πŸŽ‰, the device will receive notifications for the topic is registered to.
Last modified 1yr ago
Copy link