tencent cloud

Feedback

Last updated: 2024-03-04 22:48:40

    MiniCode

    Returns a description of the error code.
    /**
    * Successful
    */
    public static final int CODE_OK = 0;
    
    //////////////////////////////Server-side Errors//////////////////////////////////
    public static final int C_SERVER = -11000;
    /**
    * Shark Network Error
    */
    public static final int C_SERVER_SHARK_ERROR = -11001;
    /**
    * Server returns a code error
    */
    public static final int C_SERVER_RET_CODE_ERROR = -11002;
    /**
    * The server returns an empty response
    */
    public static final int C_SERVER_RESPONSE_NULL = -11003;
    /**
    * The server returns an issue with the type of mini-program update
    */
    public static final int C_SERVER_UPDATE_TYPE_ERROR = -11004;
    /**
    * The server returns an abnormal data parsing response
    */
    public static final int C_SERVER_PARSE_DATA_ERROR = -11005;
    /**
    * The mini-program does not exist or has been removed from the shelf
    */
    public static final int C_SERVER_TAKE_OFF = -11006;
    
    //////////////////////////////Client-side Errors//////////////////////////////////
    public static final int C_CLIENT = -12000;
    /**
    * Shark instance is null
    */
    public static final int C_CLIENT_SHARK_IS_NULL = -12001;
    /**
    * Previewing the mini-program requires prior login
    */
    public static final int C_CLIENT_NEED_LOGIN_PREVIEW_APP = -12002;
    /**
    * Data parsing anomaly.
    */
    public static final int C_CLIENT_JSON_EXCEPTION = -12003;
    /**
    * Anomaly in scanning the code.
    */
    public static final int C_CLIENT_SCAN_ERROR = -12004;
    /**
    * Mini-program information is missing.
    */
    public static final int C_CLIENT_MINI_APP_INFO_ERROR = -12005;
    /**
    * Error in scanning the code.
    */
    public static final int C_CLIENT_QRCODE_ERROR = -12006;
    /**
    * Non-TMF mini-program QR code.
    */
    public static final int C_CLIENT_QRCODE_INVALIDATE = -12007;
    /**
    * The appId field is empty.
    */
    public static final int C_CLIENT_APPID_EMPTY = -12008;
    /**
    * businessId null
    */
    public static final int C_CLIENT_QRCODE_BUSINESSID_NULL = -12009;
    /**
    * Anomaly in initiating the mini-program.
    */
    public static final int C_CLIENT_START_MINI_APP_THROWABLE = -12010;
    /**
    * Anomaly in JSON parsing.
    */
    public static final int C_CLIENT_JSON_ERROR = -12011;
    /**
    * Failure in downloading the mini-program.
    */
    public static final int C_CLIENT_MINI_APP_DOWNLOAD_FAIL = -12012;
    /**
    * Failure in parsing the mini-program.
    */
    public static final int C_CLIENT_MINI_APP_PARSE_FAIL = -12013;

    MiniApp

    Description class for mini-program information.
    /**
    * Official mini-program.
    */
    public static final int TYPE_ONLINE = MiniSDKConst.ONLINE;
    /**
    * Debugging the mini-program.
    */
    public static final int TYPE_DEVELOP = MiniSDKConst.DEVELOP;
    /**
    * Previewing the mini-program.
    */
    public static final int TYPE_PREVIEW = MiniSDKConst.PREVIEW;
    /**
    * Experiencing the mini-program.
    */
    public static final int TYPE_EXPERIENCE = MiniSDKConst.EXPERIENCE;
    /**
    * Mini-program ID.
    */
    public String appId;
    /**
    * Mini-program version types (Official, Preview, Development)
    */
    public int appVerType;
    /**
    * Mini-program version
    */
    public String version;
    /**
    * Mini-program name
    */
    public String name;
    /**
    * Mini-program icon
    */
    public String iconUrl;
    /**
    * Mini-program overview
    */
    public String appIntro;
    /**
    * Developer's corporate name
    */
    public String appDeveloper;
    /**
    * Timestamp
    */
    public long time;

    MiniStartOptions

    /**
    Whether to enforce an update check when opening the mini-program (effective the first time the APP is launched), false: prioritize using local cache while asynchronously obtaining the latest data; true: wait for the network response before opening the mini-program.
    */
    
    public boolean isForceUpdate = false;
    /**
    * Entry point address
    */
    public String entryPath;
    /**
    * Acknowledge errors during the mini-program startup process
    */
    public ResultReceiver resultReceiver;
    /** * Mini-program startup parameters */ public String params;

    MiniScene

    /**
    * Main entry point of the mini-program, 'Recently Used' list
    */
    public static final int LAUNCH_SCENE_MAIN_ENTRY = 1001;
    /**
    * Open via scanning code
    */
    public static final int LAUNCH_SCENE_QR_CODE_FROM_SCAN = 1011;
    /**
    * Open via search
    */
    public static final int LAUNCH_SCENE_SEARCH = 2005;

    SearchOptions

    /**
    * Search keywords, search all mini-programs when empty
    */
    public String keyWord = "";
    /**
    * Temporarily unsupported.
    */
    public int pageIndex;
    /**
    * Temporarily unsupported.
    */
    public int pageSize;

    ShareData

    /**
    * Source of sharing, values within ShareSource.
    */
    public int shareSource;
    /**
    * Sharing target, values within ShareTarget.
    */
    public int shareTarget;
    /**
    * ID set in the sharing panel, used to distinguish sharing channels.
    */
    public int shareItemId;
    /**
    * Sharing title.
    */
    public String title;
    /**
    * Sharing summary.
    */
    public String summary;
    /**
    * Path of the shared image. It can be either a local image path or a network image path.
    */
    public String sharePicPath;
    /**
    * Whether it is a local image. If true, then sharePicPath is the path of the local image; otherwise, sharePicPath is the path of the network image.
    */
    public boolean isLocalPic;
    /**
    * Field obtained from the server: Sharing link.
    */
    public String targetUrl;
    /**
    * Mini program package information.
    */
    protected MiniAppInfo miniAppInfo;

    ShareSource

    public static class ShareSource {
    
    public static final int INNER_BUTTON = 11; // Originating from the internal button of the mini program | mini game.
    public static final int MORE_BUTTON = 12; // Originating from the additional options of the capsule button.
    }

    ShareTarget

    public static class ShareTarget {
    public static final int QQ = 0; // Forward to QQ Contacts.
    public static final int QZONE = 1; // Forward to QQ Space.
    public static final int WECHAT_FRIEND = 3; // Forward to WeChat friends.
    public static final int WECHAT_MOMENTS = 4; // Forward to WeChat Moments.
    }

    ShareResult

    public static class ShareResult {
    public static final int SUCCESS = 0; // Successful sharing.
    public static final int FAIL = 1; // Sharing unsuccessful.
    public static final int CANCEL = 2; // Sharing cancelled.
    }

    MiniStartLinkOptions

    public class MiniStartLinkOptions {
    /**
    * Determines whether to enforce an update check when opening the mini-program (effective on the first opening of the mini-program with each APP launch). False: Prioritizes local cache while asynchronously fetching the latest data. True: Waits for network response before opening the mini-program.
    */
    public boolean isForceUpdate = false;
    /**
    * Entry point address
    */
    public String entryPath;
    /**
    * Receives error information during the mini-program startup process.
    */
    public ResultReceiver resultReceiver;
    
    /**
    * Mini-program startup parameters.
    */
    public String params;
    }

    MiniInitConfig

    /**
    * Configuration file name in assets.
    */
    private String configAssetName;
    /**
    * Custom configuration file path.
    */
    private String configFilePath;
    /**
    * IMEI, used for backend mini-program push configuration.
    */
    private String imei;
    /**
    * SDK log switch.
    */
    private boolean debug;
    /**
    * Setting up an external shark instance.
    */
    private IShark shark;
    /**
    * Validate package name in configuration file during loading.
    */
    private boolean verifyPkg;
    /**
    * Utilization of X5 kernel.
    */
    private boolean isUserX5Core = true;
    /** * Enforce usage of kernel base library */ private boolean forceUseBaseLibInAsset;

    IMiniAppContext

    /**
    * Return mini-program information.
    */
    MiniAppInfo getMiniAppInfo();

    MiniAppInfo

    public String appId; // Corresponding APPID for the mini-program.
    public String name; // Name of the mini-program.
    public String iconUrl; // URL of the mini-program icon.
    public String version; // Version number of the mini-program.
    public int verType; // Type of mini-program: development, preview, official version.

    IpcCallback

    public interface IpcCallback {
    /**
    * Process communication callback.
    * @param isSucc Successful invocation status.
    * @param response Response data.
    */
    void result(boolean isSucc, Bundle response);
    }

    IpcRequestEvent

    public Context context;
    // Data
    public Bundle data;
    // Callback response.
    public IpcCallback callback;

    RequestEvent

    // Mini Program Activity
    public WeakReference<Activity> activityRef;
    // Event name.
    public String event;
    // Event parameters.
    public String jsonParams;

    AppState

    /** * Mini Program Initialization */ int STATE_START = 1; /** * Mini Program Transition to Foreground */ int STATE_FOREGROUND = 2; /** * Capsule Closure of Mini Program */ int STATE_CLOSE = 3; /** * Mini Program Transition to Background */ int STATE_BACKGROUND = 4; /** * Mini Program Termination */ int STATE_DESTROY = 5;

    MiniAppEvent

    /** * Mini Program Information */ public MiniApp miniApp; /** * Hot Start Indicator */ public boolean isHotStart;

    PreDownloadInfo

    /** * Mini Program Application ID */ public String appId;
    /** * Mini Program Package Download Indicator */ public boolean isDownload;

    IDownloadCallback

    /** * Download Success Callback * * @param downloadInfo */ void onFinish(DownloadInfo downloadInfo); /** * Callback Failure * * @param downloadInfo */ void onError(DownloadInfo downloadInfo);

    DownloadInfo

    // Download IOException and IllegalAccessException Exceptions public static final int CODE_DOWNLOAD_IOEXCEPTION = -100001; // Download Exception public static final int CODE_DOWNLOAD_EXCEPTION = -100002; // No Network Connection public static final int CODE_NO_NETWORK = -100003; // Download Parameter Error public static final int CODE_PARAM_ERROR = -100004; // Download Directory Creation Failure public static final int CODE_DOWNLOAD_DIR_CREATE_FAIL = -100005; // Mini App Parsing Failure public static final int CODE_MINI_APP_PARSE_FAIL = -12013;
    
    /** * Mini Program ID */ private String appId; /** * Error Code */ private int errCode; /** * Error Message */ private String message;
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support