
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-native-uni
Advanced tools
react-native 桥接uni小程序sdk
uni-app 是一个使用 Vue.js 开发所有前端应用的框架,开发者编写一套代码,可发布到iOS、Android、H5、以及各种小程序(微信/支付宝/百度/头条/QQ/钉钉/淘宝)、快应用等多个平台。
有nvue部分底层使用weex实现的,但是感觉体验还是没有rn好。rn在国内又不太接地气,没有uni各种完善的第三方框架,就可以集成uni小程序sdk,使我们的react-native应用具有跟微信小程序类似的功能。

npm install react-native-uni --save
//or
yarn add react-native-uni
import * as Uni from "react-native-uni";
// ...
Uni.initialize({...})
Uni.launch({appid: '__UNI__7586C24'})
rn >= 0.60 自动链接 cd ios && pod install
rn < 0.60
react-native link react-native-webview
安卓有些配置项请参考example项目
uni小程序官网 此项目是在react-native中集成uni的小程序sdk,相关注意事项参考官方文档 由于依赖weex等的相关包比较大,只是集成基础包应用都会大个20M左右。 此桥接库只默认集成了基础包,如果提示缺少模块,只需要去官网下载sdk添加缺少的包
type Config = {
// 胶囊按钮的标题和标识
items?: { title: string; key: string }[];
//是否显示胶囊按钮
capsule?: boolean;
//安卓独有,胶囊按钮字体大小
fontSize?: string;
//安卓独有,胶囊按钮字体颜色
fontColor?: string;
//安卓独有,胶囊按钮字体宽度
fontWeight?: string;
};
初始化框架,越前面越好,只需要调用一次
设置小程序开启的启动页面
type LaunchArgs = {
//uni小程序id
appid: string;
//需要传给小程序的参数
params?: Object;
//打开小程序的路径
path?: string;
};
打开小程序。
根据小程序id判断是否存在小程序
获取真正运行的小程序id
获取小程序版本信息
获取小程序运行路径
获取当前小程序的直连url
关闭当前小程序
释放wgt文件
监听胶囊自定义按键启动
监听小程序向app发送的消息
监听小程序关闭
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade More than one file was found with OS independent path 'AndroidManifest.xml'
android/build.gradle 修改gradle版本 classpath("com.android.tools.build:gradle:3.4.0")
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
react-native 桥接uni小程序sdk
We found that react-native-uni demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.