Its been a couple of days i started working with titanium and got familiar with the framework. Its really cool framework. Now i am building an app trying to connect with facebook.... I also registered an app on facebook developers and got the id.But it couldnt connect for some reason... I am getting errors like:
Message: Uncaught TypeError: Cannot set property 'appid' of undefined
My code is as follows:(http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Facebook-property-loggedIn)
// Don't forget to set your appid and requested permissions, else the login button
// won't be effective.
Titanium.Facebook.appid = "xxxxxxxxxxxxxxx";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
Titanium.Facebook.addEventListener('login', function(e) {
if (e.success) {
alert('Logged in');
}
});
Titanium.Facebook.addEventListener('logout', function(e) {
alert('Logged out');
});
// add the button. Note that it doesn't need a click event or anything.
Titanium.UI.currentWindow.add(Titanium.Facebook.createLoginButton({ top: 50, style: 'wide' }));
and in my tiapp.xml i added below code :
<property name="ti.facebook.appid">XXXXXXXXXXX</property>
<modules>
<module platform="android">facebook</module>
</modules>
one last thing i am using android 2.2 similator... I know i should ask this question in titanium appcelerator forums ... i didn't it, but did get any response ... Thought some geeks here might help me.. Thanks