SetupPushNotification
Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device Messaging is not supported.
Request Details
When using the Apple Push Notification service (APNS) or the development version (APNS_SANDBOX), the APNS Private Key should be used as the Credential in this call. With Google Cloud Messaging (GCM), the Android API Key should be used. The current ARN (if one exists) can be overwritten by setting the OverwriteOldARN boolean to true.
SetupPushNotificationRequest
Request Properties |
---|
Credential (required) StringCredential is the Private Key for APNS/APNS_SANDBOX, and the API Key for GCM |
Key Stringfor APNS, this is the PlatformPrincipal (SSL Certificate) |
Name (required) Stringname of the application sending the message (application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long) |
OverwriteOldARN (required) Booleanreplace any existing ARN with the newly generated one. If this is set to false, an error will be returned if notifications have already setup for this platform. |
Platform (required) PushSetupPlatformsupported notification platforms are Apple Push Notification Service (APNS and APNS_SANDBOX) for iOS and Google Cloud Messaging (GCM) for Android |
Sample Request
POST https://{{TitleID}}.playfabapi.com/Admin/SetupPushNotification
Content-Type: application/json
X-SecretKey: <developer_secret_key>
{
"Name": "My Game",
"Platform": "APNS_SANDBOX",
"Key": "MyKey123",
"Credential": "MyCredentialsXYZ",
"OverwriteOldARN": false
}
Response Details
SetupPushNotificationResult
Result Properties |
---|
ARN StringAmazon Resource Name for the created notification topic. |
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"code": 200,
"status": "OK",
"data": {
"ARN": "arn:aws:iam::123456789012:user/David"
}
}
Authentication
SecretKey
Possible Error Codes
Name | Code |
---|---|
PushServiceError | 1095 |
ValueAlreadyExists | 1031 |