PHP Class OneSignal\Devices

Afficher le fichier Open project: norkunas/onesignal-php-api

Protected Properties

Свойство Type Description
$api

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
resolve ( array $data, callable $callback = null )

Method Details

__construct() public méthode

public __construct ( OneSignal $api )
$api OneSignal

add() public méthode

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

csvExport() public méthode

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

getAll() public méthode

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)
Résultat array

getOne() public méthode

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

onFocus() public méthode

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

onPurchase() public méthode

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

onSession() public méthode

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

resolve() protected méthode

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

update() public méthode

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
Résultat array

Property Details

$api protected_oe property

protected $api