Created
September 18, 2012 22:01
-
-
Save anonymous/3746207 to your computer and use it in GitHub Desktop.
titanium geoloqi login
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geoloqi.init({ | |
clientId : Config.clientId, | |
clientSecret : Config.clientSecret, | |
trackingProfile : "OFF", | |
lowBatteryTracking : true, | |
allowAnonymousUsers : false | |
}, { | |
onSuccess : function() { | |
Ti.API.info("Tracking Profile: " + geoloqi.tracker.getProfile()); | |
Ti.API.info("Access Token: " + geoloqi.session.getAccessToken()); | |
Ti.API.info("User ID: " + geoloqi.session.getUserId()); | |
Ti.API.info("Username: " + geoloqi.session.getUsername()); | |
Ti.API.info("Anonymous User?: " + geoloqi.session.isAnonymous()); | |
geoloqi.authenticateUser('info@etnatraining.it', 'xxxxxx', { | |
onSuccess : function(e) { | |
objSession = geoloqi.session; | |
if (objSession == null) { | |
alert("No Session Found"); | |
} else { | |
Ti.API.info("Tracking Profile: " + geoloqi.tracker.getProfile()); | |
Ti.API.info("Access Token: " + geoloqi.session.getAccessToken()); | |
Ti.API.info("User ID: " + geoloqi.session.getUserId()); | |
Ti.API.info("Username: " + geoloqi.session.getUsername()); | |
Ti.API.info("Anonymous User?: " + geoloqi.session.isAnonymous()); | |
//alert("Session Found"); | |
Ti.Network.registerForPushNotifications({ | |
types : [Titanium.Network.NOTIFICATION_TYPE_ALERT], | |
callback : function(data) { | |
geoloqi.iOS.handlePush(data); | |
}, | |
success : function(data) { | |
geoloqi.iOS.registerDeviceToken(data.deviceToken, "dev"); | |
}, | |
error : function(data) { | |
Ti.API.error("Could Not Register For Push" + data.error + data.type); | |
} | |
}); | |
} | |
}, | |
onFailure : function(e) { | |
alert(e); | |
} | |
}); | |
}, | |
onFailure : function() { | |
Ti.API.error("Geoloqi Config Failed"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment