簡體   English   中英

如何使iOS UIActivityViewController為本地KML文件顯示“在Google Earth中打開”?

[英]How make iOS UIActivityViewController show “Open in Google Earth” for local KML file?

使用iOS Mail應用程序:

  1. 我可以在iOS郵件應用中選擇一個KML電子郵件附件。
  2. 出現AirDrop頁面時,選擇“ 在Google Earth中打開 ”。

如何使我的應用程序與iOS郵件應用程序一樣工作?

當我使用UIActivityViewController並創建指向本地KML文件的NSURL時,將出現AirDrop頁面,其中顯示郵件,Facebook,Gmail,但不顯示 “在Google Earth中打開”?

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

iOS Mail如何與Goggle Earth共享KML文件附件或與Adobe Acrobat共享PDF文件附件?

預先感謝您的任何提示或建議,-Ed

iOS Mail顯示在Google地球中打開

您應該看一下Apple的UIDocumentInteractionController的文檔。

我已經嘗試過了,使用該控制器時會出現“ 在GoogleEarth中打開”選項。 例如,從視圖控制器中名為url的路徑的按鈕(稱為button )呈現它:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM