【发布时间】:2015-01-30 04:46:03
【问题描述】:
我关注了这个tutorial,并按照它所说的那样设置了所有内容,以便在 iOS 上接收推送通知。
我在 Xcode 中设置了didFinishLaunchingWithOptions:
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) {
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeAlert | UIUserNotificationTypeSound) categories:nil]];
[application registerForRemoteNotifications];
} else {
[application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
}
我已注册(我能够获取 deviceToken)并且我可以在发送时从推送通知中获取消息,问题是我无法播放任何通知声音,我的 pusher.php 就像这个:
$body['aps'] = array(
'alert' => $message,
'sound' => "default"
);
我使用的是 iOS 8.1.3
【问题讨论】:
标签: ios ios8 push-notification apple-push-notifications ios8.1