iOS Apps间分享数据
发布日期:2022-03-18 08:27:37
浏览次数:42
分类:技术文章
本文共 2375 字,大约阅读时间需要 7 分钟。
iOS Apps间分享数据
请参考:
总的来说有如下几种:
- UIDocumentInteractionController
- UIActivityViewController
- Shared Keychain Access
- Custom URL Scheme
- Web Service
- UIPasteboard + URL Scheme
UIDocumentInteractionController
请参考:
UIDocumentInteractionController文档见
注册APP支持的文件类型(Registering the File Types Your App Supports)
在Info.plist中使用CFBundleDocumentTypes
键,对应的为array,可以包括如下的key: - CFBundleTypeName specifies the name of the document type(文件类型).
- CFBundleTypeIconFiles is an array of filenames for the image resources to use as the document’s icon(图标).
- LSItemContentTypes contains an array of strings with the UTI types that represent the supported file types in this group(UTI数组).
- LSHandlerRank describes whether this application owns the document type or is merely able to open it(是否拥有or仅仅是打开).
UTI类型请参考:
打开支持的文件类型(Opening Supported File Types)
The system may ask your application to open a specific file and present it to the user. This typically occurs because another application encountered the file and used a document interaction controller to handle it. You receive information about the file to be opened in theapplication:willFinishLaunchingWithOptions:
or application:didFinishLaunchingWithOptions:
method of your application delegate. If your application handles custom file types, you must implement this delegate method (instead of the applicationDidFinishLaunching: method) and use it to initialize your application. The options dictionary passed to the application:willFinishLaunchingWithOptions:
or application:didFinishLaunchingWithOptions:
method contains information about the file to be opened. Specifically, your application should look in this dictionary for the following keys:
UIApplicationLaunchOptionsURLKey
contains an NSURL object that specifies the file to open.UIApplicationLaunchOptionsSourceApplicationKey
contains an NSString with the bundle identifier of the application that initiated the open request.UIApplicationLaunchOptionsAnnotationKey
contains a property list object that the source application wanted to associate with the file when it was opened. If theUIApplicationLaunchOptionsURLKey
key is present, your application must open the file referenced by that key and present its contents immediately. You can use the other keys in the dictionary to gather information about the circumstances surrounding the opening of the file.
保存共享的文件
请参考:参考
- 列有常见的配置信息
转载地址:https://windzen.blog.csdn.net/article/details/50847902 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
表示我来过!
[***.240.166.169]2024年04月25日 03时07分45秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
Unity打开照相机与打开本地相册然后在Unity中显示照片(Android与iOS)
2021-06-30
无需接入SDK即可在Unity中获取经纬度(Android/iOS),告诉我你的坐标
2021-06-30
Unity获取系统信息SystemInfo(CPU、显卡、操作系统等信息)
2021-06-30
Unity中获取物体的尺寸(size)的三种方法
2021-06-30
Unity中的关节组件和绳子效果的实现
2021-06-30
Unity可视化编程插件: Bolt,可以像UE4的蓝图那样啦
2021-06-30
Android的.dex、.odex与.oat文件扫盲
2021-06-30
Unity移动应用如何在Bugly上查看崩溃堆栈
2021-06-30
一分钟搞明白Android的.so文件、ABI和CPU的关系
2021-06-30
UGUI的Text描边Outline拓展
2021-06-30
游戏性能指标参考,游戏质量白皮书下载
2021-06-30
游戏帧同步学习笔记
2021-06-30
Mac苹果电脑分辨率不够用,安装SwitchResX这个软件完美解决
2021-06-30
iOS Info.plist知多少
2021-06-30
XCode9之后命令打包需要使用OptionExport.plist
2021-06-30
关于iOS XCode的entitlements文件
2021-06-30
Airtest自动化测试神器,教你实现Unity自动化测试
2021-06-30
模拟器连接端口汇总和常用ADB命令
2021-06-30