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
2067c6d8
Commit
2067c6d8
authored
Jul 29, 2018
by
zeynel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new player endpoints
parent
907fb355
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
client.js
lib/client.js
+45
-0
No files found.
lib/client.js
View file @
2067c6d8
...
...
@@ -308,4 +308,49 @@ Client.prototype.csvExport = function (body, callback) {
return
basicRequest
(
csvUri
,
this
.
app
.
appAuthKey
,
'POST'
,
body
,
callback
);
};
/**
*
* @param playerId Id of the player
* @param body
* @param callback
* @returns {*}
*/
Client
.
prototype
.
newSession
=
function
(
playerId
,
body
,
callback
)
{
if
(
!
this
.
app
)
{
throw
'You must define an "app" object.'
}
var
requestUri
=
this
.
API_URI
+
constants
.
DEVICES_PATH
+
'/'
+
playerId
+
'/on_session'
;
return
basicRequest
(
requestUri
,
this
.
app
.
appAuthKey
,
'POST'
,
body
,
callback
);
};
/**
*
* @param playerId
* @param body
* @param callback
* @returns {*}
*/
Client
.
prototype
.
newPurchase
=
function
(
playerId
,
body
,
callback
)
{
if
(
!
this
.
app
)
{
throw
'You must define an "app" object.'
}
var
requestUri
=
this
.
API_URI
+
constants
.
DEVICES_PATH
+
'/'
+
playerId
+
'/on_purchase'
;
return
basicRequest
(
requestUri
,
this
.
app
.
appAuthKey
,
'POST'
,
body
,
callback
);
};
/**
*
* @param playerId
* @param body
* @param callback
* @returns {*}
*/
Client
.
prototype
.
incrementSessionLength
=
function
(
playerId
,
body
,
callback
)
{
if
(
!
this
.
app
)
{
throw
'You must define an "app" object.'
}
var
requestUri
=
this
.
API_URI
+
constants
.
DEVICES_PATH
+
'/'
+
playerId
+
'/on_focus'
;
return
basicRequest
(
requestUri
,
this
.
app
.
appAuthKey
,
'POST'
,
body
,
callback
);
};
module
.
exports
=
Client
;
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