💡
MPush
  • 💡MPush Documentation 💡
  • 🔑 API
    • Introduction
    • Authentication
    • Send Notifications
    • Topics
  • 🍏 iOS SDK
    • Introduction
    • Installation
    • Add Push Notification to your app
    • Integrate MPush
    • Rich Notifications
  • 📱 Android SDK
    • Introduction
    • Setup
    • Register a device
    • Subscribe to topics
  • 🔷Flutter SDK
    • Introduction
    • Installation
    • Android Setup
    • iOS Setup
      • Rich Notifications
      • Custom replacements
    • Flutter Setup
    • Request a token
    • Register to topics
    • Launch notification
Powered by GitBook
On this page

Was this helpful?

  1. iOS SDK

Integrate MPush

To integrate MPush to your implementation you need to add this in your AppDelegate

import MPushSwift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    ...
    MPush.token = "YOUR_PUSH_TOKEN"
    ...
}

...

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    MPush.registerDevice(deviceToken: deviceToken, success: {
        MPush.register(toTopic: "YOUR_TOPIC")
        // OR if you have more than one topic
        // MPush.register(toTopics: ["TOPIC1", "TOPIC2"])
    })
}

You're set 🎉, the device will receive notifications for the topic is registered to.

PreviousAdd Push Notification to your appNextRich Notifications

Last updated 4 years ago

Was this helpful?

🍏