提交 c1d67faf 编写于 作者: DCloud-yyl's avatar DCloud-yyl

Merge branch 'zhaofengliang920817-master-patch-84692' into 'master'

Update app-nativeresource-ios.md

See merge request !220
......@@ -150,7 +150,9 @@ uni-app x项目manifest.json中没有提供iOS隐私信息访问许可描述的
- iOS Property List Key ‘CFBundleURLTypes’,参考:[https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleurltypes/](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleurltypes/)
## 资源文件(Bundle Resources)
## 资源文件(Native Resources)
### 资源文件配置(Bundle Resources)
HBuilderX中对项目右键菜单 "新建" -> "目录"
![](https://native-res.dcloud.net.cn/images/uniapp/nativeresource/newdir.png)
......@@ -162,6 +164,22 @@ HBuilderX中对项目右键菜单 "新建" -> "目录"
将需要添加的iOS原生资源文件拷贝到Resources目录,云端打包时将会合并到安装包的.app中。
### UniApp.entitlements 配置
如上`Bundle Resources`配置类似,在`nativeResources/ios`目录下创建`UniApp.entitlements`节点,UniApp.entitlements 文件配置如下:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:hellouniappx.dcloud.net.cn</string>
</array>
</dict>
</plist>
```
**注意**
- ios目录下不支持放Object-C/Swift源码文件,需要开发源码建议使用[UTS插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html)[uni原生语言插件](https://nativesupport.dcloud.net.cn/NativePlugin/README)
- resources目录中的资源文件不能通过uni API使用,需通过 iOS 原生 API 访问,参考[Accessing a Bundle's Contents](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1)。也就是在uni-app中,访问这些资源需要通过uts代码访问或编写[uni原生语言插件](https://nativesupport.dcloud.net.cn/NativePlugin/README)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册