解锁 iPhone 时推送通知警报会打开应用程序

发布于 2024-09-27 11:47:40 字数 298 浏览 0 评论 0原文

我看到一个非常奇怪的行为,我试图了解它是否是这样设计的,或者只是没有从我的应用程序中正确处理。

我的应用程序以 UIAlertViews 的形式发送推送通知。 当设备未锁定时, UIAlertViews 会显示两个按钮,如果用户点击右侧按钮,我的应用程序就会启动。

我注意到,如果设备黑屏以节省电量,并且用户点击主页按钮,并且我的应用程序会发出推送通知警报,只有“确定”按钮在那里等待他,如果他滑动解锁设备他自动进入我的应用程序。

这是正常行为还是某种错误?我认为只有带有两个按钮的 UIAlertViews 才允许用户启动应用程序。

I see a very weird behavior and I am trying to understand if it is designed that way or simply not handled correctly from my app.

My app sends push notifications in the form of UIAlertViews.
When the device is not locked the UIAlertViews appear with two buttons and if the user taps on the right button my app is launched.

What I have noticed is that if the device is black screened to save power and the user taps on the home button and there is a push notification alert from my app with only the OK button waiting for him there, if he slides to unlock the device he automatically enters my app.

Is that a normal behavior or a bug of some sorts? I thought that only UIAlertViews with two buttons allow the user to launch the app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

贱人配狗天长地久 2024-10-04 11:47:40

如果推送通知消息发送到锁定的手机,它会在那里停留大约五分钟。当用户滑动解锁时,发送通知的应用程序将被打开。

这是默认行为,看看短信应用程序和日历应用程序如何执行相同的操作。

If a push-notification-message gets sent to a locked phone, it stays there for about five minutes. When the user slides to unlock, the app that sent the notification is opened.

This is default behavior, look at how the SMS-app and Calendar-app does the same.

鹿港小镇 2024-10-04 11:47:40

对于我(OS 4.1)来说,正常行为是推送通知来打开屏幕并显示没有按钮的警报;滑块显示“滑动到动词”。如果手机返回睡眠状态并再次唤醒(通过等待或按下睡眠开关),它会显示“滑动解锁”,并且解锁不会启动应用程序。

我没有看到“确定”按钮(也许这是 OS 4.2 的一项功能;如果是这样,请不要在这里讨论它)。

无论哪种方式,用户只有三个选择:

  • 不解锁手机
  • 解锁手机并忽略通知
  • 解锁手机并启动应用程序

让用户在选择如何处理通知之前解锁会增加不必要的步骤,并让用户在不解锁手机的情况下点击 VERB 按钮有点傻。常见的情况是用户希望立即查看通知(并回复文本或其他内容)。不常见的情况是用户想要忽略通知(因此按确定然后解锁,或睡眠/唤醒然后解锁,或解锁并立即关闭应用程序)。如果通知很麻烦,那么用户只需针对特定应用程序禁用它们即可。

For me (OS 4.1), normal behaviour is for a push notification to unblank the screen and show an alert with no buttons; the slider says "slide to VERB". If the phone goes back to sleep and is woken again (either by waiting or by hitting the sleep switch), it then says "slide to unlock" and unlocking doesn't launch the app.

I don't see an "OK" button (perhaps it's an OS 4.2 feature; if so, don't discuss it here).

Either way, the user only has three choices:

  • Don't unlock the phone
  • Unlock the phone and ignore the notification
  • Unlock the phone and launch the app

Making the user unlock before choosing what to do about the notification adds an unnecessary step, and letting the user tap the VERB button without unlocking the phone is a bit silly. The common case is that the user will want to immediately view the notification (and reply to the text or whatever). The uncommon case is that the user will want to ignore the notification (so press OK and then unlock, or sleep/wake and then unlock, or unlock and immediately close the app). If the notifications are a nuisance, then the user will simply disable them for the particular app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文