Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[📚] New setup guide for iOS Credentials in RN 0.77 #8248

Open
jordankkk opened this issue Jan 24, 2025 · 11 comments
Open

[📚] New setup guide for iOS Credentials in RN 0.77 #8248

jordankkk opened this issue Jan 24, 2025 · 11 comments

Comments

@jordankkk
Copy link

Starting with RN 0.77 /ios/{projectName}/AppDelegate.mm is removed and changed to AppDelegate.swift


Image

@mikehardy
Copy link
Collaborator

Hi there - please just hit the edit button top right of the page and propose a change

@jordankkk
Copy link
Author

@mikehardy I apologize, as I’m new to React Native and am unsure how to make the change. 😁

@romanakash
Copy link

Created a PR here #8251

@tahaipek
Copy link

tahaipek commented Jan 29, 2025

Thank you for your guidance and PR.

Similarly, do you have a guide to enable Multidex on Swift?
https://rnfirebase.io/enabling-multidex#enabling-multidex

Similarly, do you have a guide to configure Cloud Messaging in Swift?
https://rnfirebase.io/messaging/usage#background-application-state

Or was the problem solved from a more fundamental point in RN 0.77? I couldn't find any documentation on this.

I noticed that the documentation of rnfirebase.io is old.

I'm currently trying to update ReactNative 0.72 to 0.77, so I need to adapt many packages back to 0.77.

@mikehardy
Copy link
Collaborator

@tahaipek 👋

The documentation on rnfirebase.io is as new as we have it, if there is something out of date there is an edit button top right of every page and the github PR flow in their web UI for text changes is trivial. I imagine since you mention react-native 0.77 you have noticed that react-native now uses AppDelegate.swift vs .mm. Please feel free to post a PR

Multidex was a workaround for old Android devices that are no longer supported, and we may all happily forget about multidex forever. And you never ever needed to think about it for iOS, it was an Android thing. You will never need it with modern Android.

@tahaipek
Copy link

Hi,
I think I will reach the solution a little late because I don't have technical knowledge about Native Android (kotlin) and iOS (swift) development. If I reach the solution, I will definitely update the docs and create PR.

  • I will skip the Multidex state. Thank you for your technical guidance.
  • I wonder if you can give some guidance for the “Background Application State” state?

Thanks in advance for your advice.

@MezillaJohn
Copy link

Hi there - please just hit the edit button top right of the page and propose a change

Please can you guys update this and the docs as soon as possible, cause we are stuck here.

@vishalksymentix
Copy link

vishalksymentix commented Feb 11, 2025

This is the updated Doc of react native 0.77 with firebase. How can you modify appdelegate.swift to integrate the firebase

use this to import firebase

import Firebase

use this to initialize firebase
FirebaseApp.configure()

@AnmolMalik-BWES
Copy link

AnmolMalik-BWES commented Feb 11, 2025

App started crashing after FirebaseApp.configure()

"@react-native-firebase/app": "^21.7.2",
"@react-native-firebase/messaging": "^21.7.2",
"react-native": "^0.77.0",

Do I also need to change Podfile

@vishalksymentix
Copy link

App started crashing after FirebaseApp.configure()

"@react-native-firebase/app": "^21.7.2", "@react-native-firebase/messaging": "^21.7.2", "react-native": "^0.77.0",

Do I also need to change Podfile

Please mention your podfile here

@AnmolMalik-BWES
Copy link

AnmolMalik-BWES commented Feb 12, 2025

Please mention your podfile here

Podfile

require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', dir]).strip

platform :ios, min_ios_version_supported
prepare_react_native_project!

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end

target 'bossapp' do
config = use_native_modules!

use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)

#\ use_frameworks! :linkage => :static
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
#\ $RNFirebaseAsStaticFramework = true

rn_maps_path = "../node_modules/react-native-maps"
pod 'GoogleUtilities', :modular_headers => true
pod 'react-native-google-maps', :path => rn_maps_path
pod 'react-native-maps', :path => rn_maps_path
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'

post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
end
end

Here it is
NOTE: I have tried adding $RNFirebaseAsStaticFramework = true and use_frameworks! :linkage => :static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants