havesource / cordova-plugin-push

Register and receive push notifications
MIT License
144 stars 273 forks source link

Can't open push notifications #143

Open anothergituser opened 2 years ago

anothergituser commented 2 years ago

Hello,

Using cordova android 10.1.1 platform and the dev version of the plugin (unstable) because 2.0 does not compile with android 10. The problem is that push notifications don't open the app when tapping on the notification. This is what adb logcat shows,

When the push notification is received (This one goes away when adding notId to the payload but same problem) 10-31 05:59:59.263 19765 19928 E cordova-plugin-push (FCMService): Exception occurred when parsing notId: null

When trying to open the app from the push notification 10-31 06:47:33.341 2020 5370 W ActivityTaskManager: startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { flg=0x24000000 cmp=HERE GOES MY APP ID/com.adobe.phonegap.push.PushHandlerActivity (has extras) } 10-31 06:00:26.281 2020 2043 E system_server: Invalid ID 0x00000000.

Before upgrading to version 10 this problem did not exist.

Thank you.

This is the log when trying to build using version 2 (stable)

  - In plugin 'com.google.gms.google-services' type 'com.google.gms.googleservices.GoogleServicesTask' field 'intermediateDir' without corresponding getter has been annotated with @OutputDirectory.

    Reason: Annotations on fields are only used if there's a corresponding getter for the field.

    Possible solutions:
      1. Add a getter for field 'intermediateDir'.
      2. Remove the annotations on 'intermediateDir'.

    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
  - In plugin 'com.google.gms.google-services' type 'com.google.gms.googleservices.GoogleServicesTask' field 'packageNameXOR1' without corresponding getter has been annotated with @Input.

    Reason: Annotations on fields are only used if there's a corresponding getter for the field.

    Possible solutions:
      1. Add a getter for field 'packageNameXOR1'.
      2. Remove the annotations on 'packageNameXOR1'.

    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
  - In plugin 'com.google.gms.google-services' type 'com.google.gms.googleservices.GoogleServicesTask' field 'packageNameXOR2' without corresponding getter has been annotated with @Input.

    Reason: Annotations on fields are only used if there's a corresponding getter for the field.

    Possible solutions:
      1. Add a getter for field 'packageNameXOR2'.
      2. Remove the annotations on 'packageNameXOR2'.

    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
  - In plugin 'com.google.gms.google-services' type 'com.google.gms.googleservices.GoogleServicesTask' field 'quickstartFile' without corresponding getter has been annotated with @InputFile, @Optional.

    Reason: Annotations on fields are only used if there's a corresponding getter for the field.

    Possible solutions:
      1. Add a getter for field 'quickstartFile'.
      2. Remove the annotations on 'quickstartFile'.

    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
  - In plugin 'com.google.gms.google-services' type 'com.google.gms.googleservices.GoogleServicesTask' field 'searchedLocation' without corresponding getter has been annotated with @Input.

    Reason: Annotations on fields are only used if there's a corresponding getter for the field.

    Possible solutions:
      1. Add a getter for field 'searchedLocation'.
      2. Remove the annotations on 'searchedLocation'.

    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
dec commented 2 years ago

Hello to all,

Apparently there is a problem which causes what you describes in the latest development version of the plugin. I get the same problem (also with Cordova Android 10.1.1) and what I do is to specify the previous development version of the plugin, that is: "@3.0.0-dev.0". What I do is to specify that version when installing the plugin:

cordova plugin add @havesource/cordova-plugin-push@3.0.0-dev.0

If you did not specify the version, then the latest development version of the plugin (3.0.0-dev.1) become installed, and, certainly, that version causes / introduce the problem that you describes: the push notification is received, but, when tap on the notification the app is not opened as expected.

anothergituser commented 2 years ago

Thank you very much, i just tried it and it works ok with dev.0!

marioshtika commented 1 year ago

It is also working on 3.0.1