title: IOS push notifications not working on react native using firebase and react-native-push-notifications
body: <p>So i have tried to receive push notifications from firebase and react-native-push-notifications.<a href="https://github.com/zo0r/react-native-push-notification" rel="noreferrer">react-native-push-notifications</a>
  on android its work perfect.</p>
  <p>my problem is only on IOS.
  i have follow the <a href="https://github.com/react-native-community/push-notification-ios" rel="noreferrer">push-notification-ios</a> installation with no result.</p>
  <p>package.json :</p>
  <pre><code>{
    &quot;name&quot;: &quot;app&quot;,
    &quot;version&quot;: &quot;0.0.1&quot;,
    &quot;private&quot;: true,
    &quot;scripts&quot;: {
      &quot;android&quot;: &quot;react-native run-android&quot;,
      &quot;ios&quot;: &quot;react-native run-ios&quot;,
      &quot;start&quot;: &quot;react-native start&quot;,
      &quot;test&quot;: &quot;jest&quot;,
      &quot;lint&quot;: &quot;eslint .&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@react-native-community/push-notification-ios&quot;: &quot;^1.4.0&quot;,
      &quot;@react-native-community/toolbar-android&quot;: &quot;^0.1.0-rc.2&quot;,
      &quot;@react-native-firebase/app&quot;: &quot;^8.3.1&quot;,
      &quot;@react-native-firebase/messaging&quot;: &quot;^7.7.2&quot;,
      &quot;axios&quot;: &quot;^0.19.2&quot;,
      &quot;react&quot;: &quot;16.13.1&quot;,
      &quot;react-native&quot;: &quot;0.63.2&quot;,
      &quot;react-native-document-picker&quot;: &quot;^3.5.4&quot;,
      &quot;react-native-image-crop-picker&quot;: &quot;^0.32.2&quot;,
      &quot;react-native-image-picker&quot;: &quot;2.3.1&quot;,
      &quot;react-native-mail&quot;: &quot;^5.0.1&quot;,
      &quot;react-native-permissions&quot;: &quot;^2.1.5&quot;,
      &quot;react-native-push-notification&quot;: &quot;^5.0.1&quot;,
      &quot;react-native-restart&quot;: &quot;^0.0.17&quot;,
      &quot;react-native-vector-icons&quot;: &quot;^7.0.0&quot;,
      &quot;react-native-webview&quot;: &quot;^10.4.0&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/core&quot;: &quot;^7.11.1&quot;,
      &quot;@babel/runtime&quot;: &quot;^7.11.2&quot;,
      &quot;@react-native-community/eslint-config&quot;: &quot;^2.0.0&quot;,
      &quot;babel-jest&quot;: &quot;^26.2.2&quot;,
      &quot;eslint&quot;: &quot;^7.6.0&quot;,
      &quot;jest&quot;: &quot;^26.2.2&quot;,
      &quot;metro-react-native-babel-preset&quot;: &quot;^0.61.0&quot;,
      &quot;react-test-renderer&quot;: &quot;16.13.1&quot;
    },
    &quot;jest&quot;: {
      &quot;preset&quot;: &quot;react-native&quot;
    }
  }
  
  </code></pre>
  <p>appDelegate.m :</p>
  <pre><code>    #import &lt;UserNotifications/UserNotifications.h&gt;
  #import &quot;AppDelegate.h&quot;
  #import &lt;React/RCTBridge.h&gt;
  #import &lt;React/RCTBundleURLProvider.h&gt;
  #import &lt;React/RCTRootView.h&gt;
  #import &lt;Firebase.h&gt;
  #import &lt;RNCPushNotificationIOS.h&gt;
  
  
  
  #ifdef FB_SONARKIT_ENABLED
  #import &lt;FlipperKit/FlipperClient.h&gt;
  #import &lt;FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h&gt;
  #import &lt;FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h&gt;
  #import &lt;FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h&gt;
  #import &lt;SKIOSNetworkPlugin/SKIOSNetworkAdapter.h&gt;
  #import &lt;FlipperKitReactPlugin/FlipperKitReactPlugin.h&gt;
  
  static void InitializeFlipper(UIApplication *application) {
    FlipperClient *client = [FlipperClient sharedClient];
    SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
    [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
    [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
    [client addPlugin:[FlipperKitReactPlugin new]];
    [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
    [client start];
  }
  #endif
  
  @implementation AppDelegate
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
    
    
  #ifdef FB_SONARKIT_ENABLED
    InitializeFlipper(application);
  #endif
  
    
   
    
      [FIRApp configure];
    RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
    RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                     moduleName:@&quot;NewSderotNet&quot;
                                              initialProperties:nil];
  
    rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    UIViewController *rootViewController = [UIViewController new];
    rootViewController.view = rootView;
    self.window.rootViewController = rootViewController;
    [self.window makeKeyAndVisible];
    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
     center.delegate = self;
    return YES;
  }
  - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
  {
   [RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings];
  }
  // Required for the register event.
  - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
  {
   [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
  }
  // Required for the notification event. You must call the completion handler after handling the remote notification.
  - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
  fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
  {
    [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
  }
  // Required for the registrationError event.
  - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
  {
   [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
  }
  // IOS 10+ Required for localNotification event
  - (void)userNotificationCenter:(UNUserNotificationCenter *)center
  didReceiveNotificationResponse:(UNNotificationResponse *)response
           withCompletionHandler:(void (^)(void))completionHandler
  {
    [RNCPushNotificationIOS didReceiveNotificationResponse:response];
    completionHandler();
  }
  // IOS 4-10 Required for the localNotification event.
  - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
  {
   [RNCPushNotificationIOS didReceiveLocalNotification:notification];
  }
  -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
  {
    completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
  }
  
  
  
  
  - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
  {
  #if DEBUG
    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@&quot;index&quot; fallbackResource:nil];
  #else
    return [[NSBundle mainBundle] URLForResource:@&quot;main&quot; withExtension:@&quot;jsbundle&quot;];
  #endif
  }
  
  @end
  </code></pre>
  <p>appDelegate.h :</p>
  <pre><code>#import &lt;React/RCTBridgeDelegate.h&gt;
  #import &lt;UIKit/UIKit.h&gt;
  #import &lt;UserNotifications/UNUserNotificationCenter.h&gt;
  
  @interface AppDelegate : UIResponder &lt;UIApplicationDelegate, RCTBridgeDelegate,UNUserNotificationCenterDelegate&gt;
  
  @property (nonatomic, strong) UIWindow *window;
  
  @end
  
  </code></pre>
  <p>info.plist:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
  &lt;plist version=&quot;1.0&quot;&gt;
  &lt;dict&gt;
      &lt;key&gt;FirebaseAppDelegateProxyEnabled&lt;/key&gt;
      &lt;false/&gt;
      &lt;key&gt;BGTaskSchedulerPermittedIdentifiers&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;co.il.feed-b.FeedBack&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;CFBundleDevelopmentRegion&lt;/key&gt;
      &lt;string&gt;en&lt;/string&gt;
      &lt;key&gt;CFBundleDisplayName&lt;/key&gt;
      &lt;string&gt;appName&lt;/string&gt;
      &lt;key&gt;CFBundleExecutable&lt;/key&gt;
      &lt;string&gt;$(EXECUTABLE_NAME)&lt;/string&gt;
      &lt;key&gt;CFBundleIdentifier&lt;/key&gt;
      &lt;string&gt;$(PRODUCT_BUNDLE_IDENTIFIER)&lt;/string&gt;
      &lt;key&gt;CFBundleInfoDictionaryVersion&lt;/key&gt;
      &lt;string&gt;6.0&lt;/string&gt;
      &lt;key&gt;CFBundleName&lt;/key&gt;
      &lt;string&gt;$(PRODUCT_NAME)&lt;/string&gt;
      &lt;key&gt;CFBundlePackageType&lt;/key&gt;
      &lt;string&gt;APPL&lt;/string&gt;
      &lt;key&gt;CFBundleShortVersionString&lt;/key&gt;
      &lt;string&gt;$(MARKETING_VERSION)&lt;/string&gt;
      &lt;key&gt;CFBundleSignature&lt;/key&gt;
      &lt;string&gt;????&lt;/string&gt;
      &lt;key&gt;CFBundleVersion&lt;/key&gt;
      &lt;string&gt;$(CURRENT_PROJECT_VERSION)&lt;/string&gt;
      &lt;key&gt;LSRequiresIPhoneOS&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;NSExceptionDomains&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;localhost&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;NSExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
                  &lt;true/&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
      &lt;key&gt;NSAppleMusicUsageDescription&lt;/key&gt;
      &lt;string&gt;acess&lt;/string&gt;
      &lt;key&gt;NSCameraUsageDescription&lt;/key&gt;
      &lt;string&gt;access&lt;/string&gt;
      &lt;key&gt;NSLocationWhenInUseUsageDescription&lt;/key&gt;
      &lt;string&gt;&lt;/string&gt;
      &lt;key&gt;NSPhotoLibraryUsageDescription&lt;/key&gt;
      &lt;string&gt;access&lt;/string&gt;
      &lt;key&gt;UIAppFonts&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;AntDesign.ttf&lt;/string&gt;
          &lt;string&gt;Entypo.ttf&lt;/string&gt;
          &lt;string&gt;EvilIcons.ttf&lt;/string&gt;
          &lt;string&gt;Feather.ttf&lt;/string&gt;
          &lt;string&gt;FontAwesome.ttf&lt;/string&gt;
          &lt;string&gt;FontAwesome5_Brands.ttf&lt;/string&gt;
          &lt;string&gt;FontAwesome5_Regular.ttf&lt;/string&gt;
          &lt;string&gt;FontAwesome5_Solid.ttf&lt;/string&gt;
          &lt;string&gt;Foundation.ttf&lt;/string&gt;
          &lt;string&gt;Ionicons.ttf&lt;/string&gt;
          &lt;string&gt;MaterialIcons.ttf&lt;/string&gt;
          &lt;string&gt;MaterialCommunityIcons.ttf&lt;/string&gt;
          &lt;string&gt;SimpleLineIcons.ttf&lt;/string&gt;
          &lt;string&gt;Octicons.ttf&lt;/string&gt;
          &lt;string&gt;Zocial.ttf&lt;/string&gt;
          &lt;string&gt;Fontisto.ttf&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;UIBackgroundModes&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;fetch&lt;/string&gt;
          &lt;string&gt;remote-notification&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;UILaunchStoryboardName&lt;/key&gt;
      &lt;string&gt;LaunchScreen&lt;/string&gt;
      &lt;key&gt;UIRequiredDeviceCapabilities&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;armv7&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;UIRequiresFullScreen&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;UISupportedInterfaceOrientations&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;UIInterfaceOrientationPortrait&lt;/string&gt;
          &lt;string&gt;UIInterfaceOrientationLandscapeLeft&lt;/string&gt;
          &lt;string&gt;UIInterfaceOrientationLandscapeRight&lt;/string&gt;
          &lt;string&gt;UIInterfaceOrientationPortraitUpsideDown&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;UIViewControllerBasedStatusBarAppearance&lt;/key&gt;
      &lt;false/&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  
  </code></pre>
  <p>on app Identifier i have been selected push notifications and created</p>
  <ul>
  <li>Production SSL Certificate</li>
  <li>Development SSL Certificate</li>
  </ul>
  <p>also add to signing &amp; capabilities background modes :</p>
  <ul>
  <li>background fetch</li>
  <li>remote notifications</li>
  </ul>
  <p>then upload the Certificate to my firebase console and try to send push notification on real device without any event trigger and no notification is display.</p>