
Security News
npm v12 Ships With Install Scripts Off by Default, Begins Deprecating 2FA-Bypass Tokens
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.
openinstall-react-native
Advanced tools
openinstall-react-native 是openinstall官方开发的 React Native 插件,使用该插件可以方便快速地集成openinstall相关功能。
在您的项目根目录下执行
npm install openinstall-react-native --save
React Native 0.60 开始,会自动 link 原生模块,请直接参考手动集成
react-native link
Error: Cannot find module 'asap/raw' 则先执行 npm install 再 react-native link 就好了如果你的iOS项目是通过Cocoapods来集成React Native(即原生应用集成react-native),可通过如下步骤安装本插件。(注意:使用 pod 就无须执行 react-native link 了,否则会有冲突。)
pod 'openinstall-react-native', :path => '../node_modules/openinstall-react-native'
pod install
(1)使用自动集成脚本集成代码和部分配置
npm run openinstall <yourAppKey> <yourScheme>
举例:
npm run openinstall e7iomw rc8tey
(2)xcode配置(只对iOS)
在 iOS 工程中,如果要使用universal links(通用链接)的拉起功能,需要开启 Associated Domains功能,请到苹果开发者网站,选择Certificate, Identifiers & Profiles,选择相应的AppID,开启Associated Domains。注意:当AppID重新编辑过之后,需要更新相应的mobileprovision证书。(详细配置步骤请看iOS集成指南),如果已经开启过Associated Domains功能,进行下面操作:
Capabilities 标签Associated Domains 开关$(SRCROOT)/../node_modules/openinstall-react-native/ios/RCTOpenInstall
如果只需要快速下载功能,无需其它功能(携带参数安装、渠道统计、一键拉起),完成sdk初始化即可(自动集成方式或手动集成方式)
请react native端入口js文件中(例如App.js文件)导入:
import OpeninstallModule from 'openinstall-react-native'
通常在 componentDidMount 中监听
componentDidMount() {
//该方法用于监听app通过univeral link或scheme拉起后获取唤醒参数
this.receiveWakeupListener = map => {
if (map) {
//do your work here
}
Alert.alert('拉起回调',JSON.stringify(map))
}
OpeninstallModule.addWakeUpListener(this.receiveWakeupListener)
}
componentWillUnMount() {
OpeninstallModule.removeWakeUpListener(this.receiveWakeupListener)//移除监听
}
在需要获取安装参数的位置,导入插件:
import OpeninstallModule from 'openinstall-react-native'
调用如下方法,可重复获取(理论上可在任意位置获取安装参数):
OpeninstallModule.getInstall(10, map => {
if (map) {
//do your work here
}
Alert.alert('安装回调',JSON.stringify(map))
})
SDK 会自动完成访问量、点击量、安装量、活跃量、留存率等统计工作。
在用户注册成功时,可调用该方法上报注册事件,需要导入'openinstall-react-native'
OpeninstallModule.reportRegister()
两个参数分别为 效果点的ID,string类型,以及 效果点的值,为整型,示例:
OpeninstallModule.reportEffectPoint('effect_test',1)
FAQs
openinstall sdk plugin for react-native
The npm package openinstall-react-native receives a total of 223 weekly downloads. As such, openinstall-react-native popularity was classified as not popular.
We found that openinstall-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.