android - 来自本机反应的 Intent.ACTION_SEND
问题描述
我正在尝试通过 android 意图将 .pdf 发送到 MobiPrint。我在 Kotlin 中有一个示例,但问题是,我正在使用 React Native(在 Expo 内部)并且还不能正确翻译它。
这是 Kotlin 代码
val path: String? = _uri?.path
if(path != null) {
val intent = Intent(Intent.ACTION_SEND)
intent.setClassName(
“com.mobiprintpro.retail.android“,
“com.mobiprintpro.retail.android.ActivitySend“
)
intent.putExtra("companyCode", "")
intent.putExtra(Intent.EXTRA_STREAM, _uri)
intent.putExtra("fileUri", _uri.toString())
intent.type = "application/pdf"
intent.flags = Intent.FLAG_ACTIVITY_NO_HISTORY
startActivity(intent)
}
Expo 确实有一个意图启动器:import * as IntentLauncher from 'expo-intent-launcher';
,但它似乎不包括 Intent.ACTION_SEND。如果需要的话,我不反对退出世博会,但是我还没有在世博会之外找到 React Native 的解决方案。如果有人能指出我正确的方向,将不胜感激。
解决方案
推荐阅读
- jsartoolkit - 如何将jsartoolkit5与webRTC连接?
- cypress - 当在 cypress 中找不到元素时,如何显示自定义错误消息。另外,我的测试应该继续并完成。我尝试了下面的代码
- amazon-web-services - 如何在 AWS EventBridge 上按对象键后缀过滤 s3 数据事件
- ios - 如何快速重新加载折线图的数据?
- python - 饥饿的鱼问题:受感染的鱼可以吃另一条比自己小的鱼。所需的最少操作次数
- angular - 在 Angular 应用程序中将 mousemove 绑定到样式属性会产生 ExpressionChangedAfterItHasBeenCheckedError
- html-email - 我应该在哪里放置我的电子邮件标记 一键操作代码
- javascript - 在 asp.net 核心控制器中创建要使用的对象时出错
- reactjs - 使用基于 GatsbyJs 构建的 react-player 在项目中解析错误
- php - 从源数组递归生成 uniq 数据(所有组合)