Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Platform Sign In #1366

Merged
merged 2 commits into from
Aug 8, 2020
Merged

Introduce Platform Sign In #1366

merged 2 commits into from
Aug 8, 2020

Conversation

ichan-mb
Copy link
Member

@ichan-mb ichan-mb commented Aug 8, 2020

Platform SignIn is a SignIn mechanism that uses Sign In With Apple on iOS and Google SignIn on Android. There is two API added, PlatformSignIn as trigger action and FuseJS/Auth as javascript module.

This module does not provide UI elements of Platform Sign In. (Visual button of Sign In With Apple or Google Sign In Button). Users must design the Sign In Button itself that complies with design guidelines on both platform

For more information on what are the pre-request when implementing Sign In With Apple or Google Sign In, you can check the documentation on the Apple developer website or android developer website

For iOS, add "SystemCapabilities": { "SignInWithApple":true } in the unoproj file.

Example

The following example shows how to use it:

    <App>
        <JavaScript>
            var Auth = require('FuseJS/Auth');

            var signInHandler = function(result) {
                console.dir(result); 
                // result is json object containing these properties :
                // email -> user email that has been sign in / sign up
                // firstName -> User firstname
                // lastName -> User Lastname
                // userId -> User uniqe Id
            } 

            function doSignIn() {
                Auth.signIn().then(signInHandler);
            }

            Auth.hasSignedIn().then(function (result) {
                if (result) {
                    // user has already sign in
                }
            });

            module.exports = {
                doSignIn
            }

        </JavaScript>
        <StackPanel>
            <Button Text="Sign In">
                <Clicked>
                    <Callback Handler="{doSignIn}" />
                </Clicked>
            </Button>
            <Button Text="Sign In Using Trigger Action">
                <Clicked>
                    <PlatformSignIn Handler="{signInHandler}" />
                </Clicked>
            </Button>
        </StackPanel>
    </App

This PR contains:

  • Changelog
  • Documentation
  • Tests

Copy link
Member

@mortend mortend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. Great work!

@mortend
Copy link
Member

mortend commented Aug 8, 2020

@mortend mortend merged commit 1171f7e into fuse-open:master Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants