Last active
February 28, 2024 15:30
-
-
Save thuydao/a1fecabaa33a9684f44c30cd472b6c7d to your computer and use it in GitHub Desktop.
Guide to development React Native
Author
Author
FCM Firebase Cloud Message
Install & setup the app module
Install the messaging module
If you're developing your app using iOS, run this command
yarn add @react-native-firebase/app \
&& yarn add @react-native-firebase/messaging \
&& cd ios/ && pod install --repo-update \
&& cd ..
Error
The following Swift pods cannot yet be integrated as static libraries:
The Swift pod
FirebaseCoreInternaldepends uponGoogleUtilities, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may setuse_modular_headers!globally in your Podfile, or specify:modular_headers => truefor particular dependencies.
Fix by add to ios/Podfile:
platform :ios, '12.4'
...
...
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
#....add any library need headers
Configure Firebase with Android credentials
First, add the google-services plugin as a dependency inside of your /android/build.gradle file:
buildscript {
dependencies {
// ... other dependencies
// NOTE: if you are on react-native 0.71 or below, you must not update
// the google-services plugin past version 4.3.15 as it requires gradle >= 7.3.0
classpath 'com.google.gms:google-services:4.4.1'
// Add me --- /\
}
}
Lastly, execute the plugin by adding the following to your /android/app/build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' // <- Add this line
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setting up the development environment OSX
Node & Watchman
brew install node && brew install watchmanInstall XCode and Command Line Tools
Create new application
npx react-native@latest init AwesomeProject