繁体   English   中英

Worklight 6.2 Android应用程序未在推送通知上启动

[英]Worklight 6.2 Android Application not launching on push notification

我正在尝试获取推送通知,以在用Worklight 6.2编写的Android环境应用程序上工作。 我已经收到该应用程序来接收推送通知,但是当我在状态栏中点击通知时,它会清除通知,但不会启动该应用程序。

我已经在这里查看了答案, IBM Worklight 5.0.6.1-在关闭电话/应用程序时未得到推送通知 ,而是将app_name字符串改回应用程序的原始名称(如已接受的答案所示)不会导致该应用程序推出。 我还尝试了另一条注释建议,以从应用程序描述符中的displayName删除嵌入的空格,但这也不起作用。

我已经看过logcat了,没有看到任何消息表明它找不到要启动的应用程序。 我希望里面的东西能给我一些提示,让我知道它在寻找什么,但是没有运气。

某处是否还有其他设置不同步,因此单击通知不会启动该应用程序? 我自己找不到其他任何东西(可能是因为它不存在)。

谢谢

请参阅我对以下问题的回答。 它还提供了一种解决方案: 单击通知区域中的消息时未打开应用程序


复制/粘贴相关文本:

res \\ values \\ strings.xml中的app_name值在内部用于创建Intent对象。 因此,当应用程序关闭且GCMIntentService收到消息时,它将创建一个动作为<packagename>.<app_name>的意图,并将其发送到通知服务以在通知栏中显示通知。

这是AndroidManifest.xml中使用的意图名称,用于指示必须在点击通知时启动应用程序:

<activity android:name=".PushNotifications" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden|screenSize" android:launchMode="singleTask" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:screenOrientation="sensor"> 
    ....
    <intent-filter> 
        <action android:name="com.PushNotifications.PushNotifications.NOTIFICATION"/>  
        <category android:name="android.intent.category.DEFAULT"/> 
    </intent-filter> 

因此,现在,如果将app_name更改为任何其他字符串,则在内部将Intent创建为com.PushNotifications.<new_name>
但是AndroidManifest.xml仍然具有例如com.PushNotifications.PushNotifications (对于示例应用程序),因此,由于意图操作有所不同,因此该应用程序无法启动。

要使用其他名称显示应用程序,请按照下列步骤操作:

  1. 在strings.xml中,添加一个额外的new_name_value
  2. 在AndroidManifest.xml中,使用新的字符串名称修改标签

     <application android:label="@string/app_new_name" android:icon="@drawable/icon"> <activity android:name=".PushNotifications" android:label="@string/app_new_name"... 

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM