Code Monkey home page Code Monkey logo

Comments (5)

Alwinseb01 avatar Alwinseb01 commented on May 28, 2024

I would like to work on this issue please

from sdk-for-web.

stnguyen90 avatar stnguyen90 commented on May 28, 2024

This is where the error occurs:

window.location.href = uri.toString();

Looks like href is read only in react native

from sdk-for-web.

khanghk avatar khanghk commented on May 28, 2024

I try but don't show login form of google. Please check. Thanks

from sdk-for-web.

DiegoBM avatar DiegoBM commented on May 28, 2024

React-native can't just open a web url. The Appwrite SDK was designed for web browsers, which make redirections, and for that reason certain parts like OAuth authentication won't work out of the box in react-native. There are a few ways around this though:

  1. As far as I know, the recommended way to do OAuth authentication in mobile is by triggering the phone's external browser to do the authentication and go back to your app with the token. There are libraries that do this such as "react-native-app-auth". but bear in mind that, as of today, it will require some configuration on your app, although you can find all the steps in their github page.
  2. You can roll out your own OAuth implementation by adding a WebView into your app and capturing the redirections. This is not recommended anymore though, due to potential security implications, and certain providers like Facebook have started to try to prevent developers from using this method (although at the moment can still be overridden)
  3. If you choose to go with option 2. I created long ago a react-native component that implements the OAuth flow over a WebView and should work with the latest Appwrite version as of December 2022. You can find it here "react-native-appwrite-oauth".

Hope this helps

Note: this might be relevant for issue #1177797467

from sdk-for-web.

 avatar commented on May 28, 2024

I was looking for a solution to avoid closed common other backend services.
I think AppWrite is doing that well and it would be so useful if AppWrite supports oauth with reactive-native in the future.

from sdk-for-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.