iOS Apps间分享数据
来源:互联网 发布:有关网络得现代诗歌 编辑:程序博客网 时间:2024/05/21 15:03
iOS Apps间分享数据
请参考:
- iOS应用程序间共享数据
- Tutorial: Sharing Data Locally Between iOS Apps
总的来说有如下几种:
- UIDocumentInteractionController
- UIActivityViewController
- Shared Keychain Access
- Custom URL Scheme
- Web Service
- UIPasteboard + URL Scheme
UIDocumentInteractionController
请参考:
- iOS关于使用其他应用打开本应用文档
- UIDocumentInteractionController之程序间文档共享
UIDocumentInteractionController文档见Document Interaction Programming Topics for iOS
注册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类型请参考:System-Declared Uniform Type Identifiers
打开支持的文件类型(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 the application: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.
保存共享的文件
请参考:
- Save file opened with UIDocumentInteractionController
- Import file from another application using UIDocumentInteractionController
参考
- Importing & Exporting Documents in iOS
- Importing Data via Custom File Types in iOS
- Why is my iOS app not showing up in other apps’ “Open in” dialog?列有常见的配置信息
- How do I associate file types with an iPhone application?
- iOS Apps间分享数据
- apps须遵循iOS数据存储指南
- apps须遵循iOS数据存储指南
- 2013 Stanford公开课 Developing iOS 7 Apps for iPhone and iPad 讲义分享
- android Sending Content to Other Apps[ 发送分享的数据到其他App]
- Android Receiving Content from Other Apps [从其他APP接收分享数据]
- ios应用间通信和分享数据的机制
- ios应用间通信和分享数据的机制
- ios应用间通信和分享数据的机制
- Flash IOS APPs Cookbook
- iOS Apps核心对象
- Open-Source iOS Apps
- iOS数据分享(兼容iPad,iphone)
- Start Developing iOS Apps Today
- Localization of Xcode iOS Apps
- Start Developing iOS Apps Today
- Start Developing iOS Apps Today
- HowTo: iOS Apps - Static analysis
- if exists用法(MSSQL)
- 数学 2016.2.16
- 弹窗 (居中 滚动)
- 数据结构与算法Javascript描述(四)双向链表
- 初学Servlet学习笔记之Listener
- iOS Apps间分享数据
- c3p0介绍与使用
- maven常用命令
- android的接口回调
- 百度质量部实习生内推2016
- 【网络流24题】试题库问题
- 销售订单界面仅查看设置
- CSS控制元素的在页面中水平、垂直居中
- loadrunner解决“服务器正在运行中”方法