my.showAuthGuide

Pop up dialog for user in form of (image, text, etc.) via the permission guide module. To advice the user to turn on the related permission. The permission guide is used to advice rather than to validate the permission. The call timing is when the service party confirms the required permission is limited. In addition, the permission guide pop-up is subject to fatigue and other factors.

Sample Code

copy
    // API-DEMO page/API/show-auth-guide/show-auth-guide.json
    {
        "defaultTitle": "Permission guide"
    }
copy
    <!-- API-DEMO page/API/show-auth-guide/show-auth-guide.axml-->
    <view class="page">
      <view class="page-description">Permission guide API</view>
      <view class="page-section">
        <view class="page-section-title">my.showAuthGuide</view>
        <view class="page-section-demo">
          <button type="primary" onTap="showAuthGuide">Permission guide</button>
        </view>
      </view>
    </view>
copy
    // API-DEMO page/API/show-auth-guide/show-auth-guide.js
    Page({
      showAuthGuide() {
        my.showAuthGuide({ 
            bizType:'AppletPG',
            authType:'LBS',
            success:(res)=>{
                //When shown is true, it indicates the permission guide pop-up will be shown; when it is false, it indicates the user has allowed the permission.
                my.alert({content: 'Call success: '+JSON.stringify(res), });
            },
            fail:(error)=>{
                my.alert({content: 'Call failure:'+JSON.stringify(error), });
            },
        });
      },
    });

Parameters

String type with the following attributes:

AttributesTypeMandatoryDescription
authTypeStringYesIdentifier of the permission under guide, used to identify the type of the permission (such as LBS)

Supported authType

Permission namePermission codeSupported platform
Background keep-alive permissionBACKGROUNDERAndroid
Desktop shortcut permissionSHORTCUTAndroid
Microphone permissionMICROPHONEiOS
Addressbook permissionADDRESSBOOKiOS
Camera permissionCAMERAiOS
Photo permissionPHOTOiOS
Push notification bar permissionNOTIFICATIONAndroid
Self-start permissionSELFSTARTINGAndroid
Lbs switchLBSSERVICEiOS
Lbs switch (app)LBSiOS