Generate and submit registrationId, fixes #25

If we're expecting to get registrationIds from others, it's only fair
that we also supply our own.
This commit is contained in:
lilia 2014-05-13 20:07:31 -07:00
parent 5752a772d1
commit e3b00e08f3
2 changed files with 7 additions and 4 deletions

View file

@ -103,7 +103,7 @@ var API = new function() {
};
this.confirmCode = function(code, number, password,
signaling_key, single_device,
signaling_key, registrationId, single_device,
success_callback, error_callback) {
var call = single_device ? 'accounts' : 'devices';
var urlPrefix = single_device ? '/code/' : '/';
@ -115,8 +115,9 @@ var API = new function() {
user : number,
password : password,
jsonData : { signalingKey : btoa(getString(signaling_key)),
supportsSms : false,
fetchesMessages : true },
supportsSms : false,
fetchesMessages : true,
registrationId: registrationId},
}).then(function(response) {
if (success_callback !== undefined)
success_callback(response);