Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

react-native-umsdk

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-umsdk

## Getting started

latest
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

react-native-umsdk

Getting started

$ npm install react-native-umsdk --save

cd ios

pod install

Usage

Android

1.先预初始化,在MainApplication.java 的onCreate 中调用 RNUmsdkModule.preInitUMSDK
2.正式的初始化需要在用户同意过用户隐私协议之后才能调用UMSdk.js initUMSDK

ios端

ios暂时没有隐私相关问题,无需预初始化。
1.可以在appDelegate didFinishLaunchingWithOptions方法汇中调用 [ReactBridgeManager initUMSD];
2.或者可以在js端使用 UMSdk.js initUMSDK

UMShare

  • initUMSD中配置share相关的参数
  • 使用 share.js 中 shareToPlatform直接发起分享

UMPush

ios

需要配置xcode,打开推送开关Capabilities -> capability+ 添加 推送开关Push Notifiications和 后台推送权限Background Modes - Remote notifiications
保存devicetoken
ios

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(nonnull NSData *)deviceToken{
  
  [RNUMPush saveDeviaceToken:deviceToken];
}

获取devicetoken

RNUMPush.getDeviceToken(()=>{})

默认不打开前台系统弹窗setAutoAlert,需要自己创建提示框 使用

  • 获取deviceToken,并上传服务端,
  • 通过push.js 中的 userNotificationCenter方法可以注册推送,并监听推送消息

Keywords

react-native

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

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.

Install

Related posts