Customizing the SDK

更新时间:
复制 MD 格式

By default, Mini Program components include all API capabilities. You can remove any APIs that your Mini Program does not use.

Component supported by remove_pod

Component description

Included APIs

mPaaS_TinyApp_Audio

Mini Program audio

audio

mPaaS_TinyApp_Device

Mini Program device

my.getClipboard

my.setClipboard

my.watchShake(OBJECT)

my.vibrate(OBJECT)

my.vibrateLong(OBJECT)

my.vibrateShort(OBJECT)

my.onAccelerometerChange(function callback)

my.onGyroscopeChange(function callback)

my.offGyroscopeChange()

my.onCompassChange(function callback)

my.offCompassChange()

my.makePhoneCall(OBJECT)

my.onUserCaptureScreen(CALLBACK)

my.offUserCaptureScreen()

my.setKeepScreenOn(OBJECT)

my.getScreenBrightness(OBJECT)

my.setScreenBrightness(OBJECT)

my.addPhoneContact()

mPaaS_TinyApp_Location

Mini Program location

my.chooseLocation

my.getLocation

my.openLocation

mPaaS_TinyApp_Multimedia

Mini Program multimedia

my.chooseImage

my.previewImage

my.saveImage

my.compressImage

my.getImageInfo

mPaaS_TinyApp_Player

Mini Program player

video

mPaaS_TinyApp_Scan

Mini Program code scanning

my.scan

Procedure

  1. Install the beta version of the cocoapods-mPaaS plugin.

    Note

    The beta version of the cocoapods-mPaaS plugin is supported on baselines 10.2.3 and later.

    sh <(curl -s http://mpaas-ios-test.oss-cn-hangzhou.aliyuncs.com/cocoapods/installmPaaSCocoaPodsPlugin.sh)

    After the installation is complete, run the pod mpaas version --plugin command to verify that the beta version is installed.

  2. Run the pod mpaas update 10.2.3 command to update the local baseline.

  3. Before running the mPaaS_pod command, add remove_pod "mPaaS_xxx" to your Podfile. For example, to remove the Mini Program audio component, add remove_pod "mPaaS_TinyApp_Audio" before mPaaS_pod "mPaaS_Ariver".

    remove_pod "mPaaS_TinyApp_Audio"
    
    mPaaS_pod "mPaaS_Ariver"
    
    pod 'xxx' # The corresponding third-party native library