当不使用应用程序时发送通知?
我的一个客户的问题是,如果在一定时间之前没有进入工作时间,他们是否可以在员工应用程序中发送推送通知。
是否可以为Android和iOS应用程序创建服务,该服务是否每小时都在数据库中输入,并发送推送通知?
我不知道从哪里开始,以及是否可能。但是,如果其他应用程序可以做到,那么此应用程序也应该有可能。
A client of mine had the question of whether it is possible to send a push notification in the employee app if they have not entered their hours by a certain time.
Is it possible to create a service for Android and iOS apps that checks every hour if the hours of the day have been entered in the database, and if not then send a push notification?
I don't know where to start, and if it is possible. But if other apps can do it, it should be possible with this app as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如@silverwarior所暗示的那样,我创建了两个代码,当应用程序进入后台时,当应用程序转到前景时,我会清理
tnotificationcenter
。我已经使用了Appevent
函数来触发EnterDbackground
和willbecomeforground
。令人振奋的代码看起来像这样:
我使用ongreate事件征求许可来发送通知并触发稳固的事件。
我已经测试了此代码,对我来说,这很好。
As @SilverWarior Suggests I have created two pieces of code one makes the notifications when the app goes to the background then when the app goes to the foreground I clear
Tnotificationcenter
. I've used theappevent
function to trigger theenterdbackground
andwillbecomeforground
.The Appevent code looks like this:
I use the OnCreate event for asking permission for sending notifications and trigger the AppEvent.
I have tested this code and for me, this works perfectly.