I have created an app through facebook developers and added an iOS platform and Android platform. iOS is now working with 3.2.2. Android however is not. My aim is to post a pre defined message onto a user's wall. My code is as follows. When I press my button fbShare(outlined below), I am getting a screen pop up with facebook at the top and a message stating:
App Not Setup: The developers of this app have not set up this app properly for facebook
I added the android platform in the apps settings page and copied the bundleID from my project. I also generated the key hash for both the location of my debug keystore and my actual production keystore. Neither have worked. My code for sharing is as follows:
var fbShare=Ti.UI.createImageView({
image:'/images/fbShare.png',
width:'36dp',
height:'36dp',
left:'5dp'
});
Navbar.add(fbShare);
fbShare.addEventListener("click", function (e){
facebookLogin();
});
var fb;
var facebookLogin = function(){
fb = require('facebook');
fb.appid = 'xxxxxxxxxx';
Ti.API.info('facebook logedin?' + fb.loggedIn);
//login if not logged in
if (!fb.loggedIn) {
fb.permissions = ['publish_stream'];
fb.forceDialogAuth = false;
fb.authorize();
fb.addEventListener('login', function(e) {
if (e.success) {
Ti.API.info("Facebook logged in - stage 1");
postToFacebook();
} else if (e.error) {
alert(e.error + " - stage 1");
} else if (e.cancelled) {
alert("Facebook login cancelled - stage 2");
}
});
}else{
postToFacebook();
}
};
var data = {
link : "www.mylink.com",
name : "my name",
message : "my message",
caption : "my caption",
picture : "myPic.jpg",
description : "My description."
};
var postToFacebook = function(){
Ti.API.info("attempting to post to facebook...please wait");
fb.requestWithGraphPath('me/feed', data,
"POST", function(e) {
if (e.success) {
alert("Shared to facebook successfully!");
fbShare.setEnabled(true);
fbShare.setImage('/images/fbShare.png');
Ti.API.info("Posted to facebook wall!");
}else{
if(e.error){
Ti.API.info("cant post to facebook " + e.error);
}else{
Ti.API.info("something else happened...");
}
alert('Something went wrong with your post but facebook could not confirm what.');
fbShare.setEnabled(true);
fbShare.setImage('/images/fbShare.png');
}
});
};
I've been stuck on this for days, Any help or guidance appreciated