-
Notifications
You must be signed in to change notification settings - Fork 54
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
Unable to use realtime in flutter web #11
Comments
If you are using flutter web, currently the realtime api is not supported there because the underlying lib The The second one, You can also start the PocketBase executable with I'll move the issue to the Dart SDK repo. |
You're absolutely right, I was using Flutter web. Thanks! |
I don't see Is it possible to implement SSE on flutter web using Dampfwalze's implementation. Edit: |
After 3 days I couldn't make it work 😢 I think it's possible but I'm not experienced enough in this field sorry. |
I'll consider sometime next week to expose a global |
I've pushed a small change in v0.10.1 that allows providing a custom import "package:pocketbase/pocketbase.dart";
import 'package:fetch_client/fetch_client.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
void main() {
final pb = PocketBase(
"http://127.0.0.1:8090",
// load the fetch_client only for web, otherwise - fallback to the default http.Client()
httpClientFactory: kIsWeb ? () => FetchClient(mode: RequestMode.cors) : null,
);
// ...
} |
When trying to use the realtime feature in flutter I see in the logs two requests:
A GET request from
guest
to /api/realtime which responds with 200. I guess that's the subscription.A POST request from
user
to /api/realtime which fails with 404 and meta:I guess that's the data I changed on the admin panel.
I use email auth and the user has credentials. The user is able to fetch from this collection. The code in flutter used is:
Why is the first call as
guest
? Is this the reason why the second request fails?The text was updated successfully, but these errors were encountered: