When you request that a push notification be sent to your app on devices, an Usergrid notifier carries the request to the notification service (Google GCM or Apple APNs).
A notifier is represented by an entity in your Usergrid application (see the API Docs for reference information). It carries the credentials that authorize your request. Once a notification service has verified that your notifier contains valid credentials, it will forward your push notification to your app on devices.
You can create a notifier in two ways: using the admin portal and programmatically.
To create a notifier, you must first register your app with the appropriate notification service, as described in Registering with a notification service.
To create a notifier with the admin portal, do the following:
The fields are different depending on whether you are on the Apple or Android tab:
Fields for Apple
Fields for Android
You can create an App BaaS notifier programmatically by sending requests to the Usergrid API.
curl -X POST -i -H "Accept: application/json" -H "Accept-Encoding: gzip, deflate" -H "Authorization: Bearer YWMtFeeWEMyNEeKtbNX3o4PU0QAAAT8vzK3xz3utVZat0CosiYm75C2qpiGT79c" -F "name=applenotifier" -F "provider=apple" -F "environment=development" -F "p12Certificate=@/Users/me/dev/pushtest_dev.p12" 'https://api.usergrid.com/my-org/my-app/notifiers'
curl -X POST "https://api.usergrid.com/my-org/my-app/notifiers" -d '{"name":"androiddev", "provider":"google", "apiKey":"AIzaSyCkXOtBQ7A9GoJsSLqZlod_YjEfxxxxxxx"}'
The following are the available notifier endpoints. For details on notifier properties, see the API Docs.
Base URL: https://api.usergrid.com/my-org/my-app/
Working with one or more notifiers:
/notifiers
Working with notifiers associated with specific devices:
/devices/{device-id}/notifier