Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/starhosea/rn-getui
个推 ReacNative 库,支持 Android,IOS,Web,支持 Expo
https://github.com/starhosea/rn-getui
Last synced: 21 days ago
JSON representation
个推 ReacNative 库,支持 Android,IOS,Web,支持 Expo
- Host: GitHub
- URL: https://github.com/starhosea/rn-getui
- Owner: StarHosea
- Created: 2024-09-28T08:34:35.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-28T09:06:25.000Z (4 months ago)
- Last Synced: 2024-12-19T15:48:58.407Z (28 days ago)
- Language: Objective-C
- Size: 13.3 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
个推 ReacNative 库,支持 Android,IOS,Web,支持 Expo
## 安装
```
npm install @starhosea/rn-getui
```## 使用
```
import { Getui } from '@starhosea/rn-getui';
// 初始化, 填写个推申请的 appId
Getui.initPush("my-appid");Getui.onPushMessage((message)=>{
console.log('push message', message.payload);
});
//
Getui.onNotificationEvent((evt)=>{
console.log('notification event', evt);
});// clientId 变化回调
Getui.onClientId(({ cid })=>{});
// 在线状态变化回调
Getui.onOnlineStatus(( { onlineState} )=>{});
// pid 变化回调
Getiu.onServerPid(( { pid } )=>{})Getui.bindAlias("");
Getui.unbindAlias("");
Getui.turnOnPush();
Getui.turnOffPush();
Getui.setTag(["my-tag"]);
Getui.stop();
Getui.resume();const clientId = Getui.getClientId();
const version = Getui.getVersion();
const isPushTuredOn = Getui.isPushTurnedOn();```