How to get handle update result of in-App updates
Asked Answered
C

0

10

Issue,

'onActivityResult(Int, Int, Intent?): Unit' is deprecated. Deprecated in Java

As per in-app update docs, the given method requires onActivityResult but that is deprecated.

I can't find any details on how to use registerForActivityResult for the in-app updates.

P.S: I am using Jetpack compose. Relevant answers would be helpful.

Note:
I am well aware that this is not an error but a warning. I am using Jetpack compose and hence this is an issue for me as having activity results makes the code outside Compose.

Clanton answered 28/10, 2021 at 16:34 Comment(6)
See how I've done it for Facebook in this answer, should work for any library which haven't provided new API so far. – Pneuma
The answer is passing the data using a callback back to compose. It still uses the deprecated method onActivityResult. I am trying to avoid it completely. – Clanton
@Clanton did you found a solution for it yet? – Skyla
@AkshayAshok, no πŸ™ – Clanton
As always documentation from google is outdated. The old method should still work. You have your single Activity for creating compose app and you can use that for creating code for updating. – Sherillsherilyn
We can't treat this very lightly, even though this is a warning, it overrides ActivityResultContracts being used throughout the app. – Unintelligible

© 2022 - 2024 β€” McMap. All rights reserved.