PHP Class OneSignal\Devices

Exibir arquivo Open project: norkunas/onesignal-php-api

Protected Properties

Property Type Description
$api

Public Methods

Method Description
__construct ( OneSignal $api )
add ( array $data ) : array Register a device for your application.
csvExport ( array $extraFields = [] ) : array Export all information about devices in a CSV format for your application.
getAll ( integer $limit = self::DEVICES_LIMIT, integer $offset ) : array Get information about all registered devices for your application.
getOne ( string $id ) : array Get information about device with provided ID.
onFocus ( string $id, array $data ) : array Increment the device's total session length.
onPurchase ( string $id, array $data ) : array Track a new purchase.
onSession ( string $id, array $data ) : array Call on new device session in your app.
update ( string $id, array $data ) : array Update existing registered device for your application with provided data.

Protected Methods

Method Description
resolve ( array $data, callable $callback = null )

Method Details

__construct() public method

public __construct ( OneSignal $api )
$api OneSignal

add() public method

Register a device for your application.
public add ( array $data ) : array
$data array Device data
return array

csvExport() public method

Application auth key must be set.
public csvExport ( array $extraFields = [] ) : array
$extraFields array Additional fields that you wish to include. Currently supports: "location", "rooted"
return array

getAll() public method

Application auth key must be set.
public getAll ( integer $limit = self::DEVICES_LIMIT, integer $offset ) : array
$limit integer Results offset (results are sorted by ID)
$offset integer How many devices to return (max 300)
return array

getOne() public method

Get information about device with provided ID.
public getOne ( string $id ) : array
$id string Device ID
return array

onFocus() public method

Increment the device's total session length.
public onFocus ( string $id, array $data ) : array
$id string Device ID
$data array Device data
return array

onPurchase() public method

Track a new purchase.
public onPurchase ( string $id, array $data ) : array
$id string Device ID
$data array Device data
return array

onSession() public method

Call on new device session in your app.
public onSession ( string $id, array $data ) : array
$id string Device ID
$data array Device data
return array

resolve() protected method

protected resolve ( array $data, callable $callback = null )
$data array
$callback callable

update() public method

Update existing registered device for your application with provided data.
public update ( string $id, array $data ) : array
$id string Device ID
$data array New device data
return array

Property Details

$api protected_oe property

protected $api