Cannot disable autoupdate in iOS app

I have disabled the autoupdate feature in mobile app for fixing the white screen issue on initial load in mobile apps using below code in client/main.js file.

if (Meteor.isCordova) {
  Reload._onMigrate(function (retry) {
    return [false];
  });
}

This works for android app but not working in iOS apps.
I also tried below configurations in mobile-config.js file but not working in iOS app.

App.setPreference(‘AutoUpdate’, ‘false’);
App.setPreference(‘DisableHotCodePush’, ‘true’);

and i sat the AUTOUPDATE_VERSION to a static string AR but no luck

Are you including this AUTOUPDATE_VERSION both in the mobile build and server build?

1 Like

Thanks for the reply, I do not include the AUTOUPDATE_VERSION in the mobile build. I only added this settings in galaxy configuration, Please check the below code.
How can i add this parameter in mobile build?

"galaxy.meteor.com": {
    "env": {
      "TZ": "UTC", 
      "MONGO_URL": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "ROOT_URL": "xxxxxxxx",
      "NODE_ENV": "staging",
      "GALAXY_NODE_OPTIONS": "--max-old-space-size=900",
      "AUTOUPDATE_VERSION": "AR"
    }

Hey, mobile build is not going to consider Galaxy settings or settings.json at build time.

You should provide it as a env var during the build command.

It could be something like this or see the example below:

AUTOUPDATE_VERSION=1 meteor build ../../$buildFolder --server=$host --mobile-settings private/env/$env/settings.json
1 Like

Thank you very much @filipenevola i will try this and update you.

@filipenevola it wont work the issue still persist , this is my code.

"galaxy.meteor.com": {
    "env": {
      "TZ": "UTC", 
      "MONGO_URL": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "ROOT_URL": "xxxxxxxx",
      "NODE_ENV": "staging",
      "GALAXY_NODE_OPTIONS": "--max-old-space-size=900",
      "AUTOUPDATE_VERSION": 1
    }

and my command to build.

AUTOUPDATE_VERSION=1 meteor build app-build --directory --packageType=apk --server=https://xxxxxxx/ --mobile-settings=.deploy/settings-dev.json

I got this error log while white screen appears.

2023-03-17 12:58:46.195191+0530 app[1456:232091] ERROR: {}
2023-03-17 12:58:46.195557+0530 app[1456:232091] Exception from Tracker recompute function:
2023-03-17 12:58:46.195707+0530 app[1456:232091] ReferenceError: Can't find variable: codeVersion

FYI: i set this variable using cordova-plugin-appinfo-sync package