npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-getui-test

v1.1.55

Published

Getui push sdk plugin for rect-native

Downloads

5

Readme

react-native-getui

  • react-native-getui 是个推官方开发的 React Native 插件,使用该插件可以方便快速地集成推送功能。

  • 多厂商版本请联系技术支持

环境

  1. React Native Version "react": "18.3.1" "react-native": "0.75.4"
  2. 当前react-native-getui版本 1.1.55

注意:

  • react-native 版本>=0.76,建议使用插件版本>=1.1.54
  • 插件版本1.1.53 是expo App定制版本。

1.安装

1.1 使用 npm 自动安装

在您的项目根目录下执行

step1:添加npm包依赖
 npm install react-native-getui@latest --save 


step2:iOS, pod项目, 链接iOS原生代码
npx pod-install


step2: 链接 (非Autolinking项目, 和iOS非pod项目)
react-native link

step3: 自动添加GTSDK配置代码
npm run GetuiConfigure <yourAppId> <yourAppKey> <yourAppSecret>  <yourModuleName>

//yourModuleName 指的是你的 Android 项目中的模块名称(对 iOS 没有影响,不填写的话默认值为 app)
npm run GetuiConfigure DI1jwW3FtZ6kGDeY5dk0Y9 DQCk2V8Jev9hqhWDU94PF9 Rtyp5trKUt8HSyzD8zRXX7 app

1.2 示例

2. 配置

  • yourAppId yourAppKey yourAppSecret 需要去 个推官网 注册后,在后台配置获取。

2.1 Android

  • 使用step3: 自动添加GTSDK配置代码后, AndroidManifest.xml自动生成配置

    <manifest>
     <application>
    		  <meta-data android:name="PUSH_APPID" android:value="你的appid"/>
            <meta-data android:name="PUSH_APPKEY" android:value="你的appkey"/>
            <meta-data android:name="PUSH_APPSECRET" android:value="你的appSecret"/>
       </application>
    </manifest>

    没有的话, 需要自己添加

  • 默认不混淆, 如果开启了混淆 将插件中proguard.txt的内容, 复制到Android工程的proguard-rules.pro中

      -keep class com.igexin.** { *; }
      -keep class com.getui.gtc.** {*;}
      //如果接入厂商,查看proguard.txt

2.2 IOS

2.2.1 使用step3: 自动添加GTSDK配置代码后,

  • Appdelegate.h 自动生成配置

    #if __has_include(<RCTGetuiModule/RCTGetuiModule.h>)
    #import <RCTGetuiModule/RCTGetuiModule.h>
    #elif __has_include("RCTGetuiModule.h")
    #import "RCTGetuiModule.h"
    #elif __has_include(<GtSdkRN/RCTGetuiModule.h>)
    #import <GtSdkRN/RCTGetuiModule.h>
    #endif
    #define kGtAppId @"DI1jwW3FtZ6kGDeY5dk0Y9"
    #define kGtAppKey @"DQCk2V8Jev9hqhWDU94PF9"
    #define kGtAppSecret @"Rtyp5trKUt8HSyzD8zRXX7"
  • Appdelegate.m 的didFinishLaunchingWithOptions中自动生成代码

     // 接入个推
    [GeTuiSdk startSdkWithAppId:kGtAppId appKey:kGtAppKey appSecret:kGtAppSecret delegate:[RCTGetuiModule sharedGetuiModule] launchingOptions:launchOptions];
      
     // APNs
    [GeTuiSdk registerRemoteNotification: (UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge)];  

没有的话, 需要自己添加

2.2.2 使用CocoaPods安装

如果是原生应用集成react-native

如果你的 React Native 是通过 Cocoapods 来集成的则使用下面两个步骤来集成

  1. 在Podfile中添加如下代码(需要写在对应的 target 里):
pod 'GtSdkRN', :path => '../node_modules/react-native-getui'
  1. 终端执行如下命令:
pod install

注意:

  • 使用 pod 就不要使用 react-native link 了,不然会有冲突。

  • 在 iOS 工程中如果找不到头文件可能要在 TARGETS-> BUILD SETTINGS -> Search Paths -> Header Search Paths 添加如下如路径

    $(SRCROOT)/../node_modules/react-native-getui/ios/RCTGetuiModule

2.3 手动安装

替换 step3: 自动添加GTSDK配置代码手动安装

注意:

  • 在 iOS 工程中如果找不到头文件需要在 TARGETS-> BUILD SETTINGS -> Search Paths -> Header Search Paths 添加如下如路径:

    $(SRCROOT)/../node_modules/react-native-getui/ios/RCTGetuiModule
  • 因新版本功能修改,需要添加“libresolv.tbd”库

2.4 API调用与订阅消息

查看示例

android 与 ios 有部分API不同, 查看插件的index.js 或 index.d.ts中API的注释

3.iOS注意事项

项目需要打开通知能力,才能获取DeviceToken用于通知展示点击等业务。Xcode打开工程,Signing & Capabilities中添加Push Notification和Background Modes如下:

上述GetuiConfigure指令会在AppDelegate中插入初始化GTSDK代码,具体如下: