setApplicationAndUserKeys()

This method contains the mandatory, app-specific information required for successful user logins.

  • If your app's users can log in successfully each time they access your app, then they have access to its functionality. If they instead encounter problems on login, they are going to be less willing to try a second and third time.
  • Once users have logged in, you have access to powerful statistics that reveal, for example:
    • User Profiling information: whether users are New, Returning or VIP
    • App Usage information: how long users spend on each app (Time on App), how many active users there are (Daily Active Users) or how many sessions there are (Daily Sessions)
    • User-specific information can also be used to improve CRM services by adding Contacts to more relevant App Groups, assigning them to Personas or creating new Workflows.

To add the method

  1. Open your project.
  2. Open one of the following locations:
    • If you want to use this the first time the app is launched, open the app.js file in the js folder app.js
    • If you want to use this every time users login, open the login.js file in the js folder
  3. Add the method code:
    window.plugins.hurreSDK.setApplicationAndUserKeys(
        successCallback,
        errorCallback,
        {User Info}
    )
    
  4. Make sure you insert the App Group Identifier and the App Key to the {User Info} object.

Arguments

These are the arguments for method.

  1. successCallback - The Success Callback function is called following a successful login, and includes a success message
  2. errorCallback - The Error Callback function is called in case of an error, and includes an error message
  3. User Info - The {JSON Object}'s keys are listed below

Object Keys

Argument Type Mandatory Description
appGroupIdentifier String Mandatory This is the Application Group Identifier for your app.
appKey String Mandatory This is the Application key.
userId String Optional This is a unique identifier for the user.
deviceToken String Mandatory This it the Device Token.
timerInMinutes String Optional This indicates (in minutes) how frequently data is pushed from SDK to the server. The default (and minimum) is 5 minutes.
firstName String Optional This is the user's First Name.
lastName String Optional This is the user's Last Name.
phoneNumber String Optional This is the user's Phone Number.
email String Optional This is the user's Email Address.
imageUrl String Optional This is the Url of the User's Picture.
gender String Optional This is the user's Gender. The options are: Male or Female.
DOB String Optional This it the user's Date of Birth.

Sample Code

var obj = {
    appGroupIdentifier: "APPLICATION GROUP IDENTIFIER",
    appKey: "APPLICATION KEY",
    userId: "YOUR UNIQUE USER ID",
    deviceToken: "DEVICE TOKEN",
    timerInMinutes: "5",
    firstName: "Amit",
    lastName: "Gupta",
    phoneNumber: "4444444444",
    email : "amit@amit.com",
    imageUrl : "PROFILE IMAGE URL",
    gender: "male",
    DOB: "05/07/1990"
};

window.plugins.hurreSDK.setApplicationAndUserKeys(function(data){
    //success callback function
},
function(err){
    //error callback function
},obj);

results matching ""

    No results matching ""