Comments (6)
Hi, actually, I have only tested the latest release on iOS7 and it worked fine, so I hope we can figure out what the problem is.
Do you have the errorcallback implemented? It's the 5th param to the shareViaFacebook function. I just tried sharing a message without Facebook configured and it successfully fired the errorcallback. What is the exact methodcall you have implemented and what is the behaviour you are seeing? Please post the code.
Thanks,
Eddy
from socialsharing-phonegap-plugin.
I'm pretty much using your demo code verbatim just to test it - Am I missing something? When I click on the twitter button without any details setup it doesn't seem to do anything. As far as I can tell if you don't have your facebook or twitter settings setup it wont actually take you into settings to do that. It will just tell you it's not available. On ios6 though it actually will let you go into settings and set them up. They both come back as "Not Available." in an alert.
Now if I go in and set them up in settings and try the buttons they both work. The problem I'm facing is how can when it triggers not available take them to the particular share type and let the user enter details. I'll paste some images below:
IOS 6 shows this dialog if an account is not setup.
<button data-role="none" style="border:0px; margin:8px 0px 0 0px; padding:0px; background-color:transparent;" data-enhance="false"
onclick="window.plugins.socialsharing.shareViaTwitter('This is a message on twitter.', null, null, console.log('share ok'), function(errormsg){alert(errormsg)})">
IOS 7 - Just says "not available" and you can't do anything else.
from socialsharing-phonegap-plugin.
Aha, so the errorcallback is actually being fired (it shows the alert 'not available'). The plugin indeed doesn't try to open any settings, it just does what the OS does. On iOS6 it was showing that popup you posted, on iOS7 it doesn't do anything. Apple seems to have changed that behaviour.
One possible implementation of the usecase where a user clicks 'share via facebook' but doesn't have facebook installed is showing him a similar 'confirm' dialogue as in your screenshot and ask him what he wants (open the default share widget to share to anything else or just do nothing):
function noFacebookInstalledErrorCallback() {
navigator.notification.confirm(
'You don't seem to have Facebook configured on your device. Would you like to share via another application?', // message
onConfirm, // callback to invoke with index of button pressed
'Facebook not configured', // title
['Yes','No thanks'] // buttonLabels
);
}
In the onConfirm method, you can invoke the .share() method.
from socialsharing-phonegap-plugin.
Ok, I'll pass that along to my dev and see if we can implement that. Oh Apple, why do you make things so hard? Seems odd that they removed this functionality in ios7. Thanks for your super super fast response. I'm going on about 20 hours of coding this weekend so pretty tired:)
from socialsharing-phonegap-plugin.
I just ran into this issue, and thought I would add that if you do use the example code, as well as the alert saying "not available", you also get "share ok" in the console. This might be because you're passing a statement rather than a function as the callback. Perhaps it should be something like this instead:
shareViaFacebook('Message via Facebook', null, null, function(){console.log('share ok')}, function(errormsg){alert(errormsg)})
from socialsharing-phonegap-plugin.
Well spotted @jackocnr, thanks!
from socialsharing-phonegap-plugin.
Related Issues (20)
- app crash on share HOT 5
- Sharing message in message in IOS
- Sharing base64 encoded text/csv files fails on newer Android versions HOT 2
- bh.sh
- bh.sh
- Issue with IOS Social Sharing in ios 15
- screen frozen after share via facebook HOT 2
- Intent Redirection Vulnerability
- Share blob or base64 encoded image HOT 1
- Android 13 devices error on share with Twitter or Facebook HOT 6
- Android 12 issue HOT 4
- YouTube not supported as a valid app in iOS Share Sheet?
- App close after share whatsapp last version android
- Preview not available on Facebook share
- Instagram Story
- Can webp format files be saved
- ios 15 and 16 share file problem
- Crash on calling canShareVia -[SocialSharing canShareVia:] on IOS device
- Android app crashed when share through email HOT 7
- IOS trouble on sharing to Facebook and Instagram. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socialsharing-phonegap-plugin.