推送通知中不播放声音

Han*_*nXu 3 ios ios7

我正在使用iOS 7,我的推送通知不播放声音.

奇怪的是,我发现我的应用程序的首选项>通知中心没有声音设置.以下是我的应用程序通知中心的屏幕截图: 在此输入图像描述

以下是Skype的内容:

在此输入图像描述

你看,我的应用程序没有"声音"部分.

有人可以帮忙吗?


更新:

现在我在我的应用程序中注册了声音.通知中心现在看起来像: 在此输入图像描述

我的通知有声音.看起来不错.

但是在我输入我的应用程序的设置后,最初有一个像"Skype"这样的"声音"部分,但随后Preference应用程序崩溃了,之后,没有更多的"声音",如下所示: 在此输入图像描述

可能是苹果公司的一个漏洞?

sri*_*jay 6

您尚未在应用中注册音频推送通知.只需在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;
}
Run Code Online (Sandbox Code Playgroud)

这5种类型是:

  1. UIRemoteNotificationTypeBadge
  2. UIRemoteNotificationTypeSound
  3. UIRemoteNotificationTypeAlert
  4. UIRemoteNotificationTypeNone
  5. UIRemoteNotificationTypeNewsstandContentAvailability

这是文档:注册远程通知

希望有所帮助!