2014-03-12 41 views

回答

-1

您無法在推送通知中播放語音。推送通知有效負載不包含您的語音。 用戶可以看到通過以下方式通知:

  • 顯示警告或橫幅
  • 徽章的應用程序的圖標
  • 播放聲音。

據蘋果推送通知文件 enter image description here

0

你不是註冊在您的應用程序的音頻推送通知。只需在應用程序委託登記這樣的:

- (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

希望幫助!

+0

@Rushabh ......那個答案是什麼... ...? – Raju