iOS Firebase Push notification not working on simulator with Xcode 11.5 and iOS 13

Viewed 4188

I have tried for Firebase Push notification but its not working. Remote message is displaying on console with payload but not showing the notification on simulator. I using Xcode 11.5 and iOS 13.

  1. added GoogleService-Info.plist to root folder
  2. did all code required for Firebase Push notification
  3. uploaded .p12 file on firebase console
  4. added push notification capability on Xcode
1 Answers

You can follow this article for testing push notifications in the simulator. For testing remote notifications that is sent directly from firebase you will need a physical device. I am using xcode 11.6 and during the registration process it is showing a message in the console: Error! iOS Simulator does not support push! Please test on a real iOS device. remote notifications are not supported in the simulator

Here is the summary for testing push notification in simulator:

  • Register for push notifications and make sure you allow it.
  • Create a file named: test_push_notification.apns
  • Add and save the following JSON in the newly created file just by replacing bundle identifier as per your app.
  • { "Simulator Target Bundle": "com.yourapp.bundleid", "aps": { "alert": { "title": "Push on the simulator", "subtitle": "Test push notification", "body": "This notification will show up in the simulator!" } } }
  • Open terminal and navigate to the directory where you saved the file.
  • Run this command xcrun simctl push booted test_push_notification.apns
Related