Hi,
I am trying to set up a background process for my app, with the intention to prompt the user to start the app. This is my ServiceDelegate class (more or less directly taken from the BackgroundTimer sample app:
using Toybox.Background as Bg;
using Toybox.System;
(:background)
class BackgroundServiceDelegate extends System.ServiceDelegate {
function initialize() {
ServiceDelegate.initialize();
}
// Prompt the user to start the app
function onTemporalEvent() {
Bg.requestApplicationWake("Start the app?");
Bg.exit(true);
}
}
When I run the app - even if I am not actually using this class, I get this error (in the Bg.exit(true) line):
Error: Permission Required
Details: Module 'Toybox.Graphics' not available to 'Background'
The problem is not with Bg.exit (true). Even if I remove that line, I get the same error (this time in the Bg.requestApplicationWake line).
By the way, the 'Background' Permission is set in the manifest file.
Does anyone have an idea why I get this error?