Worklight 6.2 Android Application not launching on push notification

后端 未结 1 644
遥遥无期
遥遥无期 2021-01-25 00:09

I am attempting to get push notifications to work on an Android environment app written in Worklight 6.2. I have gotten the app to receive push notifications, but when I tap on

1条回答
  •  清酒与你
    2021-01-25 00:35

    See my explanation in my in answer to following question. It also provides a solution: App not opened when clicking on message in notification area


    Copy/paste of the relevant text:

    The app_name value in res\values\strings.xml is used internally to create Intent objects. So when the app is closed and the GCMIntentService receives a message, it creates an intent with the action as . and send it to notification service to show the notification in the notifications bar.

    This is the intent name as used in AndroidManifest.xml to indicate that app has to be launched on tapping the notification:

     
        ....
         
              
             
         
    

    So now if the app_name is changed to any other string, internally the Intent will be created as com.PushNotifications..
    But the AndroidManifest.xml still has for example com.PushNotifications.PushNotifications (in the case of the sample application), so the app is not getting launched as the intent action is different.

    To display the application with a different name, follow these steps:

    1. In strings.xml, add an additional new_name_value
    2. In AndroidManifest.xml , modify the label with the new string name

       
      

    0 讨论(0)
提交回复
热议问题