For the past 6 months i’ve being trying to implement Realm on my react native app with typescript. I followed tutorials and read the documentation multiple times, i even cloned there original tutorial to try it out and to my surprise the app didn’t work, it throw addItemTask is not a function.
I’ve tried stack-overflow for help and no one came to the rescue. I tried github yet no one help me there. I’ve given up on trying to integrate my app using realm or mongo technologies as the community and support is scares.
Now i don’t know what to do as my app requires an offline database and sync capabilities.
if there’s anyone out the who can help understand realm with react native please help me, i’m out of options and my anxiety levels have went up 100%.
I’m trying to add/save inventory items on atlas whenever the user has an internet connection, however if the user is offline i want the data to be stored on the phone and synced to realm whenever the user goes online.
i created my getRealmApp.ts as follows:
and wrote my schema file as follows:
and in my component i imported the realm app like this:
const app = getRealmApp()
and the fuction below was to test the login and to try and save those items on the database:
when i run the save function i get: ERROR: Connection[1]: Websocket: Expected HTTP response 101 Switching Protocols, but received: HTTP/1.1 401 Unauthorized cache-control: no-cache, no-store, must-revalidate connection: close content-length: 190 content-type: application/json date: Mon, 01 Feb 2021 17:06:02 GMT server: envoy vary: Origin x-envoy-max-retries: 0 x-frame-options: DENY
and the other error is
Error opening realm: {}
and now when i anonymously i can not find the user created
please feel free to let me know if i’m implement things wrongfully
Interesting… The code you’ve posted seems correct - can you check if there are any error logs on the server? Those might shed more light as to why the user is considered unauthorized. Additionally - do you have any access rules defined on the server? It could be that the user doesn’t have permission to access that partition.