Giter Site home page Giter Site logo

Comments (6)

EddyVerbruggen avatar EddyVerbruggen commented on August 20, 2024

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.

clearsitedesigns avatar clearsitedesigns commented on August 20, 2024

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)})">

image

IOS 7 - Just says "not available" and you can't do anything else.

from socialsharing-phonegap-plugin.

EddyVerbruggen avatar EddyVerbruggen commented on August 20, 2024

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.

clearsitedesigns avatar clearsitedesigns commented on August 20, 2024

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.

jackocnr avatar jackocnr commented on August 20, 2024

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.

EddyVerbruggen avatar EddyVerbruggen commented on August 20, 2024

Well spotted @jackocnr, thanks!

from socialsharing-phonegap-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.