switchTab(params: Object)

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

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

Description

Switch to a tabBar page and close all other non-tabBar pages

Parameters

PropertyTypeRequiredDescription
urlstringYesPage path; parameters are not supported
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 { switchTab } from '@ray-js/ray'

switchTab({
  url: "pages/index/index",
  success: data => { console.log(data); },
  fail: error => { console.error(error); },
});