简体   繁体   English

使用Delphi处理应用不在前台时的Android Push通知

[英]Handling Android Push notifications when app is not in the foreground using Delphi

My understanding is to receive the data from push notifications while the app is in the background or not running, one need a service which will put the data somewhere where the app can get at them when it starts up or goes to the foreground. 我的理解是在应用程序处于后台或未运行时从推送通知中接收数据,需要一种服务,该服务会将数据放置在应用程序启动或进入前台时可以到达的位置。 It appears that a common solution is to put the data into the app's Extras. 似乎常见的解决方案是将数据放入应用程序的Extras。

There are plenty of references for Java but my google-fu fails to find an implementation guide for Delphi. Java有很多参考资料,但是我的Google-fu无法找到Delphi的实施指南。

Also useful would be information on how to "Stack" the notifications into a single notification. 关于如何将通知“堆叠”为单个通知的信息也很有用。

I imagine one could write a single service which is triggered each time a notification arrives, and which then a) puts the data portion of the notification into the app's extras, and b) replaces the notification with a single stacked notification. 我想人们可以编写一个服务,该服务在每次到达通知时都会触发,然后将a)将通知的数据部分放入应用程序的附件中,然后b)用一个堆叠的通知替换该通知。

My question is "how does one write this service" - some template code would help, and tutorials or reference documents would be great. 我的问题是“如何编写此服务”-一些模板代码会有所帮助,并且教程或参考文档会很棒。

FWIW this is for an app with a chat like feature where one doesn't want any notifications to get lost. FWIW这是一款具有类似聊天功能的应用程序,该应用程序不希望任何通知丢失。

One thing at a time... here's a guide for implementing a service on Android . 一次一件事... 这是在Android上实现服务的指南

Full disclosure: I've no idea how effective or useful it is or how complete (or otherwise) Delphi capabilities for Android services are since I use Oxygene for Android development (also Object Pascal but works very differently than Delphi, enabling me to make use of all those Java references). 完全公开:我不知道它对Android服务的有效性或有用性,或德尔福功能的完善程度,因为我使用Oxygene进行Android开发(也是对象Pascal,但其工作原理与Delphi截然不同,这使我能够使用所有这些Java引用中)。

The rest of your question seems more related to specific business/application requirements than a programming/technical problem, but if you run into specific issues you should consider asking questions about those separately. 问题的其余部分似乎比编程/技术问题与特定的业务/应用程序要求更相关,但是,如果遇到特定的问题,则应考虑分别询问这些问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Titanium-Android-当应用程序不在前台时,推送通知失败 - Titanium - Android - Push Notifications Fail When App Is Not In Foreground 当应用程序在后台(Titanium)时,Android 5上的推送通知未送达 - 但它确实在前台 - Push notifications on Android 5 not delivered when app in background (Titanium) - But it does in foreground Android 中的推送通知仅在 PhoneGap 应用程序使用节点推送通知处于前台时才有效 - Push notifications in Android only work when PhoneGap app is in foreground using node-pushnotifications 当App位于前台时,FCM推送通知将被替换 - FCM Push Notifications are replacing when App is in Foreground 在Ionic 2中打开应用程序时处理推送通知 - Handling Push Notifications when app is open in Ionic 2 Android-通过GCM在前台/后台使用应用发送推送通知 - Android - Sending Push Notifications via GCM with app in foreground/background 使用GCM和Django处理Android中的推送通知 - Handling Push notifications in android using GCM and Django 当应用程序在前台使用 ZB12E1515C25C7D8C0352F1413AB9A15Z 通知 android - Notification is coming sometimes and sometimes not coming when the app is in foreground using firebase notifications in Flutter for android 应用被杀死时的Android推送通知 - Android push notifications when app is killed 在Android中处理解析推送通知 - Handling Parse Push Notifications in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM