【发布时间】:2016-07-12 09:57:31
【问题描述】:
我在 Android 上使用 Urban Airship 来接收通知。 Appcelerator 模块很旧(3 年前)https://github.com/appcelerator-modules/ti.urbanairship,我正在使用这个 fork:https://github.com/rdking/ti.urbanairship/tree/master/android。
使用 rdking 版本,我可以在 Android 5 上收到通知,但只有在应用打开时(前台)。如果我打开另一个应用程序或将其关闭(将其置于后台),它将无法获取。
我正在使用 Titanium SDK 5.1.2.GA(应用程序和模块),使用 NDK r10e 和
platforms/android-13 和插件/addon-google_apis-google-13
(不确定我应该使用哪个版本,是否有问题。)
我想我可能缺少 Android Manifest 上的一些配置。 通知在 Android
提前致谢 =)
【问题讨论】:
-
应用后台时没有收到通知是什么意思?通知是否仍显示在通知中心?还是您没有收到推送通知?
-
我根本没有收到通知 =/
-
推送进来时是否看到任何有用的错误消息? UA 是否记录收到的推送?我对钛不太熟悉,但我可以帮助修补模块。
-
我昨天在这方面取得了一些进展。如果应用程序在后台运行,模块会收到通知(我有它的日志),但它不会显示在设备的通知中心。问题是应用程序何时关闭。如果应用程序关闭,我根本不会收到通知 =/
-
我认为它必须在模块被初始化的地方做。 Urban Airship 需要在 Application.oncreate 期间初始化,以便在收到推送时准备就绪。我不知道这只会在 Android 5+ 上发生。看起来很难在应用程序中挂钩起飞,所以我会推荐使用 Autopilot。示例 - github.com/urbanairship/phonegap-ua-push/blob/master/src/….
标签: android push-notification android-5.0-lollipop appcelerator urbanairship.com