【发布时间】:2014-10-02 01:12:26
【问题描述】:
我正在 delphi xe6 上开发 GCM 推送通知。 我将这篇文章https://stackoverflow.com/questions/21466094/start-android-activity-before-passing-the-gcm-intent 中的代码(使用AndroidManifest.xml 中的标准组件)用于我自己的应用程序,并且即使应用程序没有运行,我也设法使用该服务来接收通知。
但是当我收到通知时我遇到了一个问题,那就是我无法捕获 onclick 事件,所以我的应用程序打开(很好)但它没有执行所需的操作。
这是我的 AndroidManifest.xml
<receiver android:name="com.embarcadero.gcm.notifications.GCMNotification" android:exported="true">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="%package%" />
</intent-filter>
</receiver>
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService">
</service>
如果我使用帖子中的代码,我可以检测到用户何时点击通知,但我不知道如何使用标准组件来做到这一点。
问候
【问题讨论】:
-
当用户打开通知时你想做什么?
-
这取决于通知。但是,例如,当我使用本地通知时,我可以设置操作并在单击时删除通知。相反,使用推送通知我无法设置“点击”操作,它只会打开应用程序并且点击后通知不会被删除。我希望我把自己说清楚。感谢您的宝贵时间
标签: delphi notifications google-cloud-messaging firemonkey delphi-xe6