Skip to content

Commit 9c3846d

Browse files
committed
doc: update readme
1 parent ecd5ba6 commit 9c3846d

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ Put it in a wrapper component. (Maybe where you handle your incoming push notifi
4242
```javascript
4343
import NotificationPopup from 'react-native-push-notification-popup';
4444

45-
// ...
46-
45+
class MyComponent extends React.Component {
4746
render() {
4847
return (
4948
<View style={styles.container}>
@@ -52,6 +51,31 @@ import NotificationPopup from 'react-native-push-notification-popup';
5251
</View>
5352
);
5453
}
54+
// ...
55+
```
56+
57+
#### Optional: Customize your popup
58+
59+
```javascript
60+
// Render function
61+
const renderCustomPopup = ({ appIconSource, appTitle, timeText, title, body }) => (
62+
<View>
63+
<Text>{title}</Text>
64+
<Text>{body}</Text>
65+
</View>
66+
);
67+
68+
class MyComponent extends React.Component {
69+
render() {
70+
return (
71+
<View style={styles.container}>
72+
<NotificationPopup
73+
ref={ref => this.popup = ref}
74+
renderPopupContent={renderCustomPopup} />
75+
</View>
76+
);
77+
}
78+
// ...
5579
```
5680
5781
### Show it!

0 commit comments

Comments
 (0)