onkar
onkar

Reputation: 4547

Issue in Titanium Appcelerator

I am trying to import a project and run it onto iPhone Simulator on Appcelerator, but I am getting a message on console that says,

 [WARN] :  The Ti.Geolocation.purpose property must be set.
        [INFO] :  {"source":{"cache":false},"type":"error"}

I have spent more than 2 hours on trying to eradicate the issue. Also, Please share useful resources about appcelerator app lifecycle.

Upvotes: 0

Views: 567

Answers (2)

manumaticx
manumaticx

Reputation: 111

It says "The Ti.Geolocation.purpose property must be set." I would try something like

Ti.Geolocation.purpose = "Find restaurants near you";

iOS want to let the user know why your App wants to know his location. The user must allow this Geolocation permission. Thats why you should surround your location requests with an if-statement:

if (Titanium.Geolocation.locationServicesEnabled){
    Titanium.Geolocation.getCurrentPosition(function(e){
        Ti.API.info(e.coords);
    }
}else{
    Titanium.UI.createAlertDialog({title:'Location Service', message:'Please turn on your location services.'}).show();
}

Upvotes: 2

onkar
onkar

Reputation: 4547

The parameters to be sent to the Call, were wrong.

Upvotes: 0

Related Questions