I am working in facebook sharing using graph API but during develoment I'm facing following issues:
1. Login event listener not callback but user has logged In at first time.
2. In Second time some time facebook sharing working but next time it's giving me error which I've attached screenshot for the same. most of the time sharing done in first time but second time it's giving me error.
Below are the code which I'm using. Also I've added "
xxxxxxxxxxxxxxxxx" in .xml and info.plist with key.
Please provide me any solution:
var data = {
message:'Post Sharing'
};
function showFBResult(eventData) {
if (eventData.success) {
alert('in succes');
} else {
if (eventData.error) {
alert(eventData.error);
}
}
}
var fb = require('facebook');
fb.appid = "xxxxxxxxxxxxxxxx";
fb.permissions = ['publish_stream'];
fb.forceDialogAuth = true;
if (!fb.loggedIn) {
fb.authorize();
}else{
fb.requestWithGraphPath('me/feed', data, 'POST', showFBResult);
}
fb.addEventListener('login', function(e){
if(e.success){
fb.requestWithGraphPath('me/feed', data, 'POST', showFBResult);
} else if (e.error) {
alert(e.error);
}
});
Hello, On latest Ti SDK version FB login and sharing is working as expected. Please try the following code with the latest version of the SDK *Testing Environment:* Command-Line Interface, version 4.1.2, FB Module Version: 4.0.5, Ti SDK: 4.1.0, iOS Version: v8.4, Studio Version: 4.1.1 *Test Code*
Thanks.