首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ionic应用程序的插件中定义Info.plist协议无法使用蓝牙打印机zebra ios

在ionic应用程序的插件中定义Info.plist协议无法使用蓝牙打印机zebra ios
EN

Stack Overflow用户
提问于 2016-06-22 00:23:06
回答 1查看 746关注 0票数 0

我正在尝试开发一个插件来打印与我的离子应用程序使用斑马蓝牙打印机。

当我尝试打印“打开会话失败,因为没有在Info.plist中声明协议com.zebra.rawport”时,它给了我一个错误。

下面是中描述的我的Info.plist文件:

Image with info.plist

如果我把协议放在文件上,我真的不知道该怎么做。

我在这里添加了plugin.xml文件:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" id="com.ecuaquimica.zebraPrinterBluetooth" version="0.0.1">

    <name>ZebraPrinter Bluetooth</name>

    <engines>
        <engine name="cordova" version=">=3.4.0"/>
        </engines>

        <js-module src="www/zebraPrinterBluetooth.js" name="zebraPrinterBluetooth">
            <clobbers target="zebraPrinterBluetooth"/>
        </js-module>

        <platform name="android">
            <config-file target="AndroidManifest.xml" parent="/*">
                <uses-permission android:name="android.permission.BLUETOOTH"/>
                <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
            </config-file>
            <config-file target="res/xml/config.xml" parent="/*">
                <feature name="ZebraPrinterBluetooth">
                    <param name="android-package" value="com.ecuaquimica.plugin.ZebraPrinterBluetooth"/>
                </feature>
            </config-file>
            <source-file src="src/android/ZebraPrinterBluetooth.java" target-dir="src/com/zebraPrinterBluetooth/plugin/"/>
            <source-file src="src/android/ZSDK_ANDROID_API.jar" target-dir="libs"/>
        </platform>

        <platform name="ios">

            <config-file target="config.xml" parent="/*">
                <feature name="ZebraPrinterBluetooth">
                    <param name="ios-package" value="ZebraPrinterBluetoothPlugin"/>
                </feature>
            </config-file>

            <header-file src="src/ios/ZebraPrinterBluetooth.h" target-dir="ZebraPrinterBluetoothPlugin"/>
            <source-file src="src/ios/ZebraPrinterBluetooth.m" target-dir="ZebraPrinterBluetoothPlugin"/>

            <config-file target="*-Info.plist" parent="UISupportedExternalAccesoryProtocols">
                <array>
                    <string>com.zebra.rawport</string>
                </array>
            </config-file>

            <config-file target="*-Info.plist" parent="Required Background modes">
                <array>
                    <string>App Communicates with an accesory</string>
                </array>
            </config-file>

            <source-file src="src/ios/libZSDK_API.a" framework="true"/>

            <framework src="ExternalAccesory.framework" />

            <header-file src="src/ios/include/DiscoveredPrinter.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/DiscoveredPrinterNetwork.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/FieldDescriptionData.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/FileUtil.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/FormatUtil.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/GraphicsUtil.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/MagCardReader.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/MfiBtPrinterConnection.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/NetworkDiscoverer.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/PrinterStatus.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/PrinterStatusMessages.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/SGD.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/SmartCardReader.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/TcpPrinterConnection.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/ToolsUtil.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/ZebraErrorCode.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/ZebraPrinter.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/ZebraPrinterConnection.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/ZebraPrinterFactory.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>
            <header-file src="src/ios/include/ZplPrintMode.h" target-dir="ZebraPrinterBluetoothPlugin/Headers"/>

        </platform>

    </plugin>

EN

回答 1

Stack Overflow用户

发布于 2016-06-22 22:50:03

您的.plist文件中有一个拼写错误,请参阅the doc:UISupportedExternalAccessoryProtocols (双's')。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37949741

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档