iOS13 can't support the background update notification?
Asked Answered
R

1

9

iOS13 can't support the background update notification.Is this an OS-level bug? And when app enter background,the Xcode warning shows:

Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

Retinol answered 24/9, 2019 at 13:26 Comment(4)
Please enter your code to better explain your case and so that we can help youPronounced
Just push a silent notification to an App on ios 13 device. like this : { "aps" : { "content-available" : 1 }, "acme1" : "bar", "acme2" : 42 }Retinol
You can edit your own post and add your code there to make your question clearerPronounced
This is a push test , just push this type of notification.Retinol
R
1

I have got the answer from the Developer Documentation: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns

apns-push-type

(Required when delivering notifications to devices running iOS 13 and later, or watchOS 6 and later. Ignored on earlier system versions.) The type of the notification. The value of this header is alert or background. Specify alert when the delivery of your notification displays an alert, plays a sound, or badges your app's icon. Specify background for silent notifications that do not interact with the user.

Retinol answered 25/9, 2019 at 4:38 Comment(1)
The documentation is changed. Now it says: "(Required for watchOS 6 and later; recommended for macOS, iOS, tvOS, and iPadOS) The value of this header must accurately reflect the contents of your notification’s payload. If there is a mismatch, or if the header is missing on required systems, APNs may return an error, delay the delivery of the notification, or drop it altogether.". It seems that apns-push-type is no longer required for iOS.Flattish

© 2022 - 2024 — McMap. All rights reserved.