File tree Expand file tree Collapse file tree
WordPress/Classes/ViewRelated/Aztec/Media Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,14 +55,13 @@ private actor ConcreteMediaUploadBackgroundTracker: MediaUploadBackgroundTracker
5555 // State transtion: idle -> pending -> accepted -> [accepted...] -> idle.
5656 private var state : BGTaskState = . idle
5757
58- private init ? ( ) {
59- let taskId = ( Bundle . main. infoDictionary ? [ " BGTaskSchedulerPermittedIdentifiers " ] as? [ String ] ) ? . first {
60- $0. hasSuffix ( " .mediaUpload " )
61- }
62- guard let taskId else {
63- wpAssertionFailure ( " media upload task id not found in the Info.plist " )
64- return nil
65- }
58+ private init ( ) {
59+ let taskId = Bundle . main. bundleIdentifier! + " .mediaUpload "
60+
61+ wpAssert (
62+ ( Bundle . main. infoDictionary ? [ " BGTaskSchedulerPermittedIdentifiers " ] as? [ String ] ) ? . contains ( taskId) == true ,
63+ " media upload task id not found in the Info.plist "
64+ )
6665
6766 self . taskId = taskId
6867 BGTaskScheduler . shared. register ( forTaskWithIdentifier: self . taskId, using: nil ) { [ weak self] task in
You can’t perform that action at this time.
0 commit comments