Search code examples
iosiphoneswiftusernotifications

Is it possible to vibrate only on Push Notifications in iOS?


I know how to use vibrate in in the foreground. I want to know how to use it in the background...

I searched a lot in stackoverflow but I didn't find the right answer, only an answer from 2011, where you use a silent soundfile (vibrate in push notification).

If the sound of the iPhone is turned on, can you make the iPhone vibrate only on a push notification? Is the silent soundfile the only way to do this?


Solution

  • Including the silent sound file to vibrate still works with iOS11.

    Make sure you request the sound attribute for your notifications.