This works fine in the simulator but on a real device (Vivoactive 3) with CIQ 3.0.3, I get the below error. I don't have any other CIQ 3 compatible device to test on but according to all the docs I've read, the BitmapResource should be allowed as a value in CIQ 3.0.1 and above.
class QRCodeView extends WatchUi.View {
...
function onUpdate(dc) {
var image = Storage.getValue("BMP_123");
if( image == null ) {
fetchImage("123");
...
function fetchImage(code) {
var url = "chart.googleapis.com/chart + code + "&chs=100x100&cht=qr&chld=H%7C0";
Communications.makeImageRequest(url, null, null, method(:responseCallback));
...
function responseCallback(responseCode, data) {
if (responseCode == 200) {
Storage.setValue("BMP_123", data); // This call will fail
WatchUi.requestUpdate();
}
}
...
In CIQ_LOG.YML, I only see:
---
Error: File Not Found Error
Details: 'Failed invoking <symbol>'
Time: 2018-10-06T20:21:16Z
Part-Number: 006-B2700-00
Firmware-Version: '5.40'
Language-Code: swe
ConnectIQ-Version: 3.0.3
Filename: QRCODE
Appname: QRCode
Stack:
- pc: 0x10000407
I've tried setting all permissions in manifest.xml but get the same result. With trace logging (System.println()), I have verified that it's the Storage.setValue() call that causes the failure. If I skip the storage and head straight to drawing the fetched data with dc.drawBitmap(), everything works fine, so I would assume that it's a BitmapResource that I've been given.