SignInModule Class
Javascript Module for taking Platform SignIn. Platform SignIn is a SignIn mechanism that use Sign In With Apple
on iOS and Google SignIn
on Android.
Platform SignIn is only available on the mobile target platform (iOS and Android).
You need to add a reference to "Fuse.Auth"
in your project file to use this feature.
For more information on what are the pre-request when implementing
Sign In With Apple
orGoogle 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('useJS/Auth');
function doSignIn() {
Auth.signIn().then(function(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 (ex) {
// failed login
})
}
Auth.hasSignedIn().then(function (result) {
if (result) {
// user has already sign in
}
})
module.exports = {
doSignIn
}
</JavaScript>
<Button Text="Sign In">
<Clicked>
<Callback Handler="{doSignIn}" />
</Clicked>
</Button>
</App
When the callback handler is fired for the first time and the result object of
status
property is true, save those logged user information immediately to the server especially on iOS, because as stated in the documentation on the apple website, the Sign In With Apple will only send userId informataion the next time user do the authentication again
Location
- Namespace
- Fuse
- Package
- Fuse.Auth 2.9.1
Interface of SignInModule
Inherited from NativeModule
AddMember(NativeMember) uno
Reset : EventHandler (object, EventArgs) ux
Inherited from Module
Dispose uno
Evaluate(Context, ModuleResult) uno
Evaluate(Context, string) : ModuleResult uno
Evaluated : EventHandler (object, EventArgs) ux
EvaluateExports(Context, string) : object uno
GetFile : FileSource uno
Returns the file source that will be watched by the Context for changes in Fuse preview. Override in subclasses and return correct file source to support live updates in Fuse preview.