タグ「iOS」が付けられているもの
Amazon Web Services: SNS
JSON Publish 例
- {
- "default": "<enter your message here>",
- "email": "<enter your message here>",
- "sqs": "<enter your message here>",
- "http": "<enter your message here>",
- "https": "<enter your message here>",
- "sms": "<enter your message here>",
- "APNS": "{\"aps\":{\"alert\": \"<message>\",\"sound\":\"default\"} }",
- "APNS_SANDBOX": "{\"aps\":{\"alert\": \"<message>\",\"sound\":\"default\"} }",
- "GCM": "{ \"data\": { \"message\": \"<message>\" } }",
- "ADM": "{ \"data\": { \"message\": \"<message>\" } }"
- }
APNS だと sound が使える。
/* iOS8より、registerForRemoteNotificationTypesは、使えない。
[[UIApplication sharedApplication]registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
return YES;
*/
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
return YES;