[英]How to send a photo to my app from default iOS Camera app?
I know my app can read the photos saved in iOS photo-library; 我知道我的应用程序可以读取iOS照片库中保存的照片; also my app can save a new photo in the default iOS photo-library.
我的应用程序也可以在默认的iOS照片库中保存新照片。 But what I am trying to achieve is something like this: the default Photos app should be able to send a photo to my iOS app, just like you can share a photo to Facebook or send to iOS Mail app.
但我想要实现的是这样的:默认的照片应用程序应该能够将照片发送到我的iOS应用程序,就像您可以将照片分享到Facebook或发送到iOS Mail应用程序一样。
I want my application to be listed in this screen. 我希望我的应用程序列在此屏幕中。 Note: this is a screenshot of iOS6 Photo application.
注意:这是iOS6 Photo应用程序的屏幕截图。
POSSIBLE!!! 可能!!!
This thing is very interesting on iOS. 这个东西在iOS上非常有趣。
You have to tell iOS what kind of files your app can open (see pic below) 你必须告诉iOS你的应用程序可以打开哪种文件(见下图)
Kind of file your app can open will be set by Conforms To
field (see all kinds https://developer.apple.com/library/ios/documentation/miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html ) 您的应用可以打开的文件类型将由
Conforms To
字段设置(请参阅所有种类https://developer.apple.com/library/ios/documentation/miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html )
This is a best sample about it ( http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email-in-your-ios-app ) 这是关于它的最佳样本( http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email-in-your- ios-app )
You have to implement -application:handleOpenURL:
in AppDelegate
您必须在
AppDelegate
实现-application:handleOpenURL:
.
-(BOOL) application:(UIApplication *)application handleOpenURL:(NSURL *)url {
//url is a local url of photo you've chosen, iOS copied it into document folder of your app
//do what you want
}
================================================ ================================================
If you want to see how some app (Dropbox, GoogleDrive ...) can open some kind of files, you can see their info.plist
files 如果你想知道一些应用程序(Dropbox,GoogleDrive ......)如何打开某种文件,你可以看到他们的
info.plist
文件
Good luck 祝好运
It's not possible to add your app in the iOS "Photos" app. 无法在iOS“照片”应用中添加您的应用。 But it's possible if you want other (3rd party) apps to be able to open files in yours.
但是,如果您希望其他(第三方)应用程序能够打开您的文件,则可能。 Please refer below links.
请参考以下链接。
http://support.apple.com/kb/PH3268 , http://support.apple.com/kb/PH3268 ,
http://www.iphonehacks.com/2013/09/ios-7-photos-app.html http://www.iphonehacks.com/2013/09/ios-7-photos-app.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.