• Pgyer document center

    Cordova插件使用指南

    注冊應用獲取 App Key

    App Key:唯一標識一個應用的 Key,在蒲公英上的每一個 App 都有一個唯一的 App Key,開發者可以在應用管理頁面首頁查看。

    安裝插件

    cordova plugin add pgyerplugin --variable ANDROID_APPID=[Android App Key] --variable IOS_APPID=[iOS App Key]
    

    使用插件

    上報 Crash 異常

    cordova.exec(success, error, 'PgyerPlugin', 'crashRegister', [""]);
    
    function success(msg) {
        alert(msg);
    }
    
    function error(msg) {
        alert('失敗: ' + msg);
    }
    

    用戶反饋

    cordova.exec(success, error, 'PgyerPlugin', 'showFeedback', [""]);
    

    檢查更新

    cordova.exec(success, error, 'PgyerPlugin', 'checkUpdate', [""]);
    

    備注

    更多高級用法Android端修改PgyerPlugin.java文件,iOS端修改PgyerPlugin.h和PgyerPlugin.m文件,具體修改方式參考 新版本Android SDK 集成指南iOS SDK 集成指南

    下載Demo工程

  • 红豆视频