invertase / react-native-firebase

πŸ”₯ A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.63k stars 2.2k forks source link

✨ v6.0.0 ✨ #2025

Closed Salakar closed 4 years ago

Salakar commented 5 years ago

Hey everybody πŸ’›

Super excited to announce that we're just over halfway through our v5 -> v6 migration + overhaul, and; there are so many great things there already for you to try out. We say this every time but really; this is our 'largest release yet' xπŸ’―

So please πŸ™ check out the changelog and if all the Firebase services that you use are already listed there then you are good to migrate to the new individual npm packages. They are only released as patch versions for now until all packages are ready - at which point they'll be published as v6.0.0 - I'd recommend locking your package versions until this time.

Instructions can be found on the changelog. Please bare with us well we work towards v6, you have not been forgotten.

I will update this issue with currently being worked on modules and modules next in line, so subscribe to be notified of that and other announcements.

Blog posts about v6.0.0


React Native Firebase is built and maintained with πŸ’› by Invertase.


dcolin commented 5 years ago

@Ehesp I'm using this version and AdsConsentFormOptions does not work correctly when an option is set to false:

{
  withAdFree: false,
  withNonPersonalizedAds: true,
  withPersonalizedAds: false,
}

BTW is there a solution to translate the Google ConsentForm?

google-consentformhtml

Ehesp commented 5 years ago

@dcolin could you ping me on Discord (Alias) if possible? Would be good to investigate.

Translation wise... doesn't look like it. There's a discussion here about it.

dcolin commented 5 years ago

@Ehesp In fact, options works on Android devices! But on iOS there is always the three buttons...

I don't use Discord but what's your nickname ?

Ehesp commented 5 years ago

@dcolin ok cheers let me have a look :D

Ehesp commented 5 years ago

@dcolin fixed it. Looks like I had my JavaScript hat on when doing the ObjC code... woops! https://github.com/invertase/react-native-firebase/commit/4a8ad14ccc09c1ab5e370fe56d51aaabfe7f757e

dcolin commented 5 years ago

@Ehesp Perfect, works fine!

cmmartin commented 5 years ago

Anyone else using v6 phone auth? I just upgraded to "@react-native-firebase/auth": "^0.2.3", and I am getting the captcha every time I sign in. Normally, I'd assume an issue with my setup, but the same setup is working in v5 without a captcha. I uploaded my APNs Authentication Key to the firebase console, added the URL type and enabled push notifications in XCode.

Maybe there is an issue with silent APNS messages? Or do I need to include other modules like Cloud Messaging for Phone Auth?

michaelkowalski commented 5 years ago

@mikehardy forgive me if this is obvious but how do we actually install the version 6?

I'm having issues with firebase messaging on Android if react-native is at version 0.60.4. What worked on 59 isn't working on 0.60.4 anymore...

alexmobileinteraction commented 5 years ago

Hi! I'm trying out version 6 and the ml kit with label/text recognition. The imageLabelerProcessImage function worked great but textRecognizerProcessImage makes the app crash on ios on most images I pass to that function. Anyone else having similar issues?

Salakar commented 5 years ago

@alexmobileinteraction would you mind making a separate issue for that with the log of the crash as well, for reference, this is how we test it and currently not seeing any issues: https://github.com/invertase/react-native-firebase/blob/master/packages/ml-vision/e2e/text.e2e.js

Thanks

mikehardy commented 5 years ago

@michaelkowalski sorry - no idea :-) - I rely on the last module to be ported - messaging/notifications so I haven't touched v6 yet. You may find hints in the test application that is part of the master branch and used for the e2e testing though

pistou commented 5 years ago

I want to use BannerAd from AdMob, which is unfortunately not available on v6 yet. Is there a way to use both v5 and v6 at the same time, and pick version for each module?

Ehesp commented 5 years ago

@pistou there isn't I'm afraid. If you can wait until tomorrow, we'll get this released as it's almost ready to go.

technoplato commented 5 years ago

Hey folks,

Great work, love the project. I'm considering upgrading because i want to use Firestore's collectionGroup which appears to require react-native-firebase 6. It seems unlikely i could upgrade only firestore and continue using the rest of the rnf5 modules my code relies on. Can i pick and choose which modules i upgrade? Or i need to do a wholesale upgrade to 6?

You can use the vanilla js Firebase package simultaneously with RNF. I tried for the exact same reason as you (for collectionGroups) and all you have to do is manually initialize firebase. Then, once v6 is completely ready, you can remove the firebase js module and upgrade everything to v6.

pistou commented 5 years ago

@pistou there isn't I'm afraid. If you can wait until tomorrow, we'll get this released as it's almost ready to go.

@Ehesp I saw you made some changes on AdMob, adding BannerAd according to the commentaries. Unfortunately, even when I uninstall then reinstall @react-native-firebase/admob, BannerAd is not available.

I feel like there is an issue with NPM, since the version number didn't change (v0.3.0). It may be great to upgrade to v0.3.1 - assuming that the issue is coming from version number?

As a workaround I downloaded the sources and manually replaced files in <project>\node_modules\@react-native-firebase\admob\ (tedious) ; it seems to work great though.

Salakar commented 5 years ago

@pistou 0.4.0 is now published with this in, please try it out, thanks

pistou commented 5 years ago

@Salakar Just tried and it gives an error:

You've attempted to require '@react-native-firebase/admob' version '0.4.0', however, the '@react-native-firebase/app' module is of a different version (0.3.0).

All React Native Firebase modules must be of the same version. Please ensure they match up in your package.json file and re-run yarn/npm install.

I'm not sure why, for me the point of having separate modules was a good way of having them in different advanced levels (i.e. separated version numbers).

I can open an issue to track this down if you prefer not doing it on this thread.

Salakar commented 5 years ago

They all need to be the same version, you'll need to update app also to 0.4.0, they are version dependent.

The point of splitting them was separation, yes, but not for versions; with native code & native dependencies in play, we choose to enforce all packages being on the same version number so it's there are no native code conflicts, same as the Firebase iOS SDK does.

pistou commented 5 years ago

My bad for the missunderstanding there. I upgraded every of my @react-native-firebase packages and it works perfectly !

Thanks for your work and time.

Salakar commented 5 years ago

@pistou no problem πŸ‘ glad it's working, if you have any issues with v6 please let us know via a new issue (tag it with [v6] in the name), thank you

kaioduarte commented 4 years ago

Has the package been removed? I can't install v6, I'm following the migration guide.

image

Ehesp commented 4 years ago

@kaioduarte woops - that was supposed to be /app. Just pushed up a fix.

kevinvugts commented 4 years ago

@Ehesp

Hi Elliot,

Could it be possible that crashlytics in v6 is not compatible yet? I followed the docs https://invertase.io/oss/react-native-firebase/v6/crashlytics/quick-start

and received an error when trying to manually link:

  In snapshot (Podfile.lock):
    Fabric (= 1.10.2, ~> 1.10.2, ~> 1.6)

  In Podfile:
    ExpoKit/Core (from `http://github.com/expo/expo.git`, tag `ios/2.12.4`) was resolved to 34.0.0, which depends on
      Fabric (~> 1.6)

    RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics/ios`) was resolved to 0.4.3, which depends on
      Fabric (~> 1.9.0)

It seems like you've changed the constraints of dependency `Fabric` inside your development pod `RNFBCrashlytics`.
You should run `pod update Fabric` to apply changes you've made.

pod

pod 'RNFBCrashlytics', :path => '../node_modules/@react-native-firebase/crashlytics/ios'

I also receive the following error when adding the performance v6 module

[!] The 'Pods-xclsv-500' target has libraries with conflicting names: libgoogleutilities.a.

JimTeva commented 4 years ago

In case it can help someone to install "v6.0.0." on iOS with a project that is on react-native@0.60.x:

From what I understood, there is not really a version 6 "react-native-firebase@6.x.x". The whole react native firebase library has been splited in different modules, with "@react-native-firebase/app" as the main module to be installed first. Also depending on the Firebase services that you use, you will need to install the corresponding modules later.

Now, each module/service has its own version, with the main module "@react-native-firebase/app" currently being at version 0.4.3.

For anyone having issues with the line "@import Firebase;" during iOS install: I have added to Xcode > project target > build settings > header search paths and library search paths, and it works fine after that (don't forget to clean build and derived data first)

Header search paths "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/RNFBApp" ${PODS_ROOT}/Firebase/CoreOnly/Sources

Library search paths "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstanceID" "${PODS_CONFIGURATION_BUILD_DIR}/RNFBApp"

Source for the paths details: the React Native CLI + Firebase here https://invertase.io/oss/react-native-firebase/quick-start/new-project

Also make sure that the Xcode build phases are empty of the React Native Firebase .a file.

Salakar commented 4 years ago
ExpoKit/Core (from `http://github.com/expo/expo.git`, tag `ios/2.12.4`) was resolved to 34.0.0, which depends on
  Fabric (~> 1.6)

RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics/ios`) was resolved to 0.4.3, which depends on
  Fabric (~> 1.9.0)

@kevinvugts, unfortunately, it looks like ExpoKit is bundling its own outdated Fabric version which is conflicting with RNFB, not much we can do here tbh unless you can override the version in Expo somehow to match ours (1.9.0).

Salakar commented 4 years ago

@JimTeva correct yes, though all the separate packages are still version tied - they all are published at the same version numbers and will error if non-matching versions are used. Once we officially release we'll graduate all these packages to v6.0.0 and start from there.

I'm not sure why you're having header issues though, we run RN 60.x on our tests app and also the template is RN 60.x - not had any issues yet, very strange

If there's anything lacking on documentation we'd love PRs

marcelschulze commented 4 years ago

For when is the notifications module planned to be released? Am I missing something or isn't push notifications one of the most important things? How is anybody able to test v6 yet. Or am I way to opinionated on this one?

In any way, thank you for your awesome work of course!

dcolin commented 4 years ago

I want to use NativeAd in my application, is it possible with v6?

BTW the BannerAd documentation page is broken : https://invertase.io/oss/react-native-firebase/v6/admob/reference/bannerad/

kevinvugts commented 4 years ago

@JimTeva correct yes, though all the separate packages are still version tied - they all are published at the same version numbers and will error if non-matching versions are used. Once we officially release we'll graduate all these packages to v6.0.0 and start from there.

I'm not sure why you're having header issues though, we run RN 60.x on our tests app and also the template is RN 60.x - not had any issues yet, very strange

If there's anything lacking on documentation we'd love PRs

What would be your advise to do?

Ehesp commented 4 years ago

I want to use NativeAd in my application, is it possible with v6?

BTW the BannerAd documentation page is broken : invertase.io/oss/react-native-firebase/v6/admob/reference/bannerad

Native Ads are not supported yet. They're quite tricky, however we do have a plan, it'll just be post-v6.

Also Banner page looks ok, try turning adblocker off?

Salakar commented 4 years ago

@kevinvugts I just deployed v0.5.2 to NPM of the pre-release packages; which now allow you to override the Fabric & Crashlytics versions we use internally, update your packages and add this to the top of your Podfile

$FabricSDKVersion = '1.6.0'
$CrashlyticsSDKVersion = '3.1.0'

Documentation will be added here alongside the other available overrides.

Note that using early versions of the SDKs means we've not tested they function correctly, so it's at your own risk but should generally be ok.

mikehardy commented 4 years ago

Note that using early versions of the SDKs means we've not tested they function correctly, so it's at your own risk but should generally be ok.

With the important caveat that I think Crashlytics didn't get rid of the UIWebView references receiving "we'll reject your app soon" warnings from the Apple Store, with the community-best-guess indicating they will start rejecting apps for real when iOS 13 is released, which I think is...today https://firebase.google.com/support/releases#september_10_2019

Salakar commented 4 years ago

@mikehardy With the important caveat that I think Crashlytics didn't get rid of the UIWebView references receiving "we'll reject your app soon" warnings from the Apple Store, with the community-best-guess indicating they will start rejecting apps for real when iOS 13 is released, which I think is...today https://firebase.google.com/support/releases#september_10_2019

πŸ‘ yes definitely a big caveat.

I've updated the docs to show all the overridable settings now; https://github.com/invertase/react-native-firebase/blob/docs/pages/guides/overriding-native-sdk-versions.md (will be on the site shortly)

kaioduarte commented 4 years ago

I just received this warning while using Cloud Storage:

Unknown option dependency.platforms.android.buildPatch with value ""implementation project(':@react-native-firebase_storage')"" was found

 "dependencies": {
    "@react-native-firebase/app": "^6.0.0-alpha.25",
    "@react-native-firebase/storage": "^6.0.0-alpha.25",
    "react": "16.9.0",
    "react-native": "0.61.0-rc.3"
  }

Any thoughts? Maybe related to https://github.com/invertase/react-native-firebase/issues/2194.

pistou commented 4 years ago

@kaioduarte According to this answer, I believe ^6.0.0-alpha.25 is deprecated and you should use ^0.5.2 which is the latest version at the moment.

please change all your @react-native-firebase/* packages to version ^0.4.0 - we moved the v6 alphas to <1.0.0 patch & minor releases so we could partially gate any breaking changes between the alpha behind versions (wasn't so flexible when using tags)

kevinvugts commented 4 years ago

@kevinvugts I just deployed v0.5.2 to NPM of the pre-release packages; which now allow you to override the Fabric & Crashlytics versions we use internally, update your packages and add this to the top of your Podfile

$FabricSDKVersion = '1.6.0'
$CrashlyticsSDKVersion = '3.1.0'

Documentation will be added here alongside the other available overrides.

Note that using early versions of the SDKs means we've not tested they function correctly, so it's at your own risk but should generally be ok.

I am receiving the following error:

[!] No podspec found for `RNFBAnalytics` in `../node_modules/@react-native-firebase/analytics/ios

But the path seems to be correct tho. I also tried to remove node_modules and reinstall package.json. But no result.

Ehesp commented 4 years ago

@kevinvugts can you try ensuring the CLI is up to date?

kevinvugts commented 4 years ago

CLI

My Expo CLI?

update

I removed the /ios extension on the end and now it is coming a bit further. Now the following error appears:


To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.8.0.beta.2

Analyzing dependencies
Fetching podspec for `EXAppLoaderProvider` from `../node_modules/expo-app-loader-provider/ios`
Fetching podspec for `EXBlur` from `../node_modules/expo-blur/ios`
Fetching podspec for `EXConstants` from `../node_modules/expo-constants/ios`
Fetching podspec for `EXFileSystem` from `../node_modules/expo-file-system/ios`
Fetching podspec for `EXFont` from `../node_modules/expo-font/ios`
Fetching podspec for `EXKeepAwake` from `../node_modules/expo-keep-awake/ios`
Fetching podspec for `EXLinearGradient` from `../node_modules/expo-linear-gradient/ios`
Fetching podspec for `EXLocalization` from `../node_modules/expo-localization/ios`
Fetching podspec for `EXLocation` from `../node_modules/expo-location/ios`
Fetching podspec for `EXPermissions` from `../node_modules/expo-permissions/ios`
Fetching podspec for `EXSQLite` from `../node_modules/expo-sqlite/ios`
Fetching podspec for `EXWebBrowser` from `../node_modules/expo-web-browser/ios`
Fetching podspec for `RNFBAnalytics` from `../node_modules/@react-native-firebase/analytics`
Fetching podspec for `RNFBApp` from `../node_modules/@react-native-firebase/app`
Fetching podspec for `RNFBCrashlytics` from `../node_modules/@react-native-firebase/crashlytics`
RNFBCrashlytics: Using user specified Fabric SDK version '1.6.0'
RNFBCrashlytics: Using user specified Crashlytics SDK version '3.1.0'
Fetching podspec for `RNFBPerf` from `../node_modules/@react-native-firebase/perf`
Fetching podspec for `React` from `../node_modules/react-native`
Fetching podspec for `UMBarCodeScannerInterface` from `../node_modules/unimodules-barcode-scanner-interface/ios`
Fetching podspec for `UMCameraInterface` from `../node_modules/unimodules-camera-interface/ios`
Fetching podspec for `UMConstantsInterface` from `../node_modules/unimodules-constants-interface/ios`
Fetching podspec for `UMCore` from `../node_modules/@unimodules/core/ios`
Fetching podspec for `UMFaceDetectorInterface` from `../node_modules/unimodules-face-detector-interface/ios`
Fetching podspec for `UMFileSystemInterface` from `../node_modules/unimodules-file-system-interface/ios`
Fetching podspec for `UMFontInterface` from `../node_modules/unimodules-font-interface/ios`
Fetching podspec for `UMImageLoaderInterface` from `../node_modules/unimodules-image-loader-interface/ios`
Fetching podspec for `UMPermissionsInterface` from `../node_modules/unimodules-permissions-interface/ios`
Fetching podspec for `UMReactNativeAdapter` from `../node_modules/@unimodules/react-native-adapter/ios`
Fetching podspec for `UMSensorsInterface` from `../node_modules/unimodules-sensors-interface/ios`
Fetching podspec for `UMTaskManagerInterface` from `../node_modules/unimodules-task-manager-interface/ios`
Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`
[!] CocoaPods could not find compatible versions for pod "Fabric":
  In snapshot (Podfile.lock):
    Fabric (= 1.10.2, ~> 1.10.2, ~> 1.6)

  In Podfile:
    ExpoKit/Core (from `http://github.com/expo/expo.git`, tag `ios/2.12.4`) was resolved to 34.0.0, which depends on
      Fabric (~> 1.6)

    RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics`) was resolved to 0.5.4, which depends on
      Fabric (= 1.6.0)

It seems like you've changed the constraints of dependency `Fabric` inside your development pod `RNFBCrashlytics`.
You should run `pod update Fabric` to apply changes you've made.```
Ehesp commented 4 years ago

Try running pod install --repo-update

kevinvugts commented 4 years ago

Try running pod install --repo-update

I used that script.

Ehesp commented 4 years ago

Please can we see your Podfile, looks like auto-linking isn't working for some reason... Did you manually add the pods?

kevinvugts commented 4 years ago

Please can we see your Podfile, looks like auto-linking isn't working for some reason... Did you manually add the pods?

I add them manually yes. Here is the pod file:

https://pastebin.com/4z2PGFi3

Update

When I removed the fixed versions, it installed the podfile succesfully. huh?!

@Ehesp

Right now I am experiencing the following issue:

info Opening /Users/kevin/Enorm/xclsv-500/node_modules/@react-native-firebase/app/lib/internal/RNFBNativeEventEmitter.js with atom
LSOpenURLsWithRole() failed for the application /Applications/Atom.app with error -10810.
pistou commented 4 years ago

Right now I am experiencing the following issue:

info Opening /Users/kevin/Enorm/xclsv-500/node_modules/@react-native-firebase/app/lib/internal/RNFBNativeEventEmitter.js with atom
LSOpenURLsWithRole() failed for the application /Applications/Atom.app with error -10810.

This looks like an error with Atom IDE, maybe Atom#3093?

radik commented 4 years ago

Is there any progress on Notifications package? Is there any way how I can help?

technoplato commented 4 years ago

@radik See: https://github.com/invertase/react-native-firebase/issues/2566

TLDR Not really a way to help, but progress is being made.

jwaldrip commented 4 years ago

How will this be supported with web. The previous version was the same API as the official package from google. How will that work in 6.0.0?

Ehesp commented 4 years ago

How will this be supported with web. The previous version was the same API as the official package from google. How will that work in 6.0.0?

@jwaldrip What do you mean by "supported with web"?

v6 follows the web SDK too where applicable, and for newer modules such as ML Kit we have developed the API into JavaScript based on the native platforms.

Salakar commented 4 years ago

Hey all, v6.0.0 is here :tada: see: https://invertase.io/blog/react-native-firebase-v6

pistou commented 4 years ago

@Salakar Congrats on the launch (and the shootout at Firebase Summit πŸ’― ) πŸŽ‰

r0b0t3d commented 4 years ago

Hi, thanks for your hard work to make v6 available. I'm working with typescript and I got problem with auto complete

import database from '@react-native-firebase/database';

const usersRef = database().ref('users');

vscode can not determine the type of usersRef.