2017-05-02 7 views
0

をIOSリモート通知を受信して​​います。以下は、私はこのRemove sound from notificationを呼ば音についてAppDelegate、私は、私のアプリの設定を持っているという点で、私も</strong>オフ</strong>と<strong>で<strong>音</strong>と<strong>振動</strong>を<strong>を回すためのトグルボタンを持って迅速

let notificationTypes: UIUserNotificationType = [UIUserNotificationType.Alert, UIUserNotificationType.Sound] 
    let pushNotificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories: nil) 
    application.registerUserNotificationSettings(pushNotificationSettings) 
    application.registerForRemoteNotifications() 

でリモート通知を登録するための私のコードはあるが、それは動作するようですdoes'nt。

のWhatsAppは、この機能を持つので、確かにそれはおそらく

になります誰もがこれに助言してくださいことはできますか?

答えて

4

JSONペイロードから健全なKey-Valueを削除してください。

私はちょうどそれをチェックしました。わたしにはできる。

{"aps":{"alert":"Enter your message","badge":1}} 
+1

ありがとう:-)それは動作します。バイブレーションについて考えていますか? –

+0

電話が鳴っているときに私は振動を感じていませんでした。 –

+0

はい、しかし、電話の設定で振動がオンになっていると、振動しています。振動していないと、振動していません。アプリ内で振動を処理する方法はありますか?私はWhatsappでこれを見ました –

関連する問題