appwrite/sdk-for-web

๐Ÿ› Bug Report: Expo React Native realtime URLSearchParams.set is not implemented

anhtuank7c opened this issue ยท 6 comments

๐Ÿ‘Ÿ Reproduction steps

I'm trying to subscribe to a document on the Expo client.

// expo project
import { Client } from 'appwrite';
const client = new Client().setProject(PROJECT_ID).setEndpoint(ENDPOINT_HERE);

useEffect(
    function subscribeToLikeAndCommentCount() {
      const unsubscribe = client.subscribe(
        `databases.DATABASE_ID_HERE.collections.COLLECTION_ID_HERE.documents.${videoId}`,
        (payload) => {
          console.log('payload', payload);
        }
      );
      return () => unsubscribe();
    },
    [videoId]
  );

I'm trying to install polyfill manually but got another issue with localstorage that doesn't exist on React Native.
facebook/react-native#23922 (comment)
Simulator Screen Shot - iPhone 14 Pro - 2022-12-31 at 17 47 04
Simulator Screen Shot - iPhone 14 Pro - 2022-12-31 at 17 42 51
Screenshot 2022-12-31 at 17 47 23

๐Ÿ‘ Expected behavior

should print the console logs for the payload

๐Ÿ‘Ž Actual Behavior

Error: URLSearchParams.set is not implemented

๐ŸŽฒ Appwrite version

Version 0.10.x

๐Ÿ’ป Operating system

MacOS

๐Ÿงฑ Your Environment

System:
    OS: macOS 13.1
    CPU: (8) x64 Apple M1
    Memory: 37.08 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.7.0 - /usr/local/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.7.0/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v18.7.0/bin/npm
    Watchman: 2022.10.03.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/tuannguyen/.rvm/gems/ruby-2.7.5/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 29, 31, 32, 33
      Build Tools: 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0
      System Images: android-32 | Google APIs ARM 64 v8a, android-33 | Google Play ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0 
    react-native: 0.70.5 => 0.70.5 
    expo: 47.0.0
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

Is the local storage error the same as #29? Can you ๐Ÿ‘ that issue and close this as a duplicate?

@stnguyen90 If I fix the Polyfill issue, yes, it become the same as #29
But I think we should keep this issue open for the Polyfill issue.
What do you think?

But I think we should keep this issue open for the Polyfill issue.

From what I understand, React Native requires a polyfill. Is that right? What are you suggesting?

@stnguyen90 Yeah, I would suggest installing this one: https://github.com/expo/browser-polyfill for react native.

Can we somehow make local storage to be flexible to configs such as AsyncStorage or MMKV

@anhtuank7c,

Yeah, I would suggest installing this one: https://github.com/expo/browser-polyfill for react native.

That seems out of the scope of Appwrite, then, right? As such, can this be closed?

Can we somehow make local storage to be flexible to configs such as AsyncStorage or MMKV

You might want to open a separate issue to request that.

Thank you for update.
I've replaced Appwrite completely by PocketBase.
Issue no longer needed.