Keep notification on lock screen

时光总嘲笑我的痴心妄想 提交于 2019-12-13 19:51:04

问题


How can I keep the notifications from my app on the lockscreen, until the user has interacted with it?

What I mean is, even if the user unlocks the phone and than locks it again, I would like to have the notification show up again and again on their lockscreen until they finally taken an action with it.

The iOS Reminders app is a great example.

Thanks!


回答1:


until they finally taken an action with it

this would be annoying to the user to say the least. First you need a way to know if the user has interacted with your notification or not. See here How to Implement iOS8 Interactive Notification

Once you have implemented code above then since you want the reminder to keep poping-up over and over again, I would suggest create like 10 local notifications 5 minutes apart for each reminder. Once the user interact with any one of them then cancel all reminders.

Does it makes sense?




回答2:


Apple's applications can do this because they are using private APIs.

You cannot force a notification to show up on the screen, specially after a user has unlocked their device.

Yes you could do local notifications that force it to show up again, but Apple is probably not going to be too happy with this setup.



来源:https://stackoverflow.com/questions/37174001/keep-notification-on-lock-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!