Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App shown in "Open in.." menu as "Copy to MyApp"

Recently, I was working on showing my app in "Open in..." menu when opening custom mail attachment (let's say filename-extension is xyz, and I've declared custom mime-type application/xyz). I followed guide on this site:

https://developer.apple.com/library/ios/qa/qa1587/_index.html

and my app is now displayed between all other apps, when I tap on corresponding attachment. The problem is in description under my app. Instead of just showing its name (MyApp) it's shown as Copy to MyApp. Is there any way to make my app description not contain Copy to words?

Update, here are my app info screens: enter image description here

enter image description here

like image 762
co- Avatar asked Nov 04 '15 08:11

co-


4 Answers

Your app will always show with "Copy to" using this method and "Open in..". No amount of tweaking the settings will change that.

What you want to do instead is create a Share extension. The steps for that are well documented by Apple. See for example: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/

A Share extension changes the nature of your app's interaction. Instead of responding to openURL in your app delegate, you create a share extension which deals with (possibly several files) as it sees fit.

like image 179
Dale Avatar answered Sep 28 '22 16:09

Dale


CFBundleTypeRole doesn’t works with iOS. Menu name is simply depends on LSHandlerRank.

Here is result on my test.

Owner: Copy to [MyApp]
Alternate, Default: Import with [MyApp]
None: No appearance
(tested in iOS 10.3.1)

Farther usage are detailed in CoreFoundationKeys reference.

https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685

If you want to use custom menu name, you can achieve this with Share extension as @Dale said.

like image 21
n.t Avatar answered Sep 28 '22 15:09

n.t


I know this is a pretty old question, but if you set LSSupportsOpeningDocumentsInPlace to true in your Info.plist, and then properly handle the results of that, iOS will show "Open In" instead of "Copy To" as long as the source app supports this.

See here:

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW13

and here:

https://developer.apple.com/documentation/uikit/uiapplicationopenurloptionsopeninplacekey

and here:

https://developer.apple.com/documentation/foundation/nsurl/1417051-startaccessingsecurityscopedreso

Update

Note that I see "Open In" when I browse a file of my file type from inside the iOS Files app. In Dropbox, I see "Copy To". I assume that the Files app sets some setting that Dropbox doesn't when showing the "Open In" sheet. Have you tried to open one of your files from the Files app after setting this setting?

like image 41
tcobbs Avatar answered Sep 28 '22 15:09

tcobbs


Make sure you set the LSHandlerRank in your .plist to Owner

Owner signalizes that yours is the native app that creates and opens files of this type.

Update Try setting the CFBundleTypeRole to Viewer

[...] "Viewer" role for your document type, [...] means that your application can open and read a particular file format, but can not save in this file format. Post on MacOSX Guru Site

I could imagine that you are not allowed to edit the actual files that are attached to an E-Mail anyway.

like image 24
MarkHim Avatar answered Sep 28 '22 15:09

MarkHim