fovea_context_engine
Version:
Fovea Context Engine Plugin
71 lines (66 loc) • 3.46 kB
JavaScript
var fovea = {
initialize: function(appKey, clientKey, args, successCallback, errorCallback) {
cordova.exec(
successCallback, // success callback function
errorCallback, // error callback function
'FoveaMCM', // mapped to our native Java class called "FoveaMCM"
'initializeFovea',
[{ // and this array of custom arguments to create our entry
"appKey": appKey, // App key obtained by Fovea portal (http://cogknit.com)
"clientKey": clientKey,
"services": args // ["APPS","PEOPLE","SMS","HISTORY","LOCATION","FB"]
}]
);
},
setCustomerProfile: function(userName, uniqueUserID, emailId, phoneNo, gender, dob, successCallback, errorCallback) {
var properties = {
"uniqueUserID":uniqueUserID, //"35671"
"userName":userName, //"John"
"emailId":emailId, //"john@domain.com"
"phoneNo":phoneNo, //"324-443-4444"
"gender":gender, //{0- Undisclosed, 1-Male, 2-Female, 3-Other}
"dob":dob //"dd/mm/yyyy"
};
cordova.exec(
successCallback, // success callback function
errorCallback, // error callback function
'FoveaMCM', // mapped to our native Java class called "FoveaMCM"
'setCustomerProfile', // with this action name
[properties] //The arguments dict
);
},
setFBToken: function(token, successCallback, errorCallback) {
cordova.exec(
successCallback, // success callback function
errorCallback, // error callback function
'FoveaMCM', // mapped to our native Java class called "FoveaMCM"
'setFBToken', // with this action name
[{ // the argument for token
"access_token": token
}]
);
},
getAppInvitees: function(successCallback, errorCallback) {
cordova.exec(
successCallback, // success callback function
errorCallback, // error callback function
'FoveaMCM', // mapped to our native Java class called "FoveaMCM"
'getAppInvitees', // with this action name
[]
);
},
proceedWithAppInvites: function(approvedItems, declinedItems, invitationMsg, successCallback, errorCallback) {
cordova.exec(
successCallback, // success callback function
errorCallback, // error callback function
'FoveaMCM', // mapped to our native Java class called "FoveaMCM"
'proceedWithAppInvites', // with this action name
[{
"approvedList": approvedItems, // The approved items list
"declinedList": declinedItems, // The declined items list
"invitationMsg": invitationMsg // The invitation message
}]
);
}
};
module.exports = fovea;