- Let's start with building the App. We'll start that by adding the dependencies we need to App.js:
import React from 'react';import { StyleSheet, Text, View, TextInput, TouchableOpacity} from 'react-native';import { Permissions, Notifications } from 'expo';
- We're going to declare two constants for the API endpoints on our server, but the url will be generated by ngrok when we run the server later in the recipe, so we'll update the value of these constants at that point:
const PUSH_REGISTRATION_ENDPOINT = 'http://generated-ngrok-url/token';const MESSAGE_ENPOINT = 'http://generated-ngrok-url/message';
- Let's create the App component and initialize the state object. We'll need a notification property to hold notifications ...