flutter_uploader icon indicating copy to clipboard operation
flutter_uploader copied to clipboard

Background upload in ios using version 3

Open scattered-code opened this issue 4 years ago • 1 comments

The uploader works great while the app is in the foreground, but the uploads fail as soon as the app enters the background on iOS.

Here's some additional behavior I noticed: Local notifications fire even if the app is in the background The server sees the request being aborted by the client (app) I save the files I attempt to upload in a sqflite db, and retry them from the background thread once they fail (rebuild the whole request), but this fails as well immediately. The background handler is registered with the uploader from the main thread and does fire events even when backgrounded BGTaskSchedulerPermittedIdentifiers and UIBackgroundModes are set to everything I could think of:

<plist version="1.0">
<dict>
	  <key>BGTaskSchedulerPermittedIdentifiers</key>
	  <array>
		  <string>com.your.app.identifier</string>
		  <string>com.premierpups.nurturekms</string>
		  <string>flutter_uploader</string>
		  <string>chillisoure.flutter_uploader</string>
		  <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
		  <string>$(PRODUCT_BUNDLE_IDENTIFIER).flutter_uploader</string>
		  <string>chillisource.flutter_uploader.upload.background</string>
	  </array>
	  <key>CFBundlePackageType</key>
	  <string>APPL</string>
	  <key>FUMaximumConnectionsPerHost</key>
	  <integer>1</integer>
	  <key>FUMaximumUploadOperation</key>
	  <integer>1</integer>
	  <key>LSApplicationQueriesSchemes</key>
	  <array>
		  <string>https</string>
	  </array>
	  <key>LSRequiresIPhoneOS</key>
	  <true/>
	  <key>UIBackgroundModes</key>
	  <array>
		  <string>fetch</string>
		  <string>processing</string>
		  <string>remote-notification</string>
	  </array>
</dict>
</plist>

Any guidance / help is appreciated. Thank you!

scattered-code avatar May 12 '21 05:05 scattered-code

@scattered-code can you reproduce this problem with the example app? Can you collect any logs? Is this reproducible on a emulator, for example?

ened avatar May 28 '21 11:05 ened