cordova開發跨平台應用問題隨筆記

來源:互聯網
上載者:User

標籤:io   os   ar   使用   檔案   on   問題   html   ad   

iOS下頻繁請求地理位置授權

做的某個cordova應用有用到geolocation外掛程式,跑在iOS的時候發現app請求了一次授權,結果webkit還請求了一次授權,不但如此,webkit請求的格式還相當醜/var/mobile/Applications/157EB70D-4AA7-826E-690F0CBE0F/appname.app/www/index.html,放狗一搜,果然很多人在聊這個問題,解決方案眾說紛紜,主要cordova本身發展較快變化較大,不能說每個解決都是有效,但也不能說是錯的,結果不帶版本號碼的解決方案變成耍流氓了。時至今日(4.0.0),我的解決如下:
確保在onDeviceReady後才使用navigator.geolocation,順利通過。

在xcode中報找不到外掛程式的異常

報錯一般如下:

ERROR: Plugin ‘Geolocation’ not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

我們需要自行把外掛程式對應的.m檔案在項目設定檔中添加:

In XCode, goto Build Phases -> open the Compiled Sources dropdown. Click + and add the missing plugin .m file that should be in your Plugins directory (but is missing from the compiled sources).

就是在Build Phases / Compile Sources裡面添加未包含進去的外掛程式檔案即可。奇怪的是,之前從沒這麼做過,外掛程式都能正常使用。。。

ios模擬器報錯

這不算問題,保持cordova, ios-sim都為最新版。記錄下來是為了強調這一原則。keep update

cordova開發跨平台應用問題隨筆記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.