Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
onesignal-node
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Cedar Studios
onesignal-node
Commits
13c486cc
Commit
13c486cc
authored
Oct 08, 2018
by
Joe Wilm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add app_id to other POST requests requiring it
parent
602166df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
client.js
lib/client.js
+9
-0
No files found.
lib/client.js
View file @
13c486cc
...
@@ -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
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment