claytical / SocialFrameworkPlugin

Cordova plugin for iOS 6 native sharing activity
12 stars 5 forks source link

Error when trying to use SocialFrameworkPlugin #3

Closed fortubeks closed 11 years ago

fortubeks commented 11 years ago

WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: *\ -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1]

claytical commented 11 years ago

When does this happen? I need to see some code to put it in perspective.

fortubeks commented 11 years ago

It happens when I try to Share.

document.getElementById('share').onclick = function (){shareText('Deals');}; When I click this button =>

Below is the javascript.

function shareText( textToShare ) {

SocialFrameworkPlugin.show( shareSuccess, shareError, textToShare,'img/call.png' );

}

function shareSuccess (result) { console.log("Fired Share Activity Successfully"); }

function shareError (error) { console.log("Share Activity has no text to share"); }

I am doing everything right as instructed I have no clue what that error is about.

claytical commented 11 years ago

I think the problem is caused by the image. It needs to be a base64 encoded string. That's why the canvas is used in the example. If you don't pass anything for the image parameter, it should work as well. I'm thinking I should add another function for converting a URL into the base64 string.

fortubeks commented 11 years ago

I removed it, it works fine now