Skip to content

Commit 5f20367

Browse files
committed
fix: use correct url
1 parent e4daf40 commit 5f20367

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/supabase_flutter/lib/src/platform_http_io.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ http.Client getPlatformHttpClient() {
2323
///
2424
/// It may return `null` because the differentiation for the other platforms
2525
/// is done in [RealtimeClient].
26-
WebSocketChannel? getPlatformWebSocketChannel(String url) {
26+
WebSocketChannel Function(String url)? getPlatformWebSocketChannel() {
2727
if (Platform.isIOS || Platform.isMacOS) {
28-
return AdapterWebSocketChannel(
29-
CupertinoWebSocket.connect(Uri.parse(url)),
30-
);
28+
return (String url) =>
29+
AdapterWebSocketChannel(CupertinoWebSocket.connect(Uri.parse(url)));
3130
}
3231
return null;
3332
}

packages/supabase_flutter/lib/src/supabase.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ class Supabase with WidgetsBindingObserver {
120120
);
121121
}
122122
if (realtimeClientOptions.webSocketTransport == null) {
123-
final platformWebSocketChannel = getPlatformWebSocketChannel(url);
123+
final platformWebSocketChannel = getPlatformWebSocketChannel();
124124
if (platformWebSocketChannel != null) {
125125
realtimeClientOptions = realtimeClientOptions.copyWith(
126-
webSocketTransport: (url, headers) => platformWebSocketChannel);
126+
webSocketTransport: (url, headers) =>
127+
platformWebSocketChannel(url));
127128
}
128129
}
129130
_instance._init(

0 commit comments

Comments
 (0)