Skip to content

Background upload in ios using version 3 #165

Open
@scattered-code

Description

@scattered-code

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidAndroid-only issuesiosiOS-only issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions