The other day I bought a Tile Slim (Bluetooth Tracker) to be able to locate my wallet. What I didn't know is that I could also locate my phone with a button that the Tile had. As a developer I thought that the only way to do that, would be having the app opened, but my surprise was that even if I close the Tile App, it still worked.
This is happening with iPhone (iOS) I don't care about Android.
How is it possible that with the iPhone locked and the Tile App closed it's able to increase the volume to a 100% and make a sound that stops only when I press any volume side button (and even with notifications disabled)?
Here is a video showing it in real life: https://vimeo.com/679108480/6ac7919287
Thanks in advance for your help.
An app that supports background audio can play audio even if the ring/silent switch is set to silent.
There is a summary table in this document
The Tile app will have background audio and background Bluetooth support.
The will have code something like:
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Get the singleton instance.
let audioSession = AVAudioSession.sharedInstance()
do {
// Set the audio session category, mode, and options.
try audioSession.setCategory(.playback, mode: .default, options: [defaultToSpeaker])
} catch {
print("Failed to set audio session category.")
}
// Other post-launch configuration.
return true
}
The app would also be waiting for connections and notifications from the Tile peripheral using Bluetooth background mode with state restoration.
When the app gets the Bluetooth event it will activate its audio session and begin playback.