I cannot get the “connected” event listener to work on a watchface written in JS with Alloy.
It just does not run at all. Using the following snippet:
´´´
watch.addEventListener(“connected”, () => {
console.log(“connected”);
});
```
nothing gets printed into the pebble logs. Adding logic to it does not run it.
Is this maybe an issue of using Pebble with iOS?
Unfortunately it is also necessary to work for using network request via fetch API (see Networking // Pebble Developers), otherwise the watchapp will crash with the following error:
```
xsPlatform.c:209> TypeError: cannot coerce undefined to object
at set ()
at Map ()
at Headers ()
at R
xsPlatform.c:217> fxAbort unhandled exception: cannot coerce undefined to object
ault_handling.c:102> App fault! {6539c61f-af4a-440b-b406-0cbda66140d6} PC: 0x5 LR: ???
Program Counter (PC) : 0x5 b’??:0’
Link Register (LR) : ??? ???
```
Is this just something that is not possible at the moment or am I missing something here?