1

I have notifications from huawei push kit with click_action : {type : 3 }. When app is in background. I recieve 2 or more notification. After click on first notification (don't matter first position or last in notifications on the screen) all works fine. App open launcher activity and I recieved data from the intent in onCreate. But then app is not in background allready and I click next notification and nothing happen. (Normaly it would trigger onNewIntent in the launcher activity and I can recieve data from intent). Why it may happen?

What I'am doing. Frist I close app. Than send two push notification. Than click on one notification (app opens and go to needed fragment, all fine). Than click on another notification, while app is open after fist notification click. And nothing happen(onNewIntent don't triggered). From docs: when app is closed, notifications processed by NC, and whith clic_type: 3 (open app) with opened app onNewIntent must be calld, if I'm not mistaken.

HuaweiLogs - HuaweiLogs

Video Example - (Procedure: 1)close app 2) Send two identical push, that lead on the same page 3) Click to first push (1:05 time), all works fine 5) go to another page 5) click second push and nothing happen) HmsTest

Notifications are sends from backend like this: Notification

UpdateActivityManifest

click logs - click logs

log.txt logs from project menu

dlp dlp
  • 11
  • 3

1 Answers1

0

Can you provide the log information printed in the onNewIntent method?

After testing, I find that the oncreat method is triggered when I click it for the first time, and the onNewIntent method is triggered when I click it for the second time. The following figure shows the test result:

enter image description here

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • Add screenshot in start topic – dlp dlp Apr 28 '22 at 08:17
  • @dlpdlp Is `Updateactivity` the startup page? could you mind post your manifest file for us to check? – zhangxaochen Apr 28 '22 at 08:33
  • 1
    yes, UpdateActivity is startup page. It has : in manifest – dlp dlp Apr 28 '22 at 09:14
  • thanks for your reply, can you provide the parameters for sending messages and more detail logcat logs of the client for us to check? – zhangxaochen Apr 28 '22 at 09:32
  • add update with screenshot how I send messages. But I don't know which logs I can add, because on second notification click happen nothing. (with first click app start normaly with onCreate, second click (when app was in background but became foregrund after first click) nothing happen, onNew intent don't triggered) – dlp dlp Apr 28 '22 at 13:46
  • you could capture logs by the following method: 1.Connect the ADB tool to your device and run the following commands:`adb shell setprop log.tag.hwpush VERBOSE` `adb logcat -v threadtime 1> D:\hwpush.log` 2.Try to reproduce the problem for which you want to capture logs. 3.Press Ctrl+C to capture logs. – zhangxaochen Apr 29 '22 at 02:14
  • also, can you please provide the parameter settings of `UpdateActivity` in your manifest file? – zhangxaochen Apr 29 '22 at 02:15
  • 1
    add logs and screenshot UpdateActivity settings from manifest – dlp dlp May 11 '22 at 09:18
  • Thank you for your feedback, could you kindly help us with some more info to locate this issue? 1.The device model, EMUI and Android OS version. 2.Print log recorded the first click and second click app lifecycle changes of the `UpdateActivity` during drop-down notification panel to click messages. – zhangxaochen May 12 '22 at 07:20
  • add url for file with logs when I click on notifications. All info about device and os you can see in video (Video example url) – dlp dlp May 12 '22 at 09:35
  • Would you please confirm that the [tab page](https://i.stack.imgur.com/NBve8.png) here is written in fragment? Check whether is redirected to the fragment after the notification is clicked for the second time. If it is convenient, print the life cycle in the fragment. If still nothing happens, and the life cycle is not printed, provide the log of the system. – zhangxaochen May 13 '22 at 03:06
  • Dial `*#*#2846579#*#*`Enter the project menu. - 1. Background settings - 3. AP LOG settings,Enable the APP LOG function. The procedure for capturing logs is as follows: 1. Run the following command to connect to the device: adb logcat -v time > D:\log.txt 2. Reproduce the problem scenario. 3. Press Ctrl+c to finish. – zhangxaochen May 13 '22 at 03:07
  • @shirely Tab page is written in MainActivity. Redirecting from notifications contols in MainActivity as well. It doesn't matter what lifecycle happen in fragments, because after second click onNew intent doesn't called and nothing happen. Normal situation like it works with gms pushs -> First push click -> App starts -> UpdateActivity start with intent and call start Main Activity with the same intent -> redirection happens -> second push click -> in UpdateActivity onNewIntent called and MainActivity start with the same intent -> redirections happen – dlp dlp May 13 '22 at 07:46
  • The only problem is that onNewIntent NOT called and other actions not happen. – dlp dlp May 13 '22 at 07:46
  • add logs from project menu – dlp dlp May 13 '22 at 08:42
  • sorry after analysis, we find that looks like the problem that onNewIntent is not called is not caused by the push kit. – zhangxaochen May 13 '22 at 09:13
  • The problem is in the device or it is something else? – dlp dlp May 13 '22 at 11:14