0
votes

Using iOS Mail app:

  1. I can select a KML email attachment in the iOS mail app.
  2. When the AirDrop page appears, Open in Google Earth is one of the choices.

How can I make my app work the same as iOS mail app?

When I use UIActivityViewController and create a NSURL to the local KML file, the AirDrop page appears displaying Mail, Facebook, Gmail, but NOT "Open in Google Earth" ?

NSURL* urlToLocalKmlFile=[NSURL fileURLWithPath:localKmlFilePath];
NSArray *objectsToShare = @[urlToLocalKmlFile];
activityViewController = [[UIActivityViewController alloc]
initWithActivityItems:objectsToShare
applicationActivities:nil];

How does iOS Mail share a KML file attachment with Goggle Earth or a PDF file attachment with Adobe Acrobat?

Thanks in advance for any tips or suggestions, -Ed

iOS Mail shows Open in Google Earth

1
You might want a UIDocumentInteractionController.rmaddy
localKmlFilePath: /var/mobile/Containers/Data/Application/E06D33D8-AA84-4CCC-B861-93EC49203324/Documents/tmp/JOB-0001/JOB-0001.kml urlToLocalKmlFile: file:///var/mobile/Containers/Data/Application/E06D33D8-AA84-4CCC-B861-93EC49203324/Documents/tmp/JOB-0001/JOB-0001.kmlEd of the Mountain

1 Answers

1
votes

You should take a look at the documentation of UIDocumentInteractionController by Apple.

I've tried it now and the Open in GoogleEarth option appears when you use that controller. For example to present it from a button (called button) for a path called url in a view controller:

UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL:url];
[interactionController presentOpenInMenuFromRect:button.frame inView:self.view animated:YES];