Skip to content

jonas-m-/cordova-plugin-draugiem-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

cordova plugin add https://github.com/jonas-m-/cordova-plugin-draugiem-sdk.git --save --APP_ID=<insertYourAppIdHere>

Usage

// String API key, consisting of exactly 32 characters
var apiKey = "f284ccdf7936b927f4c65d67e5c2fd2b";

DraugiemApi.init(apiKey);

function onLoggedIn(response) {
    // Yay! Login was successful
    console.log(response.apiKey); // string, access token
    console.log(response.user); // object, user data
}

function onLoginFailed(error) {
    console.error(error);
}

DraugiemApi.login(onLoggedIn, onLoginFailed);

Success response structure

Property name Variable type Description Example
apiKey string Access token for accessing data of current user FIXME
user object Data of current user -
user.id int Unique identifier of the user FIXME
user.age int Age in years 24
user.sex string User's gender. Either male or female male
user.name string User's full name Oskars Cerins
user.nick string or null Nickname of the user oskars52
user.city string name of the user's city Riga

About

Draugiem.lv SDK for Cordova

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published