A library which integrates with the the Redhat Aerogear Unified Push restful API.
$ composer require napp/aerogear-push
All, but SenderPushRequest(), have a OAuthToken dependency, and to generate the token, look in examples/oauth-keycloak.md
An example on how to set the token.
$request->setOauthToken($token);
Example on how to use this library.
<?php
use Napp\AeroGearPush;
use Napp\AeroGearPush\Request;
use Napp\AeroGearPush\Exception;
$client = new AeroGearPush('https://host.com/ag-push/rest/');
$request = new SenderPushRequest();
$request
->setAuth('PushApplicationID', 'MasterSecret')
->setMessage(
[
'sound' => 'default',
'alert' => 'this is a message.',
]
)
->setCriteria(
[
'alias' => ['my-alias'],
]
);
try {
$response = $client->SenderPush($request);
var_dump($response);
} catch (AeroGearPushException $e) {
die($e->getMessage());
}
For information about how to format the single methods which is accepting arrays, please take a look at the AeroGear Unified Push API documentation.
setOauthToken() # oAuth token
setName() # string
setDeveloper() # string
setDescription() # string
The response is handled by createApplication($request)
json
setOauthToken() # oAuth token
setName() # string
setDeveloper() # string
setDescription() # string
The response is handled by createApplication()
json
setOauthToken() # oAuth token
The response is handled by deleteApplication()
json
setOauthToken() # oAuth token
setCertificate() # fopen file resource
setPassphrase() # string
setProduction() # string ('true' or 'false')'
setName() # string
setDescription() # string
setDeveloper() # string
The reponse is handled by createIosVariant($request)
json
setOauthToken() # oAuth token
setName() # string
setDescription() # string
setDeveloper() # string
setProjectNumber() # string
The response is handled by createSimplePushVariant()
json
setOauthToken() # oAuth token
setGoogleKey() # string
setName() # string
setDescription() # string
setDeveloper() # string
setProjectNumber() # string
The response is handled by createAndroidVariant()
json
Aerogear Unified Push documentation
setAuth(pushApplicationId, masterSecret)
setMessage() # array
setCriteria() # array
setConfig() # array
The response is handled by senderPush()
json
setOauthToken() # oAuth token
setVariantId() # string
setInstallationId() # string
The response is handled by getApplicationInstallation()
json
setOauthToken() # oAuth token
setPageNumber() # integer
setPerPage() # integer
enableDeviceCount()
enableActivity()
The reponse is handled by getApplication()
json
setOauthToken() # oAuth token
setPageNumber() # integer
setPerPage() # integer
The response is handled by metricsMessages()
json
setOauthToken() # oAuth token
setType() # string {active, warnings}
The response is handled by metricsDashboard()
json
setOauthToken() # oAuth token
The response is handled by sysInfoHealth()
json
-
1.0.2
- Added bulk import of device tokens
- Bugfix: typo
-
1.0.1
- Fixed wrong casing for
AbstractApplicationRequest
- Fixed wrong casing for
-
1.0
- init
MIT, see LICENSE.