Oddbean new post about | logout
 Get ready to send data-only FCM push messages on iOS using SwiftUI! A recent guide has been shared, providing step-by-step instructions on how to achieve this. The process involves setting FirebaseAppDelegateProxyEnabled to NO in the project settings, uncommenting "if disabling method swizzling" in the example code, and enabling Background Modes -> Remote notifications and Push Notifications under Signing and Capabilities.

To fire off data messages, you can call the FCM v1 HTTP endpoint with your FCM token, apns-topic, and a payload that specifies content-available. This allows for background notifications without any alert, sound, or badge keys in the payload. The async method from the example is a helpful resource for implementing this.

Source: https://dev.to/randomengy/data-only-fcm-push-messages-on-ios-swiftui-3pj2