Date:

Share:

Testing remote push notifications on iOS simulator in Xcode 14

Related Articles

I recently found out that starting with Xcode 14 we will be able to test remote push notifications in the iOS simulator. Previously, simulators were unable to provide a device token, limiting us to simulating notifications locally using .apns Load files and the simctl push command.

To be able to send remote push notifications to the iOS simulator in Xcode 14, we need to be running macOS 13 on a computer with an Apple Silicon or T2 processor. In this setting, the simulator generates a unique registration token, specific to the combination of the simulator and the Mac hardware it is running on.

The simulator supports the Apple Push Notification Service (APNS) sandbox environment, which means we need to connect to api.sandbox.push.apple.com Send a message to the simulator.

I think this feature is great, because it allows us to test the whole process of sending a push notification, when we don’t have a real device at hand. It also allows us to use the simulator to test additional features, such as extensions to notification services, which was not possible with .apns Payload files or the simctl push command in the terminal.

Integrating SwiftUI in UIKit apps by Natalia Panprovova book cover

SwiftUI integration in UIKit apps

SwiftUI integration intoUIKit apps

A detailed guide to the gradual adoption of SwiftUI in UIKit projects.

  • Discover different ways to add SwiftUI views to existing UIKit projects
  • Use Xcode previews when designing and building a user interface
  • Update your UIKit apps with iOS 16 features such as Swift Charts and lock screen widgets
  • Move larger parts of your apps to SwiftUI while reusing UIKit’s built-in views and controllers

Source

Popular Articles