项目配置
下载与HbuilderX对应的SDK,打开HBuilder-uniPluginDemo
工程
- 修改Info.list
中的dcloud_appkey
- 修改Info.list
中的Bundle ldentifier
- 修改HBuilder-Hello/Pandora/apps
目录下的文件名
- 修改HBuilder-Hello/Pandora/apps/XXX/manifest.json
中的ID
- 修改`HBuilder-Hello/Supporting Files/control.xml
中的appid
- 添加属性在Info.lilst
中加入
Application supports iTunes file sharing => YES
- 点击项目根目录,右键"Add files to"把插件的
xcodeproj
文件加入到工程中 TARGETS->Build Phases->Dependencies
把插件加入TARGETS->Build Phases->Link Binary With Libraries
把插件加入 在info.plist
文件中加入xml <key>dcloud_uniplugins</key> <array> <dict> <key>hooksClass</key> <string>DCRichAlertProxy</string> <key>plugins</key> <array> <dict> <key>class</key> <string>FloatingVideoModule</string> <key>name</key> <string>aliVideo</string> <key>type</key> <string>module</string> </dict> <dict> <key>class</key> <string>FloatingAudioModule</string> <key>name</key> <string>audioPlayer</string> <key>type</key> <string>module</string> </dict> </array> </dict> </array>
如果是需要在后台播放音乐,需要在info.plist
中添加xml <key>UIBackgroundModes</key> <array> <string>audio</string> </array>
https://nativesupport.dcloud.net.cn/NativePlugin/course/ios.html
// 通过宏 UNI_EXPORT_METHOD 将异步方法暴露给 js 端
UNI_EXPORT_METHOD(@selector(testAsyncFunc:callback:))
// 通过宏 UNI_EXPORT_METHOD_SYNC 将同步方法暴露给 js 端
UNI_EXPORT_METHOD_SYNC(@selector(testSyncFunc:))
IOS 视频播放有些能播有些不能播,检测一下视频格式,默认的AVPlayer支持的播放格式有限
悬浮先生成ipa在Hbuilder中才能调试