簡體   English   中英

Appcelerator應用在iOS設備上的Barcode.capture()行上崩潰

[英]Appcelerator app crashing on Barcode.capture() line on iOS device

我需要在我的應用中閱讀QR碼。 因此,我正在iOS設備上進行測試。 我添加了模塊,到目前為止我正在使用此示例

在此處輸入鏈接說明

應用程序在此行崩潰

Barcode.capture({
       animate: true,
       overlay: overlay,
       showCancel: false,
       showRectangle: false,
       keepOpen: true/*,
       acceptedFormats: [
           Barcode.FORMAT_QR_CODE
       ]*/
   });

我也嘗試了沒有像Barcode.capture();這樣的參數Barcode.capture(); 但仍然崩潰。

SDK版本為6.0.1.GA

ti.barcode版本為1.9.1

最可能的是,如果沒有日志顯示崩潰,則它與tiapp.xml中的NSCameraUsageDescription鍵值相關。

像這樣添加:

<ios>
    <enable-launch-screen-storyboard>false</enable-launch-screen-storyboard>
    <plist>
        <dict>
            <key>UISupportedInterfaceOrientations~iphone</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
            </array>
            <key>UISupportedInterfaceOrientations~ipad</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
                <string>UIInterfaceOrientationPortraitUpsideDown</string>
            </array>
            <key>UIRequiresPersistentWiFi</key>
            <false/>
            <key>UIPrerenderedIcon</key>
            <false/>
            <key>UIStatusBarHidden</key>
            <false/>
            <key>UIStatusBarStyle</key>
            <string>UIStatusBarStyleLightContent</string>

            <key>NSCameraUsageDescription</key>
            <string>Can we use your camera?</string>

            <key>NSPhotoLibraryUsageDescription</key>
            <string>Can we save to your library?</string>
        </dict>
    </plist>
</ios>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM