Hi,everyone,I create a watch face,using makeImageRequest in background service。it can successfully save image on devices before CIQ4.0,such as fenix5plus or fenix6.
but on device with CIQ4.0 such as VENU2 or VENU2s,it throws an error。I searched the forum with no answer.please help。the attachment is a simple project
Error: Permission Required
Details: Module 'Toybox.Graphics' not available to 'Background'
Stack:
- getType() at D:\grmn\prj\di\connectiq\toolchain\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\WatchUi.mb:4098 0x300043d6
- initialize() at D:\grmn\prj\di\connectiq\toolchain\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\Graphics.mb:919 0x300013fb
- <Toybox_Graphics_BitmapReference_>>initialize>() at D:\grmn\prj\di\connectiq\toolchain\mbsimulator\submodules\technology\monkeybrains\virtual-machine\api\Graphics.mb:998 0x30001551
the code is below
using Toybox.Background as Bg; using Toybox.System as Sys; using Toybox.Communications as Comm; using Toybox.Application.Storage as AS; (:background) class BackgroundService extends Sys.ServiceDelegate { function initialize() { Sys.ServiceDelegate.initialize(); } function onTemporalEvent() { Comm.makeImageRequest("https://t1.picb.cc/uploads/2021/11/13/wYuQxt.png",null,{:palette =>[0xff0000],:maxWidth => 100,:maxHeight => 100,:dithering => 1}, method(:OnReceiveimg)); } function OnReceiveimg(responseCode, data){ if(responseCode == 200){ AS.setValue(4,data); } Bg.exit(responseCode); } }