Skip to content

Commit

Permalink
readme: update example for new api
Browse files Browse the repository at this point in the history
```
VoipPushNotification.requestPermissions(); // --- optional, you can use another library to request permissions
VoipPushNotification.registerVoipToken(); // --- required
```
  • Loading branch information
zxcpoiu authored Dec 27, 2019
1 parent fe1f6c7 commit a36c520
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ Please refer to [VoIP Best Practices][2].
#### Add RNVoipPushNotification
On RN60+, auto linking with pod file should work. Or you can try below:
##### Option 1: Use [rnpm][3]
```bash
Expand Down Expand Up @@ -111,7 +114,8 @@ class MyComponent extends React.Component {
...

componentWillMount() { // or anywhere which is most comfortable and appropriate for you
VoipPushNotification.requestPermissions(); // required
VoipPushNotification.requestPermissions(); // --- optional, you can use another library to request permissions
VoipPushNotification.registerVoipToken(); // --- required

VoipPushNotification.addEventListener('register', (token) => {
// send token to your apn provider server
Expand Down

0 comments on commit a36c520

Please sign in to comment.