Question about Titanium SDK and iOS Geolocation module and modules in general.

You must Login before you can answer or comment on any questions.

It seems that there aren't many developers which are creating modules.

My needs: get accurate GPS location all the time (navigation).

I opened a question and hopped that some of the developers which are working on SDK will answer me but I guess this isn't the place (didn't find any "requests page")

Then I didn't want to wait so I crated my own module and a question.

So this question is for those who are working on Titanium SDK.

I understand that when I create blank titanium module for iOS some of the frameworks are included already. Because I use CoreLocation and CoreMotion in my module and I only need to put CoreMotion in module.xcconfig so I guess that CoreLocation is already included and titanium builder knows about it.

More specific question is about Geolocation module on iOS side.

Is there something that is being done with CoreLocation in Geolocation module for it to work (update location)?

Because if you read my second linked question you will see that my problem is that CoreLocationManager is not updating it's location. I even tried code with delegate and it is never being called so that means that location is not being updated at all.

Code is right 100% because I did a native app which reads every 0.2 seconds for locationManager.location property and it is being updated so that means that location can be pulled so I don't have to make a delegate and fire events each time location is updated.

Please answer, because I've tried everything and I reached a dead end here.

2 Answers

Hi Dino, I guess the problem with your questions is that they look somewhat like "who wants to debug my module?".

This kind of questions very rarely receive any answer, because they involve quite a lot of work from the part of those wanting to help (e.g. downloading the module, create a test project, copying the super long app.js you provided, start debugging, etc.). So, if you want to receive a relevant answer, my suggestion is to provide a very minimal test case that showcases the problem you're encountering; this would help whoever has enough time & will to lend a hand.

Telling "Code is right 100% because I did a native app..." means nothing, because in Titanium there is a very thick layer at the interface between your JS code and your native module. You should start inspecting where the problem is.

So, the answer is: have you checked out with the debugger what happens? You should start putting breakpoints in your module's code and see why you're not getting the expected results. Keep you test app at a very minimum (e.g even without UI in your case). Build a debug version of the module. Open the Xcode project generated for the app you find in the build/iphone directory and start debugging.

So, once you've done your homework, we're here to help ;-)

— answered 1 year ago by Olivier Morandi
answer permalink
4 Comments
  • Hi, well I guess saying "Code is right 100% because I did a native app..." is not OK since my module is not working :) But I was expecting from Titanium that you can really extend it with modules just like you would do it on the native side. Apparently it is not the case and there are complications. I forgot completely about generated project, I'll debug it and try to see what is going on.

    — commented 1 year ago by Dino Bartosak

  • @Oliver why I am not seeing in builded project my code from module and generated code with labels etc?

    — commented 1 year ago by Dino Bartosak

  • There is a bunch of possible approaches to step into your module. The quickest is to create an extremely simple test case for the module API in the example/ directory of the module project, then open the Xcode project an run the "build & test" target. Put breakpoints in your code and you're ready to go.

    More complex scenarios involve modifying the build.py script in order to make it build a Debug version of the module (in this case suitable for both the simulator and the device), install the module by unzipping the package in the proper Ti SDK directory, (usually /Library/Application\ Support/Titanium, run the app project once and open its Xcode project, import the module Xcode project in the app Xcode project workspace and start debugging.

    — commented 1 year ago by Olivier Morandi

  • Show 1 more comment

right!

— answered 1 year ago by Olivier Morandi
answer permalink
4 Comments
  • sorry, this was meant to be a comment to your last question...

    — commented 1 year ago by Olivier Morandi

  • It's OK, now the question will be viral :D

    I did that and still nothing. This is what I did:

    Made module. Modified app.js that just fetches that location data and writes it on 3 labels. Then I type in console ./build.py and then titanium run and it doesn't stop on my break points. If I just go to 'build' in Xcode, it just builds it but nothing happens (no simulator is started etc..) because I think it doesn't know about that app.js file.

    — commented 1 year ago by Dino Bartosak

  • Ok, in the module project you have two schemes, you can select "Build & test" and run that one, which will do more or less the same than titanium run, but inside Xcode. It's highly possible that the current selected scheme is the one with the name of your module. Checkout this picture for how to change the current scheme.

    — commented 1 year ago by Olivier Morandi

  • Show 1 more comment

Your Answer

Think you can help? Login to answer this question!