my.MQRequestReadPhoneStatePermission

Provide the JavaScript API for the mini program to apply for READ-PHONE-STATE permission

Sample Code

copy
my.call('MQRequestReadPhoneStatePermission')
  .then((val)=>{
  my.alert({
    content:JSON.stringify(val)
  });
}).catch((value)=>{
  my.alert({
    title:'fail',
    content:JSON.stringify(value)
  });
})

Parameters

N/A

Success Callback Function

Name

Type

Required

Description

success

Bool

true

Is the JSAPI call successful

code

Int

true

0: Successfully applied or already granted permission,

-1: Failed,

Other codes, error returned based on API interface

message

String

false

error message