Skip to main content
Your users’ phones may be in different states while their Plaud device syncs its audio to your mobile app - your user may lock their phone, move the app to the background, or close out of the app completely. screen off sync

Syncing while phone is locked/in-background

Even when your users’ phone may be in the background
  • User locks their phone
  • User goes to the home screen
  • User switches to another app
you can still run processes in the background via event-driven callbacks.

For iOS

See our iOS Starter App for a working example.

Prerequisites

Make sure that the UIBackgroundModes = [bluetooth-central] is enabled in your permission declarations.
project.yml
Info.plist
The bluetooth permission allows the app to react to GATT events while in the background.

Callback-driven Syncs

Use Embedded SDK callbacks and methods to drive file exports while your app is in the background. Use a combination of these callbacks and methods, along with recursion, to sync large files and multiple files in the background.
Swift

For Android

See our Android Starter App for a working example of the sync loop.

Callback-driven Syncs

Use Embedded SDK callbacks and methods to drive file exports while your app is in the background.
Kotlin

App Wakeup when Plaud is in-range

This is currently an iOS app-only feature, leveraging the iPhone’s native iBeacon feature.It also requires:
  1. SDK 1.0.15+
  2. The user’s Always location permission
  3. Note Pro with firmware 1.7.0+.
This feature may come to NotePin S at a later date.

Requirements

Add location services to your list of permissions in Info.plist.

Setting up iBeacon

Activate monitoring on the phone and register the user’s paired devices by serial number. Do this in application(_:didFinishLaunchingWithOptions:):
Swift
Then turn iBeacon on in the Plaud device itself.
Swift

Using iBeacon

Now that you’ve setup iBeacon on your users’ phone and their Plaud device, when their Plaud device comes back in range, your app receives bleIBeaconWakeupTriggered(sn:). The SDK does not reconnect on its own, so we also call connectBySN: The connection result comes back through the usual bleConnectState / bleBind callbacks. If your app is in the background, nothing in your UI is running to start the file sync after the reconnect, so set a flag when the wake-up fires and start the sync from bleBind once the handshake completes:
Swift
From there, the callback-driven sync loop above exports each file in turn.
For the full docs on iBeacon, go to our iOS SDK Reference.