agamemnus / cordova-plugin-xapkreader

Easily access Google Play APK expansion file data.
32 stars 55 forks source link

autodownload(question) #134

Closed lolaswift closed 5 years ago

lolaswift commented 5 years ago

On my config.xml, I set autodownload to false because I use cordova-plugin-splashscreen plugin.

so I need to download the .obb manually after the splash screen is hidden?:

if (window["XAPKReader"]) {

    window["XAPKReader"].downloadExpansionIfAvailable(function () {
      console.log("Expansion file check/download success.");
    }, function (_error) {
      console.error(_error);
    });
  }

My question is if the .obb file already downloaded, it will not try to download it again? I'm trying to avoid downloading the expansion file every time my app starts.

Sorry, don't know where to ask the question.

agamemnus commented 5 years ago

The short answer is that it will only download it once.

1) With all the default settings, the .obb should be downloaded only when the user installs the app. 2) The plugin will normally not try to download the .obb. 3) It will try to download the .obb if it is missing, however. But, this check breaks the splash plugin. Hence the need for the splash plugin workaround.

lolaswift commented 5 years ago

@agamemnus Many thanks for your quick help! And the answer is clear.