OTA Updates Only Appear After Killing App

#1

Hello,

I developed an iOS application using Expo.
I built the .ipa file using exp in the terminal and uploaded it to the App Store.
After the app was approved by Apple and released in the App store, I updated it and published the updates using XDE.

Here’s what I’m seeing now:

  • When I launch the app from my phone, I get the original version.
  • If I kill the app (by double-tapping the home button and sliding it away) and then relaunch the app, I will see the updated version.
  • If I restart my phone and launch the app again, I will go back to the original version.
  • If I delete the app and reinstall from the App Store, I will see the original version.

Am I doing something incorrect with OTA?
This is a big problem because I don’t anticipate users will kill the app before using it.

I am using Expo SDK 26.
Here is my app.json, but I removed my app name information.

{
  "expo": {
    "name": "...",
    "description": "...",
    "slug": "...",
    "privacy": "public",
    "sdkVersion": "26.0.0",
    "platforms": ["ios", "android"],
    "version": "1.1.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "cover",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "buildNumber": "1.1.1",
      "bundleIdentifier": "...",
      "supportsTablet": true,
    },
    "android": {
      "package": "...",
      "versionCode": 2,
    }
  }
}

Is there something I’m missing?
Like do the version numbers need to be changed to something special?
I’ve read through the documentation and I believe I’m doing everything correctly to have updates automatically pulled.

Thanks.

0 Likes

#2

Hi, looking at your updates config:

    "updates": {
      "fallbackToCacheTimeout": 0
    },

This means “use a cached version after zero seconds, and download a new version in the background if it’s available”, which sounds like the behavior you described. When the app is freshly installed from the app store, it contains a preloaded version from whenever you submitted to the app store (so that it can launch instantly without downloading anything).

If you want to wait until the new version is downloaded and then reload your app when it’s ready, you can listen for events to see when the background download finished, then call Updates.reload() when you’re ready.

If you don’t want to download updates in the background, and you instead want to block the UI and wait for a new version to load when the app is launched, you can set fallbackToCacheTimeout to a higher value besides zero.

If you want to look for a new update at any time, without relaunching the app, you can use checkForUpdateAsync() to see if something is available, and decide whether to download it.

Hope that helps!

1 Like

OTA Updates download event not fired
#3

@ben

Ah, ok. I see now. Thank you for the explanation!

0 Likes

#4

@ben how can I change this config in the ejected ExpoKit app? It doesn’t seem like it’s getting picked up from app.json into binary.

Edit: Looks like running exp publish before building binary solves the problem. New configs from app.json get picked up to shell-app-manifest.json

2 Likes

closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

0 Likes