5

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

Alexander Borisenko
  • 1,574
  • 1
  • 12
  • 16
  • Have you tried to override activityTitle? override func activityTitle() -> String? { return "Import with AppName" //The string you return should be localized. } – Evgeny Karkan Aug 05 '16 at 12:48
  • @EvgenyKarkan isn't that's for activities done while in app? My question is for when you are in a different app – Mail, iCloud Drive, etc. – Alexander Borisenko Aug 05 '16 at 13:03

1 Answers1

11

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.

Roman Ermolov
  • 7,898
  • 5
  • 27
  • 35