Commit 7958723c authored by yogevbd's avatar yogevbd

Add send local notification on android example app

parent ecb81f51
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
StyleSheet, StyleSheet,
Text, Text,
View, View,
Button,
TouchableHighlight TouchableHighlight
} from 'react-native'; } from 'react-native';
...@@ -129,6 +130,7 @@ class MainComponent extends Component { ...@@ -129,6 +130,7 @@ class MainComponent extends Component {
<TouchableHighlight onPress={() => this.onCheckPermissions()}> <TouchableHighlight onPress={() => this.onCheckPermissions()}>
<Text style={styles.plainButtonText}>Check permissions</Text> <Text style={styles.plainButtonText}>Check permissions</Text>
</TouchableHighlight> </TouchableHighlight>
<Button title={'Send local notification'} onPress={this.sendLocalNotification} testID={'sendLocalNotification'}/>
</View> </View>
) )
} }
...@@ -142,6 +144,14 @@ class MainComponent extends Component { ...@@ -142,6 +144,14 @@ class MainComponent extends Component {
} }
} }
sendLocalNotification() {
NotificationsAndroid.localNotification({
title: "Local notification",
body: "This notification was generated by the app!",
extra: "data"
});
}
onPushRegistered() { onPushRegistered() {
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment