openURL在Action Extension中不起作用 [英] openURL not work in Action Extension

查看:168
本文介绍了openURL在Action Extension中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加以下代码:

- (IBAction)done {
    // Return any edited content to the host app.
    // This template doesn't do anything, so we just echo the passed in items.

    NSURL *url = [NSURL URLWithString:@"lister://today"];
    [self.extensionContext openURL:url completionHandler:^(BOOL success) {
        NSLog(@"fun=%s after completion. success=%d", __func__, success);
    }];
    [self.extensionContext completeRequestReturningItems:self.extensionContext.inputItems completionHandler:nil];

}

。但是它无法工作。

我的目的是:当用户在Photos.app(iOS的默认Photos.app或被称为图库)中查看照片时,他点击用于启动扩展视图的分享按钮。
我们可以将图片从Photos.app传输到我自己的应用程序,并在我的应用程序中处理或上传图像。

My purpose is that: when user view a photo in Photos.app (the iOS's default Photos.app or called gallery), and he click the share button to launch our extension view. We can transfer the image from Photos.app to my own app and deal or upload the image in my app.

我也尝试CFBundleDocumentTypes但它也行不通。

I also try "CFBundleDocumentTypes" but it also can not work.

任何帮助都将不胜感激。

Any help will be appreciated.

推荐答案

这是设计的。我们不希望自定义操作成为应用启动器。

This is by design. We don't want Custom Actions to become app launchers.

这篇关于openURL在Action Extension中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆