Hi.
I have an Android app that works.
When i added this to my code it wont even start it just force close.
What have i missed?
var check = Titanium.UI.createButton({ title: 'Checka in', top : 140, style: Titanium.UI.iPhone.SystemButtonStyle.PLAIN }); win.add(check); // Handle the close event check.addEventListener('click',function() { Titanium.Facebook.appid = "36xxxxxxxxx636"; Titanium.Facebook.permissions = ['publish_stream', 'read_stream', "user_checkins", "publish_checkins"]; function doFacebookCheckin(_callback) { var getInfo = function(localCallback) { var data = { "place" : "121586314581979", "coordinates" : JSON.stringify({ 'latitude' : 61.347289, 'longitude' : 16.393661, }), "access_token" : Ti.Facebook.accessToken }; Ti.Facebook.requestWithGraphPath('me/checkins', data, 'POST', function(e2) { if(e2.success) { Ti.API.info("Success"); Ti.API.info(JSON.stringify(e2.result)); Titanium.UI.createAlertDialog({ title: 'Wass up?', message: 'Good to go!' }).show(); if(e2.result) { var data = JSON.parse(e2.result); return; } } else if(e2.cancelled) { Ti.API.error("User Cancelled"); return; } else { Ti.API.error(JSON.stringify(e2)); return; } }); } // do that thing... if(!Titanium.Facebook.loggedIn) { Titanium.Facebook.authorize(); Titanium.Facebook.addEventListener('login', function(e) { if(e.success) { setTimeout(function() { getInfo(); }, 2000); } else if(e.error || e.cancelled) { return; } }); } else { getInfo(); } } doFacebookCheckin(); }); Ti.Facebook.appid = '368xxxxx6636'; Ti.Facebook.permissions = ['read_stream', "user_checkins", "publish_checkins"]; win.add(Ti.Facebook.createLoginButton({ top:200, style : Ti.Facebook.BUTTON_STYLE_NARROW }));Thanx
//R
1 Answer
for starters this wont work on Android
style: Titanium.UI.iPhone.SystemButtonStyle.PLAIN
dont know if it will stop the crash but it shouldnt be there
Your Answer
Think you can help? Login to answer this question!