Coder Social home page Coder Social logo

Comments (2)

tp avatar tp commented on August 16, 2024 2

Hey @m-j-g,

I think the simplest way to make that work would be without Apples JS SDK (https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js), and just render the button in Flutter and then use the same URL-building logic as we do on Android:

// URL built according to https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms#3332113

On click of the button you would open that URL (easiest again probably redirect of the current page, a better experience might be a pop-up/new tab, so the main app doesn't have to reload upon return), and then set a route on your app as the redirect URL.

The redirect URL would need to be able to handle the POST that Apple is sending to your servers.

You can then either handle that directly on the server (and then for example pass down a cookie and the SPA entry page), or somehow pass received POST data to the client, so it would call the same API than the native apps do.

As Apple is always redirecting through the redirect URL, I don't yet know how to make that really nice from a client API perspective (so that the same simple method could be called on all stacks).

Maybe the pop-up / new tab approach can be made to work with the final redirect URL using postMessage to pass the data back to the Flutter app.

Let me know if that helps.

We would love to add nice web integration into this package as well :)

from dart_packages.

m-j-g avatar m-j-g commented on August 16, 2024 1

@tp Really appreciate you taking the time to outline that. I think I understand how this all fits together now, I just need to dig in and start working through it.

from dart_packages.

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.