[英]Can I use an Android Push Notification to set a value in my Android App
I have an Android App I am building and I want to do something similar to what iOS does when you push a notification the app will launch in the background and perform a task then go back to sleep. 我有一个正在构建的Android应用程序,我想做的事情类似于iOS,当您推送通知时,该应用程序将在后台启动并执行任务,然后返回睡眠状态。 I want to do this be cause I need to set a application value that tracks new content added since the last time the user opens my app.
之所以要这样做,是因为我需要设置一个应用程序值,以跟踪自用户上次打开我的应用程序以来添加的新内容。
So if I send 3 push notifications and 2 are notifying the user about new content in area "A" and the other is notifying the user about new content in a area "B", then I want to increment some application values every time a notification is received. 因此,如果我发送3个推送通知,而2个正在通知用户“ A”区域中的新内容,而另一个正在通知用户有关“ B”区域中的新内容,那么我想每次通知时增加一些应用程序值收到。 Then when the app opens I can bring attention to the areas with updated content.
然后,当应用程序打开时,我可以引起注意具有更新内容的区域。
If there isn't a way to do this with push notifications I could always set up some sort of update reference table that my app would have to check upon opening to get the update counts since last launch. 如果没有办法通过推送通知执行此操作,那么我总是可以设置某种更新参考表,我的应用程序在打开时必须进行检查以获取自上次启动以来的更新计数。
Thanks, Fissh 谢谢菲丝
Yes you can do this all. 是的,您可以全部完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.