Authentication

The authentication is for after user object synced with CloadIO and the app.auth.user will be set.

Notice

Pay attention, after user logged in app, the app.auth.user object will be set.

app.auth.onCompleted()

After user object synced with CloadIO, actually user authentication was completed and app.auth.onCompleted event will be run so user can see app.

  • Type: Function

    app.auth.onCompleted = function () {};

  • Example
    Performing a completed authentication function configuration inside the app.js:
    // called when user object synced with cloadio
    app.auth.onCompleted = function () {
        if (app.auth.user.name)
            homePage.show();
    };

app.auth.sms.onReceived()

The app.auth.sms.onReceived event is called when sms received in app and this event is for handle.

Notice

Running sms in the app is when authentication is completed.

  • Type: Function

    app.auth.sms.onReceived = function (text, sender) {};

  • Detail

    The app.auth.sms.onReceived run after received a sms on FrameworkJS project. It has two parameters, the first is content of sms and the next one is about sender of sms.

    Parameters Type Description
    text String Contain of message text.
    sender String Contain sender of short message.
  • Example
    Performing an onSynced function configuration inside the app.js:
    // on sms received event
    app.auth.sms.onReceived = function (text, sender) {
        // show the message and sender every where that need
    };