如何添加本机代码以反应本机(EXPO)

发布于 2025-02-13 08:30:29 字数 953 浏览 2 评论 0原文

我想从背景运行任务中将我的Expo应用程序带到前景,这是我在互联网上找到的唯一可以执行此操作的第三方软件包是 react-native-invoke-app ,但它不适用于Expo托管应用程序。

我认为我可以做到这三种方法,但我不知道如何实施其中的任何一个:

  1. 如何通过使用expo config插件

  2. 如何复制其本机Java代码,该代码将应用程序带入我的Expo应用程序中?也许构建自定义开发客户

  3. nofollow noreferrer “>自定义开发客户我可以用来从背景运行任务中将博览会应用程序带到前景的方法?请参阅我的另一个问题关于此事

我将感谢任何形式的帮助

I want to bring my expo app to the foreground from a background running task, the only third-party package I found on the internet that can do this is react-native-invoke-app but it does not work with expo managed apps.

There are three ways I think I can do this but I do not know how to implement any of them:

  1. How can I make this package compatible with expo by utilizing expo config plugin?

  2. How can I copy their native java code that involves bringing the app to the foreground into my expo app? and perhaps build a custom dev clients

  3. Is there any other method that I can use to bring an expo app to the foreground from a background running task? please see my other question on this matter

I will appreciate any form of assistance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀中猫帐中妖 2025-02-20 08:30:30

您的用例是什么?答案的一部分取决于您要做什么。

看起来像是通过推送通知可以通过推送通知来使用React-Native-invoke-App软件包,因此我将尝试利用推送通知。例如,您可以安排使用此软件包重复通知: https:https:/// github.com/expo/expo/tree/main/packages/expo-notifications

或设置firebase发送推送基于某些服务器逻辑,云功能或API请求的通知(您可以使用React-Native-background-fetch触发它们)。

您也可以使用深层链接,但这取决于您的用例。

据我所知,没有推动通知或深层链接,就无法将应用程序迫使应用程序进入前景。

What's your use-case? A bit part of the answer depends on what you're trying to do.

It looks like the react-native-invoke-app package works through push notifications, so I would try making use of push notifications. For example, you could schedule repeating notifications with this package: https://github.com/expo/expo/tree/main/packages/expo-notifications

Or set up Firebase to send the push notifications based on some server logic, cloud functions, or API requests (which you could trigger with react-native-background-fetch).

You could also make use of a deep link, but it depends on your use case.

As far as I know, there's no way to force an app into the foreground without a push notification or a deep link.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文