switchDevice(params: Object)

Requires:
OutdoorKit≥1.0.4@ray-js/ray≥1.4.40
Platforms:
iOSAndroid
import { outdoor } from '@ray-js/ray';

const { switchDevice } = outdoor;

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

Description

Switch device; a native switch selector will pop up

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
NoCallback 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 { outdoor } from '@ray-js/ray'

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