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.

Giorgio
  • 1,973
  • 4
  • 36
  • 51
YongJie
  • 119
  • 1
  • 7

1 Answers1

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.

Giorgio
  • 1,973
  • 4
  • 36
  • 51
YongJie
  • 119
  • 1
  • 7
  • 1
    The [documentation](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns) 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`. – Giorgio Oct 04 '19 at 08:52