Social Sharing plugin disables other plugins.

  • 1
  • Problem
  • Updated 4 years ago
  • In Progress
Hi

I am working on a simple app that requires a health care practitioner to take an image of an prescription and send to my customer in an email. Those features works just fine.
The purpose of the app is to help really ill people order protein & nutritional drinks because their doctor has prescribed that hey need it. Some (many) of the patients are either very old, or very ill and will most likely not be able to use the app. They therefore rely on either friends, family or care personal to help them. So I decided to add a SMS feature so the doctor could send the app to a relative when they are in the app anyway.

I am trying to use the 'Social Sharing' plugin, but when I add the

type="text/javascript" src="cordova.js"

to my index.html file the rest of the javascript stops working, and to make matters worse, the social sharing is not working either :D

I am new to javascript, but seem to have noticed that the order of the javascript calls seem to matter, so I have tried placing the link to cordova.js several places, but no luck.

I am hoping that someone might be able to help me figure out what the heck I am doing wrong.

Thanks in advance
Claus
Photo of Claus Vallø

Claus Vallø

  • 34 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Hi

Sorry to hear you getting into trouble with the plugin however did you manage to contact the author?
eddyverbruggen@...
Photo of John Weidner

John Weidner, Champion

  • 435 Posts
  • 80 Reply Likes
You could post more of your html where you reference the javascript files so we can see what you are doing. (Post code in this forum within <code> </code> so that it shows up.) I am using the same plugin without any problems. Are you also using any other plugins?

When javascript stops working, there is typically an error that will get displayed in the log. With android you can watch this if you install the Android SDK and use the "adb logcat" command. http://developer.android.com/tools/he... You might also find Android remote debugging with Chrome helpful - https://developer.chrome.com/devtools...
Photo of Claus Vallø

Claus Vallø

  • 34 Posts
  • 0 Reply Likes
Hi

@Amir, I didn't know I could contact the author, nice to know as a last resort, thanks.

@John, yes I am using the 'email with attachments' and the 'camera' plugin's with no problems. My (albeit hopeless new beginner) testing suggests that it's when I put the cordove.js code in the head section that the scripting fails.
<script src="jquery-mobile/jquery.mobile-1.4.5.min.js" type="text/javascript"></script>
<script src="phonegap.js"></script>
<script type="text/javascript" src="cordova.js"></script>

Because when I remove the cordove.js line the rest i working fine again.

I will have a look at debugging tool for starters, the logcat looks like it would open a can of whup ass on me :D Regarding the debugging tool, do I just put the WebView code snippet in my scripts file and that's it for setup?

Thank you SO much for coming to my rescue :D It's MUCH appreciated.
Claus
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Don't include both phonegap.js and cordova.js
Either one of them will do.
Photo of Claus Vallø

Claus Vallø

  • 34 Posts
  • 0 Reply Likes
Hi Petra

Thanks, I've tried both and either of the two .js files, with no luck.

I started the debugging tools up that John suggested and I get this error on the Social Sharing plugin
Uncaught TypeError: Cannot read property 'socialsharing' of undefined

I also think I might be calling the function to early. I've been trying to get a grasp on the onLaod and the deviceReady functions, I believe I understand the concept, but O must be implementing it wrong.
I am trying to pop an alert once the device is ready but I'm unable to pop it somehow.

I've tried to create an deviceReady function
function prepareEventHandlers () {
document.addEventListener('deviceready', function () {
alert=("DeviceReady fired");
}, false)
}

that get's called when the window is done loading
window.onload = function() {
prepareEventHandlers ();
}


Thanks
Claus
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
alert=("DeviceReady fired");

should be:

alert("DeviceReady fired");
Photo of Claus Vallø

Claus Vallø

  • 34 Posts
  • 0 Reply Likes
Haha, Oh the joy of being a n00b *SIGH*

But it didn't help to get the syntax right though :'( I must have wrecked it more thoroughly :D

Thanks
Claus
it is not working on intel xdk hybrid mobile apps