Introduction
When venturing into push notifications for the first time, it’s natural that you will want to perform some testing to confirm that our SDK has been installed correctly in your app and is operating as expected. However, you will run into issues if you test on a physical device. We often see people running into issues related to a “missing” device id when trying to test using a simulator. We’ll explain why, and help you understand the requirement for physical devices to be used for testing.
Problem
You have a React Native project and you've installed the SDK successfully. You're trying to get the device id for push notifications, but despite giving user consent for notifications and seeing the user on your dashboard, no device is connected, thus you're unable to send a test notification. You've attempted to send the device id manually but still receive an 'APNs BadDeviceToken' error when sending a test push notification, specifically on an iOS device.
Solution
When testing push notifications, we have a requirement that you use a physical device as simulators may not provide accurate results. The prerequisites in our React Native SDK docs include the following info:
- Setup XCode and set your deployment target to 13.0 or later
- Make sure that you’ve got XCode command line tools installed—
xcode-select --install
- Get your Apple Push Certificate and enable push notifications for iOS in your Customer.io account
- You should have an iOS 13+ device to test your implementation. You cannot test push notifications in a simulator.
The physical device testing will give you a complete look at what your recipients will see when they get your notifications. While simulators are useful for simply confirming receipt, we have created an experience that allows for full accuracy and confirmation that your message looks exactly the way you want it to.