Silent notifications

I have a question regarding notifications. I have been using the alert quite successfully, however when using silent I run into issues. The message is sent, meaning I receive success result, but when debugging the app I receive no action. However when using application PUSH Hero just for test doing the silent notification works and I receive the action expected. I assume I have mistake in the json format but as I am quite desperate I have just copied and pasted the one from your doc { "aps": { "content-available": "1" }, "acme1": "bar", "acme2": 42 }

I have added the push type as that's what I selected in the push hero application, but still no help { "ApnsHeaders": { "apns-push-type": "background", "aps": { "content-available": "1" } }

I have tried several modifications to the json format, even adding priority but nothing seems to work. BTW I have registered for the notification in info.plist as stated in the doc

solved

I too have the same problem but not with the push hero application. My function:


class AppDelegate: NSObject, UIApplicationDelegate {

        func application(

          _ application: UIApplication,

            didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?,

            connectionOptions: UIScene.ConnectionOptions) -> Bool {


Is not called when a notification with "apns-push-type": "background" is set. I receive 200 status from the sandbox APNS servers but no notification is received by the App whilst locally connected to my Mac with a cable and Xcode running. Breakpoints set but not activated.

If I change the apns-push-type to "alert" it works fine, however I don't want to have notification banners popping up when my app is in the background or closed. My JSON payload has "content-available": 1 set as per documentation, and no other fields set within the APS field

Silent notifications
 
 
Q