preDownloadMiniApp(params: Object)

Requires:
MiniKit≥2.3.0@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
import { preDownloadMiniApp } from '@ray-js/ray';

// Promise usage
try {
  const res = await preDownloadMiniApp({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Pre-download a miniapp. This API is only for pre-downloading regular miniapps; panel miniapps must use a different API.

Parameters

PropertyTypeRequiredDescription
miniAppIdstringYesMiniapp ID
miniAppVersionstringNoSpecify the miniapp version (optional)
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { preDownloadMiniApp } from '@ray-js/ray'

preDownloadMiniApp({
  miniAppId: "tyxxxxxxxxxxxxxxxx",
  success: data => { console.log(data); },
  fail: error => { console.error(error); },
});