Skip to content

Commit

Permalink
Add a new call to register habitica users
Browse files Browse the repository at this point in the history
Uses the newly fixed communication code in
e-mission/cordova-server-communication#12
to make a user authenticated HTTP POST call to the server with the habitica username
  • Loading branch information
shankari committed Jul 7, 2016
1 parent 9ffcf0b commit 21e29bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions www/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ angular.module('emission.services', [])
var dateString = date.startOf('day').format('YYYY-MM-DD');
window.cordova.plugins.BEMServerComm.getUserPersonalData("/timeline/getTrips/"+dateString, successCallback, errorCallback);
};

/*
* var regConfig = {'username': ....}
* Other fields can be added easily and the server can be modified at the same time.
*/
this.habiticaRegister = function(regConfig, successCallback, errorCallback) {
var dateString = date.startOf('day').format('YYYY-MM-DD');
window.cordova.plugins.BEMServerComm.postUserPersonalData("/habiticaRegister", "regConfig", regConfig, successCallback, errorCallback);
};
})

.service('ControlHelper', function($cordovaEmailComposer) {
Expand Down

0 comments on commit 21e29bd

Please sign in to comment.