microsoft / appcenter-sdk-android

Development repository for the App Center SDK for Android
Other
277 stars 134 forks source link

App doesn't resume when the user clicks on the download notification. #1613

Closed TedaLIEz closed 2 years ago

TedaLIEz commented 2 years ago

Description

Application doesn't bring to foreground after clicking on the notification "App update downloaded"

Repro Steps

Please list the steps used to reproduce your issue.

1.Release a new build in appcenter 2.Open the app

  1. With the update dialog, click the download button to download the update.
  2. Before the download is complete, press home button to bring the app to background.
  3. After the download is complete, there is a notification saying that App update downloaded
  4. Click on the notification, nothing happens

image

We're expecting that after clicking on the notification, we should bring the app to the foreground and finish the installation.

Details

  1. Which SDK version are you using?
    • 4.4.3
  2. Which OS version did you experience the issue on?
    • Android 10
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • Google Pixel XL
AnatolyPristensky commented 2 years ago

Hello @TedaLIEz, We filed an item on our internal dashboard to check this case, we will update this conversation once got results.

fabiendem commented 2 years ago

@TedaLIEz What's your targetSdkVersion?

If you have a targetSdkVersion of 31, I am wondering if you're not running into this behavior change: https://developer.android.com/about/versions/12/behavior-changes-12#notification-trampolines

I am asking because I am looking into bumping the targetSdkVersion to 31 (Android 12) in my app, so I am looking at those changes now.

TedaLIEz commented 2 years ago

@fabiendem Yes, my targetSdkVersion is 31, but I read through the code https://github.com/microsoft/appcenter-sdk-android/blob/4.4.3/sdk/appcenter-distribute/src/main/java/com/microsoft/appcenter/distribute/Distribute.java#L2009 the notification doesn't have a pending intent, so it should be happened if targetSdkVersion is not 31.

fabiendem commented 2 years ago

Ha ok I understand now. There is no call to .setContentIntent so the notification does nothing. https://developer.android.com/training/notify-user/build-notification#click

TedaLIEz commented 2 years ago

I believe this issue was introduced in 4.4.0, because in 3.3.1, the notification has set a pending intent, however since 4.4.0 the pending intent is removed. There is a high chance that this would cause a regression. Our user is expected to see that he/she will resume to the app or start updating after clicking the notification. @AnatolyPristensky Could you please give me ETA about this fix?

DmitriyKirakosyan commented 2 years ago

Hi @TedaLIEz , the fix will be available in the next release this quarter.

hydraxman commented 2 years ago

Thank you team for the reply and sharing the status. @DmitriyKirakosyan

I'm from the same team with @TedaLIEz on Microsoft Phone Link team. And I want to share that we have online users facing this issue and it's impacting our product, so it would be helpful if you can prioritize this and share with us if there is a new version with the fix available. Thank you!

AnatolyPristensky commented 2 years ago

Hello @BryanSharp , Release with the fix is scheduled at the end of this quarter. As a temporary workaround, please downgrade to SDK 4.3.1 We will update this thread once release with the fix be available.

TedaLIEz commented 2 years ago

We're working on targeting Android SDK 31 and SDK 4.4.2 fixed an issue in Android SDK 31, so I'm afraid we can't downgrade to SDK 4.3.1

DmitriyKirakosyan commented 2 years ago

The fix has been released! I'm closing the issue, but feel free to reopen if you face it again.