wix / react-native-notifications

React Native Notifications
MIT License
3.23k stars 763 forks source link

react-native 0.70.* - iOS build failed : use of undeclared identifier 'RNNotifications' #903

Closed seb-montana closed 1 year ago

seb-montana commented 1 year ago

Hi,

I've make all instructions from Getting Started and when I launch $npx react-native run-ios I get this error :

error: use of undeclared identifier 'RNNotifications'
  [RNNotifications didReceiveBackgroundNotification:userInfo withCompletionHandler:completionHandler];

NTE : cd ios/ && pod install is ok

This error occur in blank react-native project with this configuration :

System:
    OS: macOS 12.6
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 16.49 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 18.6.0 - ~/.nvm/versions/node/v18.6.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.13.2 - ~/.nvm/versions/node/v18.6.0/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9014738
    Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0
    react-native: 0.70.2 => 0.70.2
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
seb-montana commented 1 year ago

Sorry, it was a wrong import order in my AppDelegate.mm.

ManAnRuck commented 1 year ago

😅 same issue

same solution.

Move import outside of

#import "RNNotifications.h"
#if RCT_NEW_ARCH_ENABLED`
…
#endif