-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
FR: App Clips support for Firestore, Database, and others #6211
Comments
Looks like network requests are failing across multiple SDKs (Crashlytics, Analytics, Firestore) with either network connection lost or request timeout errors. Are you able to reproduce this on every network (for example LTE and different wifi networks)? |
Yes, it happened on both wifi and LTE. The simulator is working fine, but tested it with 2 phones, both iOS 14 beta 4 and looks like it is not working. |
This is unlikely to make a difference, but are the connection issues reproducible with Firebase 6.29? |
This is my current podfile, how can I change Firebase version if I'm importing just the parts I need? |
Do |
Did it, many packages got updated, but it is still not working. |
@DanMotataeanu if you create a blank project and set up App Clips and use Firestore (same project is fine) - do you run into the same issue? |
Creating a new project, setup an app clip for it and trying to integrate Firebase services it doesn't even get past the phase where Firebase is waiting for a connection. |
Hi @DanMotataeanu - I was unable to reproduce the issue in a blank App Clip project. Steps I tried:
If you do have a new project that does reproduce the issue, please share it with us (without a GoogleService-Info.plist) and we can make further progress but without a reproduction we won't be able to get very far. |
Thanks for helping me out! At this moment I have this very simple code which triggers the error.
Full console log
If you still can't reproduce it, I might also try a factory reset of the phone to see if that helps. |
Aha! Apologies for not noticing the simulator vs device comment you had previously mentioned. Good news and bad news: good news is I was able to reproduce! Bad news is that it looks like a real issue, I'll start digging into what's going on now. Thank you very much again for reporting this 👍 |
While digging into this issue, we've turned up this note: https://developer.apple.com/forums/thread/652104. Firestore uses gRPC which uses CFStream for network access. This is being denied by the OS. Unfortunately this means there's no short term fix possible for this--we'd need to either migrate gRPC to NSURLSession or reimplement the subset we need for ourselves, neither of which are small projects. For the foreseeable future this means that the Firestore SDK is not compatible with App Clips. To access Firestore data you'll need to use the REST API via NSURLSession. |
Whoa, quite bad news this time. While calls for fetching documents from the database could be replaced by
This means that even after launching the App Clips (hopefully fall 2020) Firebase compatibility isn't 100% sure? As a side note, my other issue might have the same root cause? |
Fetching documents can be done directly against the Firestore REST API without needing to stand up a cloud function (background, reference). You're right that the major limitation here is that listens are not available in the REST API.
At this point we can't commit to this working when App Clips launch. I won't say it's impossible, but you should definitely plan for Firestore to be incompatible with App Clips.
I can't speak with any authority on that topic. From what I can see the error contains an |
This is also the exact same issue with FirebaseDatabase. |
@StephanWalters yes, unfortunately Firebase Database is affected by the same issue. On the technical level, the hurdles to get Database running are going to be easier since it's not migrating gRPC but migrating from SocketRocket (which is an overall smaller dependency) and the surface area of APIs that touch SocketRocket is relatively small. That being said, it's still replacing the entire networking stack of the SDK and that requires extensive testing and careful consideration, so it likely won't arrive in time for the public release but we're investigating it. |
I momentarily used this ver dirty workaround |
@YannisDC I am doing something similar using IK Event Source for server side events, to simulate firebase's real time listenrs: |
I found, when i turn on my iPhone |
Hi, are there any updates as to if or when this issue will be fixed? Trying to integrate Firestore with an App Clip here, thanks! |
There probably won’t be any fix. App clips don’t allow socket connections
(CFSocket) on physical devices. Your best bet will be to use Firebase
Functions and use your Firestore code in that.
…On Tue, Nov 17, 2020 at 9:54 PM William Bai ***@***.***> wrote:
Hi, are there any updates as to if or when this issue will be fixed?
Trying to integrate Firestore with an App Clip here, thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6211 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7B63D72Q3PR4NI5H7OY6TSQMZNBANCNFSM4PVPJGIA>
.
|
There's no "fix" to make. We're working with the gRPC team to build an alternative implementation that is compatible with App Clips (and also watchOS). This is a major undertaking and we can't promise it will even necessarily work or when it will be released. If you're building an App Clip today and want access to Firestore data, you'll need to access the data using means other than this SDK, as described above. Even though this was reported as a bug, the best way to think of this is as a feature request to support App Clips. We're leaving it open on that basis. |
Not sure if this info helps or not but I'm trying to upload a file to Firebase Storage in an AppClip. When I do fileRef.putData() for a small text file, all work fine. When I do fileRef.putFile(), I'm getting "unknown error". From the error message and other log entries, it looks like it's related to this: https://developer.apple.com/forums/thread/669148 Basically, that guy says, you can't use background session in an appclip. My best guess is that putFile() uses background session while putFile doesn't. Didn't look into the sources though. |
@YannisDC does this work the same way a listener works, or do you have to manually poll for data? |
Hello Everybody, @ryanwilson Are there any updates here? I am facing a similar problem with the app clip, and I'd like to know if there are any updates. Thanks! |
Is there a GitHub issue tracking this effort? |
^ |
@imthath-m was this on a real device? If so, which iOS version? If it's in the simulator, note that the networking stack used by the simulator is not the same as on device, where the simulator worked and the device didn't last time I checked. Sorry folks, I don't have any other updates around this. The REST endpoint is still the best way to access Firestore data from an App Clip. |
@ryanwilson Thanks for the pointer. Indeed, I tested in Simulator and it is not working in physical device. However, I tried callable firebase functions from App Clips in physical device (iOS 16.7) and they work as expected. I assume they don't need require socket connections to work (even though some libraries are added). I might go with callable functions instead of REST endpoints. |
Callable functions use HTTPS. In fact, callable functions are a thin wrapper around HTTPS functions, the main benefits being they automatically carry the authentication context, and make it easier to send and receive |
@ryanwilson @imthath-m Looks like we don't have a way to listen the document in App Clips and it still the case in 2024? 🤔 |
@ming-chu you cannot use websockets in app clips. (Firebase Database/Firebastore uses websockets to listen) Your best bet here is HTTP polling. |
@alexfringes, Im getting pinged because its 3am in the morning. I have been following this post for years now. And I don't work for Google or Apple. What I do know is that that this thread has been open for 4 years and App Clips haven't changed and probably won't any time soon. If you want to use some sort of Firebase Firebstore functionality your best bet is using an onRequest Cloud Function that will call Firestore APIs and do HTTP polling on the client to poll for changed data. |
Ok I've blocked the guy i was mentioning, if anyone comes here in 2024 and needs assistance (on device), read the post above. |
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
What happened? How can we make the problem occur?
The problem happens when you build an app clip using iOS 14 beta 4. Basically, you can not fetch any data from Firestore.
Relevant Code:
The problem was not here in iOS Beta 3 and Auth for example is working well and generates an anonymous token everytime.
The text was updated successfully, but these errors were encountered: