sp-react-native-in-app-updates icon indicating copy to clipboard operation
sp-react-native-in-app-updates copied to clipboard

when in app updates finished, Update not applied after restart

Open rdtf1230 opened this issue 2 years ago • 8 comments

my app version 2.2.3

playstore version 2.3.0

in this case,

it looks like in-app updates works fine but when update finished and restart app, app version is still 2.2.3

how can i fix it?

rdtf1230 avatar May 10 '22 06:05 rdtf1230

Bump!

Facing same issue here. In app drawer I am displaying app version using DeviceInfo.getVersion(). When app is updated via this library, I close the app and start it again and in app drawer I still see old version. No further app updates are available at this point.

devWaleed avatar Jun 09 '22 20:06 devWaleed

I found that calling installUpdate is important after download is complete. You have to start a listener and once app updates are downloaded you have trigger install function to install the update.

inAppUpdates.addStatusUpdateListener(downloadStatus => {
          console.log('download status', downloadStatus);
          if (downloadStatus.status === IAUInstallStatus.DOWNLOADED) {
            console.log('downloaded');
            inAppUpdates.installUpdate();
            inAppUpdates.removeStatusUpdateListener(finalStatus => {
              console.log('final status', finalStatus);
            });
          }
        });
        inAppUpdates.startUpdate(updateOptions);

devWaleed avatar Jun 09 '22 21:06 devWaleed

During installation, I am always getting a status: 5 (i.e installation failed)! Is anyone facing the same issue?

Lekhrajk avatar Jun 18 '22 13:06 Lekhrajk

Did you find out any solution for status: 5 issue?

khushbu-coworks avatar Jun 22 '22 12:06 khushbu-coworks

You cannot test the InAppUpdates without uploading it to Internal App Sharing or releasing it to production. If you use adb, you'll find the app signing fails somewhere that is why app update is not installed.

Read the internal app sharing part at the end of the documentation. It is very easy and you can test that way very easily.

devWaleed avatar Jun 22 '22 12:06 devWaleed

same issue for me

edritech93 avatar Jan 20 '23 09:01 edritech93

I found that calling installUpdate is important after download is complete. You have to start a listener and once app updates are downloaded you have trigger install function to install the update.

inAppUpdates.addStatusUpdateListener(downloadStatus => {
          console.log('download status', downloadStatus);
          if (downloadStatus.status === IAUInstallStatus.DOWNLOADED) {
            console.log('downloaded');
            inAppUpdates.installUpdate();
            inAppUpdates.removeStatusUpdateListener(finalStatus => {
              console.log('final status', finalStatus);
            });
          }
        });
        inAppUpdates.startUpdate(updateOptions);

Thanks @devWaleed for the code snippet.

I was just wondering if the following simple approach would work ?

      inAppUpdates.startUpdate(updateOptions)
      .then(inAppUpdates.installUpdate)

rbadapanda avatar Jan 24 '23 17:01 rbadapanda

still got stuck instaling from google play even trying with @devWaleed

I found that calling installUpdate is important after download is complete. You have to start a listener and once app updates are downloaded you have trigger install function to install the update.

inAppUpdates.addStatusUpdateListener(downloadStatus => {
          console.log('download status', downloadStatus);
          if (downloadStatus.status === IAUInstallStatus.DOWNLOADED) {
            console.log('downloaded');
            inAppUpdates.installUpdate();
            inAppUpdates.removeStatusUpdateListener(finalStatus => {
              console.log('final status', finalStatus);
            });
          }
        });
        inAppUpdates.startUpdate(updateOptions);

muammadibal avatar May 13 '24 03:05 muammadibal