且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS后台服务震动手机

更新时间:2022-01-02 22:59:25

如果您尝试向用户提供在您的应用在后台运行时通知某些内容,请考虑使用本地通知提供该信息(请参阅 UILocalNotification 。)

If you're trying to provide the user with a notification of something while your app is running in the background, consider delivering that information using a Local Notification (see UILocalNotification.)

由于以下几个原因,强迫手机振动并不是一个很好的用户体验:

Forcing the phone to vibrate is not a great user experience for a few reasons:


  • 一些用户(包括我自己)在静音模式下禁用振动

  • iPad和iPod触摸不振动

  • 用户可能不知道是什么原因导致振动或声音,可能无法实现打开你的应用程序

本地通知以他们可以控制和识别的方式显示给用户。

Local notifications appear to the user in a manner that they can control and will recognize.

如果你的意图是某种意思除了通知用户之外,请将其添加到您的问题&我会尽力帮忙。

If your intention is something besides notifying the user, add that to your question & I'll try to help.