ios - 共享分机以共享最近通话中的号码

标签 ios swift ios-extensions

正在开发第一个 swift 应用程序,并陷入“共享扩展”。尝试将最近通话记录中的电话号码共享到应用程序以执行后台任务。

一旦用户从最近的通话记录中输入号码的个人资料,就想这样做:

将看到我的应用程序的图标:

现在想要获取电话号码和国家/地区代码来执行该任务,当前代码是:

class ShareViewController: UIViewController {
    override func viewDidLoad() {
        // Want to get selected phone number only and print it on the console for testing
        print("Test\n")
    }
}

如何做到这一点?

提前致谢

最佳答案

您的应用程序的图标已被使用。来自 Apples documentation :

In iOS, a custom Action extension uses a template image version of its containing app’s icon, which you must provide.

iOS Share extensions automatically employ the containing app’s icon. If you provide a separate icon in your Share extension target, Xcode ignores it. For all other app extension types, you must provide an icon that matches the containing app’s icon.

关于ios - 共享分机以共享最近通话中的号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44811214/

相关文章:

ios - 是否可以在 Xcode 中的 iOS 上运行 perl?

swift - 使用 swift 将文件上传到 mailgun 服务器

swift - 在 NavigationView 中使用函数会引发错误 : Cannot convert return expression of type 'AnyView.Type' to return type 'AnyView'

ios - 告诉 Action 扩展的后台状态

ios - 文档提供者的dismissGrantingAccessToURL 在iOS 8.3 中不起作用

ios - SwiftUI 和 CoreData - 有序列表

iOS:如何在 Settings.app 中显示可以删除的文件?

ios - PhoneGap Build 是否支持 iOS SDK 12.1?

swift - 类型 'Int' 不符合协议(protocol) 'BooleanType'