共享扩展以打开包含应用程序 [英] Share Extension to open containing app

查看:239
本文介绍了共享扩展以打开包含应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的应用创建Android Style共享功能。
我创建了一个共享扩展程序,当你在股票照片应用程序中选择图片并按下共享时,它会被调用。
现在我想将这些图片发送到主应用程序并在那里处理。
我现在的问题是:

I want to create an Android Style share feature for my app. I created a share extension which gets called when you select pictures inside the stock photo app and press share. Now I want those pictures to be sent to the main app and get handled over there. My question is now:


  1. 在共享扩展程序窗口按下按钮后iOS可以打开我的应用程序吗?

  2. 如何在主应用程序中获取图片文件?


推荐答案

目前无法做到这一点。共享扩展无法打开包含应用。

Currently there's no way to do this. A share extension cannot open the containing app.

共享扩展的预期方法是他们自己处理所有必要的工作。扩展程序可以使用自定义框架与其包含的应用程序共享代码,因此在大多数情况下这没有问题。

The intended approach for share extensions is that they handle all of the necessary work themselves. Extensions can share code with their containing apps by using custom frameworks, so in most cases that's no problem.

如果您想为您的应用程序提供数据,您可以设置启动应用程序组,以便拥有共享目录。扩展可以在那里写入数据,应用程序可以读取它。但是,直到下次用户启动应用程序时才会发生这种情况。

If you want to make data available to your app, you can set up an app group so that you have a shared directory. The extension can write data there, and the app can read it. That won't happen until the next time the user launches the app, though.

这篇关于共享扩展以打开包含应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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