Skip to content

🐛 Bug Report: realtime not working in react native expo #23

@bilelBoulhia

Description

@bilelBoulhia

👟 Reproduction steps

create a class for a client using react-native-appwrite sdk

import { Client ,Databases} from 'react-native-appwrite';

const client = new Client();
         client.setEndpoint('https://cloud.appwrite.io/v1')
                  .setProject('project_id')
                  .setplatform('host.exp.exponent') //bundle id
                  .setplatform('localhost')

export default client;
export const db = new Databases(client);


creating a listening function and using it in app


function App() {

    useEffect(() => {


        
        const unsubscribe = client.subscribe(`databases.${IDs.DatabaseId}.collections.${IDs.collectionId}.documents`, response => {

            console.log(response);

        });
        unsubscribe();
    }, []);

}



👍 Expected behavior

it should console log a response

👎 Actual Behavior

it will only work ( only on the web) if i use this
import { Client ,Databases} from 'appwrite';
instead of this
import { Client ,Databases} from 'react-native-appwrite';
the error :
image_2024-07-18_031948457

🎲 Appwrite version

Version 0.10.x

💻 Operating system

Windows

🧱 Your Environment

No response

👀 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions