我正在将IBM Worklight用于我的移动应用(iOS)项目。
我的问题是:如何在Xcode 5中的config.xml中添加Barcode Scanner PhoneGap插件?我刚刚在xcode中找到了这个config.xml。我找到了this documentation from phonegap's site.
config.xml中:
<?xml version="1.0" encoding="UTF-8"?>
<widget>
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value=".25" />
<preference name="HideKeyboardFormAccessoryBar" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="KeyboardShrinksView" value="false" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" />
<preference name="PaginationMode" value="unpaginated" />
<preference name="EnableLocation" value="false" /><!-- DEPRECATED -->
<preference name="UIControls" value='{"TabBarSettings": {"position": "bottom", "height": 49}, "ToolBarSettings": {"style": "Default"}}'/>
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<feature name="Battery">
<param name="ios-package" value="CDVBattery" />
</feature>
<feature name="Camera">
<param name="ios-package" value="CDVCamera" />
</feature>
<feature name="Console">
<param name="ios-package" value="CDVLogger" />
</feature>
<feature name="Contacts">
<param name="ios-package" value="CDVContacts" />
</feature>
<feature name="Device">
<param name="ios-package" value="CDVDevice" />
</feature>
<feature name="Accelerometer">
<param name="ios-package" value="CDVAccelerometer" />
</feature>
<feature name="Compass">
<param name="ios-package" value="CDVCompass" />
</feature>
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
<feature name="File">
<param name="ios-package" value="CDVFile" />
</feature>
<feature name="FileTransfer">
<param name="ios-package" value="CDVFileTransfer" />
</feature>
<feature name="Geolocation">
<param name="ios-package" value="CDVLocation" />
</feature>
<feature name="Globalization">
<param name="ios-package" value="CDVGlobalization" />
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
<feature name="Media">
<param name="ios-package" value="CDVSound" />
</feature>
<feature name="Capture">
<param name="ios-package" value="CDVCapture" />
</feature>
<feature name="NetworkStatus">
<param name="ios-package" value="CDVConnection" />
</feature>
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
<param name="onload" value="true" />
</feature>
<feature name="Vibration">
<param name="ios-package" value="CDVVibration" />
</feature>
<!--worklight-->
<feature name="DeviceAuth">
<param name="ios-package" value="DeviceAuthPlugin" />
</feature>
<feature name="UserAuth">
<param name="ios-package" value="UserAuthPlugin" />
</feature>
<feature name="WebResourcesDownloader">
<param name="ios-package" value="WebResourcesDownloader" />
</feature>
<feature name="WLNotification">
<param name="ios-package" value="WLNotification" />
</feature>
<feature name="WLApp">
<param name="ios-package" value="WLApp" />
</feature>
<feature name="UIControls">
<param name="ios-package" value="UIControls" />
</feature>
<feature name="Push">
<param name="ios-package" value="Push" />
</feature>
<feature name="NetworkDetector">
<param name="ios-package" value="NetworkDetector" />
</feature>
<feature name="NativePage">
<param name="ios-package" value="NativePage" />
</feature>
<feature name="SecurityPlugin">
<param name="ios-package" value="SecurityPlugin" />
</feature>
<feature name="StoragePlugin">
<param name="ios-package" value="StoragePlugin" />
</feature>
<feature name="AnalyticsConfigurator">
<param name="ios-package" value="AnalyticsConfigurator" />
</feature>
<feature name="FIPSHttpPlugin">
<param name="ios-package" value="FIPSHttpPlugin" />
</feature>
<feature name="Badge">
<param name="ios-package" value="Badge" />
</feature>
<feature name="NotificationEx">
<param name="ios-package" value="NotificationEx" />
</feature>
<feature name="WifiPlugin">
<param name="ios-package" value="WifiPlugin" />
</feature>
<feature name="CoreLocationGetLocationPlugin">
<param name="ios-package" value="CoreLocationGetLocationPlugin" />
</feature>
<feature name="CoreLocationWatchPlugin">
<param name="ios-package" value="CoreLocationWatchPlugin" />
</feature>
<feature name="SignificantChangeWatchPlugin">
<param name="ios-package" value="SignificantChangeWatchPlugin" />
</feature>
<feature name="SignificantChangeGetLocationPlugin">
<param name="ios-package" value="SignificantChangeGetLocationPlugin" />
</feature>
<access origin="*" />
</widget>
您可以在此处查看我的回购:https://github.com/datomnurdin/worklight-mobile
答案 0 :(得分:1)
在config.xml的底部,添加以下内容:
<feature name="your-plugin-name">
<param name="io-package" value="your-plugin-name">
</feature>
基本上,只需遵循在那里声明的所有其余Cordova插件的结构......
但为什么不阅读the training module Worklight provides(sample project),也是为了这个目的,逐步说明?
config.xml
文件如果您打算在Worklight应用程序中使用Cordova插件,此培训模块是必读的;即使它涉及创建自己的Cordova插件,如果您打算添加在Web上找到的Cordova插件,以及如何在Worklight的上下文中使用它,这也是相关的。
相关: