使用PARSE iOS禁用振动以进行推送通知

时间:2014-11-03 20:55:01

标签: parse-platform

有没有办法在使用Parse for iOS接收推送时禁用振动和声音?

我希望不要发出声音或振动,只是出现在接收设备上。

非常感谢!

2 个答案:

答案 0 :(得分:0)

请从发送推送通知的服务器上的代码中删除声音参数 e。

{
    "aps": {
        "badge": 15,
        "alert": "Hello World",
        **"sound": "push.caf" // Remove this sound paramter**
    }
}

答案 1 :(得分:0)

如果您使用的是Objective C,则需要将其从AppDelegate.m中删除,并在其中注册通知。您的代码应该是类似

的内容
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];

您可以从此处删除声音以阅读

[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];

希望这有帮助