Commit 13c486cc authored by Joe Wilm's avatar Joe Wilm

Add app_id to other POST requests requiring it

parent 602166df
...@@ -322,6 +322,9 @@ Client.prototype.newSession = function (playerId, body, callback) { ...@@ -322,6 +322,9 @@ Client.prototype.newSession = function (playerId, body, callback) {
if (!this.app) { if (!this.app) {
throw 'You must define an "app" object.' throw 'You must define an "app" object.'
} }
if (!('app_id' in body)) {
body.app_id = this.app.appId;
}
var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_session'; var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_session';
return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback); return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback);
}; };
...@@ -337,6 +340,9 @@ Client.prototype.newPurchase = function (playerId, body, callback) { ...@@ -337,6 +340,9 @@ Client.prototype.newPurchase = function (playerId, body, callback) {
if (!this.app) { if (!this.app) {
throw 'You must define an "app" object.' throw 'You must define an "app" object.'
} }
if (!('app_id' in body)) {
body.app_id = this.app.appId;
}
var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_purchase'; var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_purchase';
return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback); return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback);
}; };
...@@ -352,6 +358,9 @@ Client.prototype.incrementSessionLength = function (playerId, body, callback) { ...@@ -352,6 +358,9 @@ Client.prototype.incrementSessionLength = function (playerId, body, callback) {
if (!this.app) { if (!this.app) {
throw 'You must define an "app" object.' throw 'You must define an "app" object.'
} }
if (!('app_id' in body)) {
body.app_id = this.app.appId;
}
var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_focus'; var requestUri = this.API_URI + constants.DEVICES_PATH + '/' + playerId + '/on_focus';
return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback); return basicRequest(requestUri, this.app.appAuthKey, 'POST', body, callback);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment