简体中文
uni小程序SDK 提供了丰富的原生能力,如果您在小程序中调用了相关模块的 API 但是原生工程没有添加相关依赖的时候会出现如下提示
按照下面的教程将该模块所需的依赖库和依赖资源添加到原生工程中即可 您可根据需求自行添加功能模块,各功能模块所需的依赖库及资源文件,请参考页面最下面的模块对照表
UniMPSDK/Feature目录结构
|-- UniMPSDK/Features
|-- Feature-iOS.xls // 功能模块配置表 (新版本已移除,请参考本页面下方的模块对照表)
|-- inc // 框架使用的第三库 .h 头文件
|-- Libs // 各功能模块的依赖库存放位置
|-- Resources // 资源文件
请参考模块对照表,添加模块所需依赖库及资源文件即可;
首先查看对照表,找到 Gallery 模块查看所需添加的系统库、SDK中的库及资源文件
功能模块名称 | 5+ API | Uni API | 系统库 | SDK中的库 | 资源文件 | Info.plist(添加权限描述或字段) |
---|---|---|---|---|---|---|
Camera(摄像头)/Gallery(图片选择) | plus.camera | image |
AssetsLibrary.framework Photos.framework CoreMedia.framework MetalKit.framework GLKit.framework | liblibCamera.a |
DCTZImagePickerController.bundle DCMediaEditingController.bundle |
NSCameraUsageDescription NSPhotoLibraryUsageDescription NSPhotoLibraryAddUsageDescription |
将 UniMPSDK/Features/Lib 中的库
系统库
添加到工程的 TARGETS->Build Phases-> Link Binary With Libaries
中;
将 UniMPSDK/Features/Resources 中的
两个资源文件添加到工程
在工程的 info.plist 文件中添加
对于的描述信息;
然后即可调用 Gallery 相关功能;
### 功能模块对照表 ( **温馨提示表格可左右滑动** )功能模块名称 | 5+ API | Uni API | 系统库 | SDK中的库 | 资源文件 | Info.plist(添加权限描述或字段) |
---|---|---|---|---|---|---|
Accelerometer(加速度传感器) | plus.accelerometer | Accelerometer | Accelerate.framework | liblibAccelerometer.a | ||
Audio(音频) | plus.audio | record-manager audio-context | AVFoundation.framework |
liblibMedia.a libopencore-amrnb.a libmp3lame.a DCUniRecord.framework | NSMicrophoneUsageDescription | |
Camera(摄像头)/Gallery(图片选择) | plus.camera | image |
AssetsLibrary.framework Photos.framework CoreMedia.framework MetalKit.framework GLKit.framework | liblibCamera.a |
DCTZImagePickerController.bundle DCMediaEditingController.bundle |
NSCameraUsageDescription NSPhotoLibraryUsageDescription NSPhotoLibraryAddUsageDescription |
Contacts(通讯录) | plus.contacts | contact |
AddressBookUI.framework AddressBook.framework AVFoundation.framework CoreVideo.framework CoreMedia.framework | liblibContacts.a | NSContactsUsageDescription | |
File(文件系统) | plus.io | file |
liblibIO.a | |||
Geolocation(定位) | plus.geolocation | location |
高德定位: libc++.tbd libz.tbd ExternalAccessory.framework GLKit.framework security.framework CoreTelephony.framework SystemConfiguration.framework |
libAMapLocationPlugin.a liblibGeolocation.a AMapFoundationKit.framework AMapLocationKit.framework |
NSLocationUsageDescription NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription NSLocationAlwaysAndWhenInUseUsageDescription | |
系统定位: CoreLocation.framework | liblibGeolocation.a |
NSLocationUsageDescription NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription NSLocationAlwaysAndWhenInUseUsageDescription | ||||
百度定位: SystemConfiguration.framework Security.framework CoreLocation.framework libc++.tbd libsqlite3.0.tbd |
liblibGeolocation.a BaiduMapAPI_Utils.framework BaiduMapAPI_Base.framework BaiduMapAPI_Search.framework BMKLocationKit.framework |
NSLocationUsageDescription NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription NSLocationAlwaysAndWhenInUseUsageDescription | ||||
native.js | plus.ios |
liblibPGInvocation.a
| ||||
Messaging(短彩邮件消息) | plus.messaging | MessageUI.framework | liblibMessage.a | |||
Orientation(设备方向) | plus.orientation | CoreLocation.framework | liblibOrientation.a | |||
Proximity(距离传感器) | plus.proximity | liblibPGProximity.a | ||||
XMLHttpRequest(网络请求) | plus.net | request | liblibXHR.a | |||
zip(解压缩) | plus.zip |
liblibZip.a
| ||||
Barcode(扫码) | plus.barcode | barcode |
5+ App: AVFoundation.framework ImageIO.framework CoreVideo.framework CoreMedia.framework libiconv.2.tbd |
liblibBarcode.a libDCUniZXing.a libuchardet.a | NSCameraUsageDescription | |
uni-app: AVFoundation.framework ImageIO.framework CoreVideo.framework CoreMedia.framework libiconv.2.tbd |
libDCUniBarcode.a liblibBarcode.a libDCUniZXing.a libuchardet.a | NSCameraUsageDescription | ||||
Maps(地图) | plus.maps | map |
(vue)高德地图: MapKit.framework CoreLocation.framework libc++.tbd GLKit.framework |
liblibMap.a libAMapImp.a AMapSearchKit.framework MAMapKit.framework AMapFoundationKit.framework | AMap.bundle | amap: appkey |
(vue)百度地图: libc++.tbd libsqlite3.0.tbd QuartzCore.framework CoreGraphics.framework CoreTelephony.framework SystemConfiguration.framework Security.framework MapKit.framework OpenGLES.framework CoreLocation.framework |
liblibMap.a libbmapimp.a libBaiduKeyVerify.a libssl.a libcrypto.a BaiduMapAPI_Utils.framework BaiduMapAPI_Base.framework BaiduMapAPI_Search.framework BaiduMapAPI_Map.framework BMKLocationKit.framework | mapapi.bundle | baidu: appkey | |||
(nvue)高德地图: (nvue不支持百度地图) MapKit.framework CoreLocation.framework libc++.tbd GLKit.framework | libDCUniMap.a libDCUniAmap.a Masonry.framework AMapSearchKit.framework MAMapKit.framework AMapFoundationKit.framework | AMap.bundle userPosition@2x.png | amap: appkey | |||
Payment(支付) | plus.payment | payment |
微信支付: libsqlite3.0.tbd libz.tbd CoreTelephony.framework SystemConfiguration.framework | liblibPayment.a libwxpay.a libWeChatSDK_pay.a | [URL Types] Identifier=weixin URL Schemes=appid | |
应用内支付 IAP: StoreKit.framework | liblibPayment.a libIAPPay.a | |||||
支付宝: CFNetwork.framework SystemConfiguration.framework CoreMotion.framework Security.framework libc++.tbd | liblibPayment.a libalixpayment.a AlipaySDK.framework | AlipaySDK.bundle | [URL Types] Identifier=alixpay URL Schemes=scheme | |||
Share(分享) | plus.share | share |
新浪微博: ImageIO.framework libsqlite3.0.tbd | liblibShare.a libSinaShare.a libWeiboSDK.a | WeiboSDK.bundle | sinaweibo: appkey appSecret redirectURI [URL Types] Identifier=com.weibo URL Schemes=wb+appkey |
QQ: 无 |
liblibShare.a libQQShare.a TencentOpenAPI.framework | [URL Types] Identifier=tencentopenapi URL Schemes= tencent+appid | ||||
微信: libsqlite3.0.tbd libz.tbd CoreTelephony.framework SystemConfiguration.framework | liblibShare.a libweixinShare.a libWeChatSDK.a | [URL Types] Identifier=weixin URL Schemes=appid | ||||
Speech(语音识别) | plus.speech | voice |
百度语音识别: libc++.tbd libz.tbd libsqlite3.tbd AudioToolbox.framework AVFoundation.framework CFNetwork.framework CoreLocation.framework CoreTelephony.framework SystemConfiguration.framework GLKit.framework |
liblibSpeech.a libBaiduSpeechSDK.a libbaiduSpeech.a | BDSClientEASRResources文件夹里的资源文件 | baiduspeech: apikey secretkey appid |
讯飞语音识别: AVFoundation.framework AddressBook.framework Contacts.framework |
liblibSpeech.a libiflySpeech.a iflyMSC.framework | iFly: appid | ||||
Statistic(友盟统计) | plus.statistic |
CoreTelephony.framework SystemConfiguration.framework libz.tbd libsqlite3.tbd |
liblibStatistic.a UMDevice.framework UMCommon.framework UMAPM.framework | umeng: appkey | ||
Oauth(授权登陆) | plus.oauth | login |
新浪微博: ImageIO.framework libsqlite3.0.tbd |
liblibOauth.a libSinaWBOauth.a liblWeiboSDK.a | WeiboSDK.bundle | sinaweibo: appkey redirectURI [URL Types] Identifier=com.weibo URL Schemes=wb+appkey |
QQ: 无 |
liblibOauth.a libQQOauth.a TencentOpenAPI.framework | [URL Types] Identifier=tencentopenapi URL Schemes= tencent+appid | ||||
微信: libsqlite3.0.tbd libz.tbd CoreTelephony.framework SystemConfiguration.framework |
liblibOauth.a libWXOauth.a libWeChatSDK.a | weixinoauth: appid appSecret [URL Types] Identifier=weixin URL Schemes=appid | ||||
Google: AuthenticationServices.framework CoreText.framework CoreGraphics.framework LocalAuthentication.framework SafariServices.framework Security.framework |
liblibOauth.a libGoogleOauth.a GoogleSignIn.framework GoogleSignInDependencies.framework | GoogleSignIn.bundle | google: clientid [URL Types] Identifier=google_url URL Schemes= 反向clientid | |||
Facebook: libc++.tbd Accelerate.framework Accounts.framework AdSupport.framework AudioToolbox.framework CoreGraphics.framework QuartzCore.framework Security.framework Social.framework StoreKit.framework |
liblibOauth.a libFBOauth.a FBSDKCoreKit.framework FBAEMKit.framework FBSDKCoreKit_Basics.framework FBSDKLoginKit.framework | FacebookAppID: appid [URL Types] Identifier=facebook URL Schemes=fb+appid | ||||
Video(视频播放) | plus.video | video |
vue 页面: libc++.tbd libbz2.tbd libz.tbd AudioToolbox.framework AVFoundation.framework CoreGraphics.framework CoreMedia.framework CoreVideo.framework VideoToolbox.framework MediaPlayer.framework MobileCoreServices.framework OpenGLES.framework QuartzCore.framework UIKit.framework |
liblibVideo.a DCUniVideoPublic.framework IJKMediaFrameworkWithSSL.framework Masonry.framework |
DCSVProgressHUD.bundle DCPGVideo.bundle | |
nvue 页面: libc++.tbd libbz2.tbd libz.tbd AudioToolbox.framework AVFoundation.framework CoreGraphics.framework CoreMedia.framework CoreVideo.framework VideoToolbox.framework MediaPlayer.framework MobileCoreServices.framework OpenGLES.framework QuartzCore.framework UIKit.framework |
libDCUniVideo.a DCUniVideoPublic.framework IJKMediaFrameworkWithSSL.framework Masonry.framework |
DCSVProgressHUD.bundle DCPGVideo.bundle | ||||
fingerprint(指纹识别) | plus.fingerprint | authentication | LocalAuthentication.framework | liblibFingerprint.a | ||
faceId(人脸识别) | authentication | LocalAuthentication.framework | libDCUniFaceId.a | NSFaceIDUsageDescription | ||
BlueTooth(蓝牙) | plus.bluetooth | bluetooth | CoreBluetooth.framework | liblibBlueTooth.a |
NSBluetoothPeripheralUsageDescription NSBluetoothAlwaysUsageDescription | |
sqlite(数据库) | plus.sqlite | libsqlite3.0.tbd | liblibSqlite.a | |||
livepusher(直播推流) | plus.video.createLivePusher | createliveplayercontext |
AVFoundation.framework QuartzCore.framework OpenGLES.framework AudioToolbox.framework VideoToolbox.framework Accelerate.framework CoreMedia.framework CoreTelephony.framework SystemConfiguration.framework CoreMotion.framework |
liblibLivePush.a libDCUniGPUImage.a libDCUniLivePush.a UPLiveSDKDll.framework(动态库) | ||
iBeacon | plus.ibeacon | ibeacon |
CoreBluetooth.framework CoreLocation.framework | liblibBeacon.a |
NSBluetoothPeripheralUsageDescription NSBluetoothAlwaysUsageDescription |