你能用你的声音回答推送通知吗?

时间:2014-03-12 06:01:29

标签: iphone ipad ios7

你可以用你的声音回答推送通知吗?因此,当您锁定iPhone并获得推送通知时,您是否可以用语音对其做出反应?

2 个答案:

答案 0 :(得分:0)

您尚未在应用中注册音频推送通知。只需在App Delegate中注册它:

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    //Whatever you have already in your app delegate...

    // Let device know you're going to be sending one of these types of notifications.
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
        (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

    return YES;
}

这5种类型是:

  • UIRemoteNotificationTypeBadge
  • UIRemoteNotificationTypeSound
  • UIRemoteNotificationTypeAlert
  • UIRemoteNotificationTypeNone
  • UIRemoteNotificationTypeNewsstandContentAvailability

以下是文档:Registering for Remote Notifications

也引用此documents

希望有所帮助!

答案 1 :(得分:-1)

您无法在推送通知中播放语音。推送通知有效负载不包含您的语音。 用户通过以下方式查看通知:

  • 显示提醒或横幅
  • 标记应用的图标
  • 播放声音。

根据苹果推送通知文件 enter image description here