A sample react native app (Android only) to test push notifications using AWS Pinpoint service
• git clone https://github.com/syumaK/Pinpoint-ReactNative-PushApp.git
• npm install
There exists two ways to connect your app to Firebase :
Option 1: (recommended) Use the Firebase console setup workflow.
Option 2: Use the Android Studio Firebase Assistant (requires additional configuration).
We’ll use the AWS Amplify CLI to initialize our AWS backend.
Make sure you have installed AWS Amplify CLI if not, you can refer to the amplify documentation link how to install and configure AWS Amplify CLI
$ amplify init
Step 3.2: Add FCM server key to Pinpoint server using the Pinpoint console or using AWS Amplify CLI as shown below
$ amplify add notification
Choose FCM as the push notification channel and when prompted for an ApiKey, enter the project credentials: Server Key that you previously saved from Firebase console
$ amplify push
Start the packager by running :
$ react-native start
Using an emulator or a real device run the command :
$ react-native run-android
If all the steps were executed smoothly, you should see the React Native sample app rendering the display below:
This sample code is made available under the MIT-0 license. See the LICENSE file.