getEnterOptions(params: Object)

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

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

Description

Get the parameters for this miniapp launch. If it is a cold start, the return value matches the App.onLaunch callback parameters; if it is a warm start, it matches App.onShow.

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescriptionMiniKit Since
pathstringPath used to launch the miniapp (code package path)v3.2.0
scene1000 | 1001 | 1002Launch scene valuev3.15.0
Query parameters used to launch the miniappv3.2.0
Share/forwardv3.2.0
apiCategorystringAPI category: default - default category; embedded - embedded; miniapps opened via the half-screen miniapp capabilityv3.2.0
Extra parameters for launching the miniapp, typically container-added, non-business parametersv3.21.0
rendererstringRendering type: native indicates Lynx self-rendering; empty/other indicates Webv3.37.0
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Valid Values

success.params.scene
ValueDescriptionMiniKit Since
1000Default valuev3.15.0
1001Launched via the Recently Used Mini Programs listv3.15.0
1002Launched via URL mappingv3.15.0

Examples

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

getEnterOptions({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});