Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FB share not working on some iOS devices #1356

Open
ghost opened this issue Jul 12, 2017 · 0 comments
Open

FB share not working on some iOS devices #1356

ghost opened this issue Jul 12, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 12, 2017

Hi just a problem with iOS,

tried to use the plugin to share something from our app. I used iphone 6+ with 10.3.2 ios version and the share to fb function works. however when i ran the same app, on an iphone 5s or 6, everytime i share something, it prompts to the "login with fb dialog" instead of automatically sharing it to facebook (which should return a "facebook posting success" message upon success). On the console it just says user cancelled (which I believe comes from the plugin). Any ideas?

plugin : cordova-plugin-facebook4 1.7.4 "Facebook Connect"
ios version on both devices : 10.3.2
fb app version: 100.0
ionic v: 3.5.0

here is the method :
`function post_to_facebook(data) {
$log.log('Posting to facebook', data);

	// Check user fbplugin login status 
	facebookConnectPlugin.getLoginStatus(
	function(response){
		if(response.status == 'connected') {
			// post to facebook
			var facebookString = "/me/photos?method=post&url=" + data.twitter_picture + "&caption=" + encodeURIComponent(data.desc) + "&access_token="+response.authResponse.accessToken;
			$cordovaFacebook.api(facebookString, ["publish_actions"])
			.then(function (result) {
				console.log(result);
				loading('hide');
				toast("facebook posting success");
			},
			function (error) {
				console.log(error);
				loading('hide');
				toast("facebook posting failed");
			})
		}
		else {
			loading('hide');
			toast("facebook posting failed");
			return;
		}
	},
	function(response){
		loading('hide');
		toast("can not post to facebook");
		console.log(response);
		return;
	});
}`
@ghost ghost changed the title FB share working weirdly FB share not working on some iOS devices Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants