-
Notifications
You must be signed in to change notification settings - Fork 397
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
Use with Pods (firebase) #79
Comments
Same issue here. |
Did you include the RNFirebase Project in your extension's build target Link Binary With Libraries? It seems like Firebase is installed correctly but you native RNFirebase Project is missing... |
I've solved with the creation of an app group between the app and the extension |
@marcoizzo can you explain me exactly what you mean? I am not really sure how to do this :) |
@BigPun86 you have to create an app group. To do this:
Then add linked framework and libraries required (libRNFirebase.h) under general tab I hope this useful :) |
@marcoizzo Unfortunately it didn´t help. But thanks for your explanation. I am using Crashlytics aas well in my pods. I tried to add both libRNFirebase & lib..Crashlytics. I still receive the errors and it wont build my project. I f i remove crashlytics and firebase as linked libraries it will build, but then the app hangs as soon as i share something (URL or Image). Any ideas how to fix that? I mean, do you think this is because i didn´t link CrashLytics and Firebase? |
@BigPun86 what's the error during building? Anyway, you have to include Firebase and CrashLytics in your extension if you have to use them in your code |
@marcoizzo this is the error i am getting: This is how my PodFile looks like:
|
@BigPun86 Do you have added |
@marcoizzo i added it to the Share Target, yes. |
@BigPun86 mmm... it seem that the problem is Fabric, but I have never used it so I don't know... Try to remove it in your extension to understand if really crashlytics is the issue |
@marcoizzo now i am getting some React related issues. Maybe u can show me how you have set up your Header Search Path? This is how mine looks right now: |
@marcoizzo many thanks, i will check it. So actually your Header Search stuff is exactly the same as the one you use for your main target app? |
@BigPun86 Yep! |
@marcoizzo Any more information you can share on your successful setup? I would really appreciate any help you can give towards adding rnfirebase! I've previously got the share extension working without rnfirebase. Below is some information about my attempt to integrate rnfirebase. Share Extension Linked Frameworks and Libraries |
@daviswhitehead could you atleast build without issues, or does this already fail? |
I can build successfully without trying to integrate rnfirebase. But when I do, I get the following error, which I believe you were seeing as well right @BigPun86 ? |
@daviswhitehead yeah, i had exactly the same issue. i cant remember what exactly i have done which fixed it...but i think it was enabling AppGroups and/or first cleaning and then building the ShareExtension target/app, maybe you can just try that. If not i hope my setup will help you: Linked Libraries and Header Search Path setup of the main App: Linked Libraries and Header Search Path setup of the Share Extension: |
@BigPun86 what does your appgroup look like? does this look correct to you? (both the main app and extension look the same) |
I'm getting the same error regardless of if I have App Groups on or off. Any ideas? |
@daviswhitehead yes, but you have to enable it for both, the ShareExtension & the Main App. Then run pod install again and maybe also react-native link... |
Yep I've enabled for both and am getting the same error. |
@daviswhitehead did you run pod install & react-native link after your changes too? |
Unfortunately, yes I have and am still on that same error. |
I think it's failing before hitting anything related to App Groups. I get the same error when App Groups is off for both (main and share extension) targets. I'm not super familiar with xcode or native iOS dev, but it seems like libRNFirebase.a is not able to find all the nested references. My code seems to be failing at the #import <Firebase.h> line of ShareExtension.m. |
I was able to get the firebase pods linked by removing all pods under the extension and adding the line Any ideas @BigPun86 or @marcoizzo ? |
@daviswhitehead I'm experiencing the same linker error you were at first:
Do you recall if there were any steps you took to resolve it that weren't mentioned in this thread? The extension portion of my podfile looks like this:
Linker flags are set correctly. In my header search paths for the extension I have
Under Build Phases > Link Binary with Libraries I have Does anything else come to mind that I might try? Interestingly enough when I remove firebase I am able to build but get a runtime error related to firebase, even if I don't import it in ShareExtension.m |
For anyone struggling with this issue. After following the standard installation instructions, make sure you do the following:
|
@AndrewHenderson Do you know if it is possible to authenticate with firebase from the main app and some how pass the authentication to the share extension? (I don't want to ask the user to do login again) |
@i25878427 Use react-native-shared-group-preferences. For iOS you'll need to create an "App Group" and give both your app and the extension permission. This has to be done in Xcode. The install steps should cover everything. |
@AndrewHenderson Thanks for the help :-). I already have "App Group" installed and I was able to share data between the main app and the share extension. Maybe my question is more firebase related. I don't know what should I share with the share extension from the main app to make the share extension authenticate with firebase, so I can read/write to firebase database. |
@i25878427 I've found that the Share extension has its own scope and any modules have separate instances — so your Firebase instance would probably have to be initialized for both. The only data I've been able to share is storing strings in the App Group. You're better off asking these questions in https://github.com/invertase/react-native-firebase. They also have their own channel on Discord. Good luck! 😄 |
@AndrewHenderson Thanks! I will try using their channel :-) |
not totally sure how this works technically, but I was able to authenticate with firestore through the share extension in the same way I do within my main app. Not sure if it's any different for firebase but would guess not.
|
That seems right. I’d expect you’d need to authenticate the same way, but that there would be separate configured firebase instances — so they would not share a session. Did you have to auth through share extension separately? Do you have to reauthenticate in the share extension every time? |
Adding |
I am facing the same issue. @emilefleming did you end up resolving this ? @AndrewHenderson I followed all the instructions listed as well. Here is how my pod file looks -
Any help appreciated!! |
Hi guys,
thanks for this component.
I'm trying to implement a share extension with a firebase-based app. So I have created a pod file and generated a .xcworkspace project.
I followed all installation tutorial and all seem ok, but when I try to launch the extension Xcode console says:
RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects 'Podfile' and have run 'pod install'.
This is my pod file:
And this my TogetherShareEx.m
I have also addedd:
Any idea? Thanks
The text was updated successfully, but these errors were encountered: