> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Avoid Common Push Notification Issues on iOS Devices Using Flutter, Swift, and MoEngage-iOS-SDK (Versions 7.x.x , 8.x.x, 9.x.x)?

> Resolve push notification issues on iOS with Flutter and Swift. Covers Firebase proxy settings, deep linking, and MoEngage SDK setup steps.

## Problem

Common issues with Push notifications, including failed delivery, screen navigation, deep linking, and rich landing, are occurring on iOS devices using Flutter, Swift, and MoEngage-iOS-SDK (Versions 7.x.x, 8.x.x, 9.x.x).

## Solution

Perform the following steps:

1. **Firebase Proxy**:
   * If you are not using Firebase push notifications, then disable the Firebase proxy by adding the FirebaseAppDelegateProxyEnabled key in info.plist with the value Boolean = False/NO.
   * Test the push notification. If successful, no further action is required. Otherwise, follow the steps below.
   * If you are using Firebase push notifications, skip this step and proceed with the following steps.
2. **Disable MoEngage Proxy**:
   * Add MoEngageAppDelegateProxyEnabled key in info.plist with the value Boolean = false/NO
     <img src="https://mintcdn.com/moengage/2FjM3dGfEH1CYo8k/images/moengage_6550ce.png?fit=max&auto=format&n=2FjM3dGfEH1CYo8k&q=85&s=240add700575e9c1980eb55215eda271" alt="boolean.png" width="1958" height="570" data-path="images/moengage_6550ce.png" />
3. **Override didRegisterForRemoteNotificationsWithDeviceToken Function**:
   * Override the didRegisterForRemoteNotificationsWithDeviceToken function of the AppDelegate.m file.
     ```swift Swift theme={null}
     override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
       super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
       //7.xx version
       MoEngage.sharedInstance().setPushToken(deviceToken)
       //8.xx version
       MOMessaging.sharedInstance.setPushToken(deviceToken)
       //9.xx version
       MoEngageSDKMessaging.sharedInstance.setPushToken(deviceToken)
     }
     ```
4. **Override UNUserNotificatoinCenterDelegate Functions**:
   * Override the UNUserNotificatoinCenterDelegate functions in the AppDelegate.m file.
     ```swift Swift wrap theme={null}
     //Try without willPresent if it works good to go! else override it
     override func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) - Void) {
       if #available(iOS 14.0, *) {
         completionHandler([.sound,.alert, .banner, .list])
       } else {
         completionHandler([.sound,.alert])
       }
     }
         
     override func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () - Void) {
       super.userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler)
       //7.xx version
       MoEngage.sharedInstance().userNotificationCenter(center, didReceive: response)
       
       //8.xx version
       MOMessaging.sharedInstance.userNotificationCenter(center, didReceive: response)
       
       //9.xx version
       MoEngageSDKMessaging.sharedInstance.userNotificationCenter(center, didReceive: response)        
     }
     ```
