react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

React Native 0.70.1 with Firebase latest, cannot run pod update

Open Bayramito opened this issue 1 year ago • 6 comments

Description: on new project with react-native 0.70.1 i cannot run pod update after upgrading Firebase 9.6.0/latest Ekran Resmi 2022-09-19 18 26 29

Environment

  1. "react-native-onesignal": "^4.4.1",
  2. npm

Steps to Reproduce Issue:

  1. Install react native via npx react-native init testproject 2.. install Firebase via npm install --save @react-native-firebase/app
  2. install onesignal via npm install --save react-native-onesignal

Bayramito avatar Sep 19 '22 15:09 Bayramito

same problem. When I use use_frameworks! in podfile, this error appears.

target 'OneSignalNotificationServiceExtension' do
  use_frameworks!
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
end

Enviroment "react": "18.0.0" "react-native": "^0.69.5" "@react-native-firebase/analytics": "^15.6.0" "@react-native-firebase/app": "^15.6.0"

patricpfranca avatar Sep 23 '22 17:09 patricpfranca

My quick solution was downgrade to 14.11 untill firebase gets stable

Bayramito avatar Sep 23 '22 17:09 Bayramito

Hi Guys, I step into this same error and fixed it replacing

target 'OneSignalNotificationServiceExtension' do
    pod 'OneSignal', '>= 3.0', '< 4.0'
end

with:

target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignalXCFramework', '>= 3.11.1', '< 4.0'
end

in my Podfile. Hope this helps.

fedenelli avatar Sep 26 '22 19:09 fedenelli

Hi everyone, thanks for your patience!

It sounds like @patricpfranca is using version 15.6.0 of Firebase. Is that the case with everyone else?

Please share the full podfile and the exact versions of firebase you are using. That will help us look into this.

jennantilla avatar Oct 31 '22 23:10 jennantilla

Beginning with firebase-ios-sdk v9+ (react-native-firebase v15+) you must tell CocoaPods to use frameworks.

So we cannot work with firebase and one signal, so I am choosing firebase for now.

maoryadin avatar Nov 23 '22 09:11 maoryadin

The incompatibility with firebase comes from firebase forcing this in the Podfile

use_frameworks! :linkage => :static

To get one signal to work along with firebase latest version, you need to also add this to the OneSignal target:

target 'OneSignalNotificationServiceExtension' do
  use_frameworks! :linkage => :static
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
end

then npx pod-install

Note that use_frameworks! alone will not work.

Tested with react-native-firebase 17.5.0, react-native 0.71.8 and react-native-onesignal 4.5.1.

Should maybe be added to the documentation as a lot of app are using firebase.

alwex avatar May 28 '23 05:05 alwex