Page 1 of 1

mobileStartTrackingSensor not working anymore?

Posted: Tue Jan 20, 2015 7:14 pm
by calmrr3
Hello,

For some reason my code is no longer working, it doesn't seem to be tracking the location and therefore is not able to do anything on location changed. I wonder if it is an issue with my code? Or could it be in the xcode simulator or the properties?

Heres the Start button script:

Code: Select all

global counterVar
on mouseUp
   put 0 into counterVar
   mobileStartTrackingSensor "location"
end mouseUp
and the card script:

Code: Select all

on locationChanged pLatitude, pLongitude, pAltitude
   
   put pAltitude & cr after field "altitude"
   put pLatitude & cr after field "latitude"
   put pLongitude & cr after field "longitude"
   put counterVar into field "counter"
   add 1 to counterVar
   
   put the short date && the short time into field "dateTest"
end locationChanged  pLatitude, pLongitude, pAltitude
Thanks!

Re: mobileStartTrackingSensor not working anymore? SOLVED

Posted: Wed Jan 21, 2015 12:17 am
by dave.kilroy
Hi calmrr3 - can you give us information on which versions of OS X, LiveCode and Xcode you are running?

Re: mobileStartTrackingSensor not working anymore?

Posted: Wed Jan 21, 2015 2:25 pm
by calmrr3
OS X Version 10.9.5
Livecode Version 7.0.1
xCode Version 6.1.1

This was working but now it isn't and I can't see any reason why.

Thanks

Re: mobileStartTrackingSensor not working anymore?

Posted: Thu Jan 22, 2015 7:35 am
by Simon
Hi calmrr3,
Yeah, I found something odd with Debug > Location as it wasn't sending out a change until I changed it to another method.

Simon

Re: mobileStartTrackingSensor not working anymore?

Posted: Fri Jan 23, 2015 8:03 pm
by scrabbles
I am experiencing this too, preOpenStack or openStack does not seem to start the mobileTrackingSensor. If i put it in the default/first card's preOpenCard or openCard it doesn't work either, however if i put it in another card's preOpen it does work.

Using:
OS X 10.10
xCode 6.1.1
LC 7.0.1 and 7.0.2 (rc1)

iOS 8.1
Android 4.4.2
(both mobile OS not work)

Code: Select all

on initMobile
   if the environment is "mobile" then
      if mobileCanTrackLocation() is true then
         mobileStartTrackingLocation
         //mobileStartTrackingSensor "location", false
      else
         answer "Can't find your location"
      end if
   end if
end initMobile
The above is called from the preOpenXXXX.

Re: mobileStartTrackingSensor not working anymore?

Posted: Fri Jan 23, 2015 8:21 pm
by ChrisMukrow
Maybe it's the same problem as in this thread: http://forums.livecode.com/viewtopic.php?f=49&t=22367? If so it got fixed in 6.7.2RC2, see bug report http://quality.runrev.com/show_bug.cgi?id=14290

Re: mobileStartTrackingSensor not working anymore?

Posted: Sat Jan 24, 2015 12:27 am
by scrabbles
Thanks Chris, you prompted me to double check, I can confirm it is working fine now in both 6.7.2 and 7.0.2. I tested in 6.7.2 with a new clean stack and it worked a treat, but then opening my existing project in 7.0.2 it no longer worked. I shuffled things around in the preOpenStack putting my initMobile call first and moving all variable declares to the top (out of handlers) and it now works ... hmm.