# 模块/三方SDK配置介绍

1、配置离线打包工程时,可以根据需要进行 模块/三方SDK 的增删,这个过程需要对工程做出修改。

2、目前插件需要修改的项目包含Library、Framework、资源文件、info.plist、宏定义、LinkerFlags文件几项。

3、并不是所有的模块/三方SDK都要修改以上几项,大部分模块/三方SDK只需要修改其中几项即可。

4、如果app中出现“缺失功能提醒框”,需要按照下面步骤配置相应的模块/三方SDK即可。

# 具体修改方法:

# 如何配置Library

library为模块/三方SDK对应的库文件和依赖库,按照下图找到配置位置,点击“+”可以添加,选中.a库点击“-”可以删除

# 如何配置framework

framework为模块/三方SDK依赖的库,按照下图找到配置位置,点击”+“可以添加,选中framework点击“-”可以删除

# 如何添加删除文件

当需要使用的资源如图片、国际化文件等, 点击File->addFile 在弹出的对话框中选择响应文件即可,删除时在工程中选中该项目,点击delete键

# 如何修改宏定义

按照下图找到Macors,在弹出的窗口中点击“+”可以添加添加“-”可以删除

# 如何修改LinkerFlags配置

按照下图找到Other Linker Flags 点击该项,在弹出的窗口中点击"+"可以添加flag 点击"-"可以删除flag

# 如何配置模块/三方SDK

1、查看功能模块对照表中的配置要求,如下表:

功能模块名称 5+ API Uni API 系统库 SDK中的库 资源文件 Info.plist(添加权限描述或字段)
基础模块 CoreText.framework
JavaScriptCore.framework
WebKit.framework
CoreTelephony.framework
MobileCoreServices.framework
SystemConfiguration.framework
MediaPlayer.framework
AudioToolbox.framework
QuartzCore.framework
CFNetwork.framework
Foundation.framework
CoreFoundation.framework
CoreGraphics.framework
UIKit.framework
libc++.tbd
AVFoundation.framework
AssetsLibrary.framework
AddressBook.framework
CoreLocation.framework
UserNotifications.framework
libcoreSupport.a
liblibPDRCore.a
liblibUI.a
liblibNavigator.a
liblibNativeUI.a
liblibNativeObj.a
liblibAdSupport.a(IDFA)
liblibWeex.a
KSCrash.framework
PandoraApi.bundle
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
Accelerate.framework
Photos.framework
CoreMedia.framework
MetalKit.framework
GLKit.framework
liblibCamera.a DCTZImagePickerController.bundle
DCMediaEditingController.bundle
NSCameraUsageDescription
NSPhotoLibraryUsageDescription
NSPhotoLibraryAddUsageDescription
NSMicrophoneUsageDescription
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
CoreTelephony.framework
liblibGeolocation.a
libBaiduLocationPlugin.a
libBaiduKeyVerify.a
libssl.a
libcrypto.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
libz.tbd
QuartzCore.framework
Accelerate.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
paypal:
liblibPayment.a libpaypalpay.a PayPalCheckout.xcframework
stripe:
liblibPayment.a libstripepay.a Stripe.xcframework StripeCore.xcframework StripeUICore.xcframework Stripe3DS2.xcframework
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.xcframework UMCommon.xcframework 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
VideoToolbox.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
VideoToolbox.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 CoreBluetooth.framework
CoreLocation.framework

工程中引入liblibLog.a库和在control.xml里配置debug="true" 可以在集成的Xcode里输入console.log()日志。

2、在离线SDK包里,SDK/Resources/Libs目录下找到需要的库文件,然后把找到的liblibBlueTooth.a库拷贝到工程的libs目录下,再根据配置要求把相关的库引入到工程中,如下图:

3、有些功能(如推送、分享、语音识别、统计),则需要按照上文提到的“功能模块对照表”中的内容,去查找对应模块的“Info”值,并在工程属性界面“Info”下“Custom iOS Target Properties”中配置对应的项:

如百度地图三方SDK,需要配置在百度云平台申请应用的appkey,找到“baidu”项下的“appkey”,双击后输入正确的appkey值:

4、有些功能(如新浪微博分享和微信分享)还需要配置应用的URL Schemes,在“URL Types”项下分别输入在各开放平台申请的值:

5、iOS10之后 有些功能(如地图)需要在info.plist文件中添加隐私权限配置。

info.plist文件中如何添加隐私权限配置

# 其他模块/三方SDK配置