MainScreen.js
2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import React, { Component, Notifications } from 'react';
import { StyleSheet, Text, View, TextInput, Image, } from 'react-native';
export default class Login extends Component {
constructor(props) {
super(props);
this.state = {
ID: this.props.navigation.getParam('ID'),
};
}
static navigationOptions = {
title: 'MainScreen',
};
render() {
return (
<View style={styles.container}>
<View style={styles.header}>
<Text>{this.state.ID}</Text>
</View>
</View>
);
}
}
var PushNotification = require('react-native-push-notification');
PushNotification.configure({
// (optional) Called when Token is generated (iOS and Android)
onRegister: function(token) {
console.log( 'TOKEN:', token );
},
// (required) Called when a remote or local notification is opened or received
onNotification: function(notification) {
console.log( 'NOTIFICATION:', notification );
},
// ANDROID ONLY: GCM Sender ID (optional - not required for local notifications, but is need to receive remote push notifications)
senderID: "YOUR GCM SENDER ID",
// IOS ONLY (optional): default: all - Permissions to register.
permissions: {
alert: true,
badge: true,
sound: true
},
// Should the initial notification be popped automatically
// default: true
popInitialNotification: true,
/**
* (optional) default: true
* - Specified if permissions (ios) and token (android and ios) will requested or not,
* - if not, you must call PushNotificationsHandler.requestPermissions() later
*/
requestPermissions: true,
});
const styles = StyleSheet.create({
input: {
height: 50,
width: 250,
fontSize: 0,
alignSelf: 'center',
borderRadius: 1,
borderStyle: 'dotted',
borderBottomColor: "#0066cc",
borderBottomWidth: 2,
},
container: {
flex: 1,
backgroundColor: 'white',
},
header: {
flex: 2,
backgroundColor: 'white',
},
logo: {
flex: 4,
backgroundColor: 'white',
},
inputPart: {
flex: 4,
backgroundColor: 'white',
},
});