bgs-sample-mobile
Reactive icon

BGS Sample Backoffice

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 7 Oct (16 hours ago)
 by 
5.0
 (1 rating)
bgs-sample-mobile

BGS Sample Backoffice

Details
Server side of the Background Sync Plugin demo: REST API that receives the uploads and a live backoffice.
Read more

BGS Sample Backoffice is the server side of the Background Sync Plugin demo. Install it before Background Sync Plugin with its demo app (BGS Sample Mobile), which uploads its photos to this backoffice.


On its own it does nothing useful: it is the reference for the server half of a background sync, the part your own backend has to implement.


**What it contains**

- **FieldAuditSync REST API** (`POST /rest/FieldAuditSync/photos`): receives exactly the request the Background Sync Plugin sends: `{ "payload": {...}, "file": { "filename", "contentType", "base64Data" } }`. The `base64Data` attribute is Binary Data, so OutSystems decodes the file for you.

- **Idempotent storage:** each photo is stored under the plugin record id. A photo the plugin sends twice (the connection dropped right after the server stored it) replaces the same row and is counted as re-sent, never duplicated.

- **API key check:** the `X-Api-Key` header must match the `DeviceApiKey` site property. Any other value is rejected, so the plugin marks the record as failed and retries later.

- **GetDeviceApiKey** server action: lets the demo mobile app read the key at start-up, so the key is configured in one place.

- **Live screens:** a list of the audits received (photos received / expected, MB, progress) and an audit detail with counters and a photo grid. Both refresh every 3 seconds while open.

- **Reset demo data** button to start over.


Plugin documentation and the REST contract: https://github.com/henriquefps/cordova-background-sync-plugin

Release notes (1.0.0)
License (1.0.0)
Reviews (0)
Team
Other assets in this category