💡
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. Flutter SDK

iOS Setup

PreviousAndroid SetupNextRich Notifications

Last updated 4 years ago

Was this helpful?

The first thing you have to do is to setup the iOS project is to enable the push notification capability to your project. Open the project in Xcode going in ios -> Runner.xcworkspace, then in the Signing & Capabilities tab click on the + Capability button and select "Push Notifications"

You will have to use a provisoning profile created for this app, you will not be able to test and receive push notification using a wildcard provisioning profile.

Then yu have to modify the AppDelegate class of your application, open AppDelegate.swift file and add this line in the didFinishLaunchingWithOptions function.

UNUserNotificationCenter.current().delegate = self

The app delegate should look like this.

import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    UNUserNotificationCenter.current().delegate = self
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}
🔷
Enable push notifications capability