· 6 years ago · Nov 27, 2019, 09:20 AM
1function getInitialView() {
2
3
4if( Toybox.WatchUi has :ServiceDelegate ) {
5Bg.registerForTemporalEvent(new Time.Duration(5*60));
6
7
8/*if (App.getApp().getProperty("ActivCode")!="xxxxx" || !System.getDeviceSettings().phoneConnected || App.getApp().getProperty(LON)==null || App.getApp().getProperty("APIKEY").length()==0){
9Bg.deleteTemporalEvent();
10} else {Bg.registerForTemporalEvent(new Time.Duration(5*60));}
11*/
12}
13return [new SHNTacticalBETAView()];
14
15}
16
17function getServiceDelegate() {
18return [new SHNTacticalBETAServiceDelegate()];
19}
20
21have a great day
22
23Comm.makeJsonRequest("api.openweathermap.org/.../weather",
24{"lat"=>latLon[0].toFloat(), "lon"=>latLon[1].toFloat(),"appid"=>"your api key here"}, {}, method(:onReceive));