03-13-2019 20:56
03-13-2019 20:56
I'm using the ImagePicker functionality based on the example in the Fitbit blog sdk-photo-picker-master... I have used the code from the blog and incorporated it into my clockface, when I run the clockface in the simulator it immediately starts the settings page to choose a background image, which is good, however, I can't seam to get my arms around how exactly this is initiated... More specifically I'd like to have a small icon on my clockface that, when clicked, can launch the photo picker as opposed to having it launch everytime the clockface is loaded, which I would assume would be only once in real world scenario. Can someone point me to a good example or guide to assign a click event to an icon on a clockface in order to launch the image picker? I can get an icon to handle a click event with code in app/index.js but I think I am not understanding how it all works together with the settings / companion. Thanks in advance for any / all your time and assistance.
Answered! Go to the Best Answer.
03-14-2019 20:31
03-14-2019 20:31
So long as you don't overwrite the image file on the watch, it will still be there. Just change the href of the image element back to the original filename (as it was in the .gui).
03-13-2019 21:05
03-13-2019 21:05
I suspect that what you want isn't possible. The watch app can cause the companion app to wake up and start running code, but neither of them can cause the settings screen to appear on the companion. That's something that the user has to initiate.
03-14-2019 03:22
03-14-2019 03:22
Ok thanks a bunch... makes sense.
03-14-2019 19:46
03-14-2019 19:46
I actually have an additional related question... if I wanted to include a background with a clockface I just set the background in the .gui file but if I use the image picker, obviously the original image will be replaced. How can I ensure that the original background can be chosen sometime subsequent to a user choosing a new background after app installation? In other words, the background installed with the app will be changed but is it recoverable somehow? I’m sure it wouldn’t automatically be downloaded to the users phone, is this possible?
Thanks again in advance.
Sincerely,
Rich
03-14-2019 20:31
03-14-2019 20:31
So long as you don't overwrite the image file on the watch, it will still be there. Just change the href of the image element back to the original filename (as it was in the .gui).