gpt4 book ai didi

java - 无法扩展 GCMIntentService 来修改 native Android 客户端的通知 View [Worklight 7.0 + Android]

转载 作者:太空宇宙 更新时间:2023-11-04 12:56:52 24 4
gpt4 key购买 nike

我需要修改Android推送通知的 View 。worklight 将收到的通知实现为

com.worklight.wlclient.push.GCMIntentService

如果 Manifest 使用其他类准备,则将 native Android 与 Worklight 服务器集成并处理通信的库 worklight-android.jar 会引发异常

com.worklight.wlclient.push.GCMIntentService

需要修改通知 View ,如下所示:

Modified notification view

并尝试扩展它并将新引用放入 list 中,如下所示:

<service android:name="com.xxx.xxxx.xxxxxxx.ClassExtendedGCMIntentService" />

异常(exception)情况如下:

02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: java.lang.RuntimeException: Your manifest is not allowed to work with push. Android Manifest Error: Missing intent service in manifest: com.worklight.wlclient.push.GCMIntentService
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at com.worklight.wlclient.api.WLPush.<init>(WLPush.java:185)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at com.worklight.wlclient.api.WLClient.getPush(WLClient.java:995)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at com.xxx.xxxxx.Splash.onCreate(Splash.java:92)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.app.Activity.performCreate(Activity.java:6500)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3072)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.app.ActivityThread.access$1000(ActivityThread.java:198)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.os.Looper.loop(Looper.java:145)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6837)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at java.lang.reflect.Method.invoke(Native Method)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at java.lang.reflect.Method.invoke(Method.java:372)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
02-10 20:30:09.047 16652-16652/com.xxx.xxxxx W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

最佳答案

此时,对于包含 Worklight/MobileFirst Android SDK 的纯 native Android 应用程序,您所要求的内容不可用。您可以提交增强请求 (RFE) here

对于混合应用程序,您的要求可以通过扩展 GCMIntentService 类来实现。更多详细信息可以在以下链接中找到:

Inbox Style notifications with IBM Worklight

Multi Line Android Push Notifications with IBM MobileFirst

关于java - 无法扩展 GCMIntentService 来修改 native Android 客户端的通知 View [Worklight 7.0 + Android],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35324548/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com