Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show app as "Import with <AppName>" in UIActivityViewController

I'm implementing export / import feature for my app:

Export data with custom file extension (Backup.appname) → tap on file in mail or iCloud drive → have my app shown as "Import with AppName" in share sheet.

I added a custom UTI and document type to my app's plist as explained here. Everything works as it should, except my app is shown as "Copy to AppName", and not "Import with AppName".

How can I get it shown as "Import with AppName"? I've seen other apps have it for their custom file types.

enter image description here

like image 390
Alexander Borisenko Avatar asked Aug 04 '16 07:08

Alexander Borisenko


1 Answers

It happens because you are using key LSHandlerRank with value Owner. If you change this value to Alternate, text will change to Import with <AppName>.

I can't find any documented confirmation about this behavior (only possible types of handler), as well as what will happen if you change the value of LSHandlerRank for your custom type.

Seems that most of apps use common types, such as public.data, public.content and don't set value of LSHandlerRank at all.

like image 196
Roman Ermolov Avatar answered Oct 31 '22 15:10

Roman Ermolov