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
586c1f1e
Unverified
Commit
586c1f1e
authored
Oct 13, 2018
by
zeynel
Committed by
GitHub
Oct 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18 from jwilm/fix-edit-device
Fix bug with several endpoints not including app_id
parents
0168b473
13c486cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
client.js
lib/client.js
+12
-0
No files found.
lib/client.js
View file @
586c1f1e
...
@@ -276,6 +276,9 @@ Client.prototype.editDevice = function (deviceId, body, callback) {
...
@@ -276,6 +276,9 @@ Client.prototype.editDevice = function (deviceId, 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
;
}
return
basicRequest
(
this
.
API_URI
+
constants
.
DEVICES_PATH
+
'/'
+
deviceId
,
this
.
app
.
appAuthKey
,
'PUT'
,
body
,
callback
);
return
basicRequest
(
this
.
API_URI
+
constants
.
DEVICES_PATH
+
'/'
+
deviceId
,
this
.
app
.
appAuthKey
,
'PUT'
,
body
,
callback
);
};
};
...
@@ -319,6 +322,9 @@ Client.prototype.newSession = function (playerId, body, callback) {
...
@@ -319,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
);
};
};
...
@@ -334,6 +340,9 @@ Client.prototype.newPurchase = function (playerId, body, callback) {
...
@@ -334,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
);
};
};
...
@@ -349,6 +358,9 @@ Client.prototype.incrementSessionLength = function (playerId, body, callback) {
...
@@ -349,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