Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

using stringByEvaluatingJavaScriptFromString #77

Closed
revolunet opened this issue Feb 20, 2015 · 4 comments
Closed

using stringByEvaluatingJavaScriptFromString #77

revolunet opened this issue Feb 20, 2015 · 4 comments

Comments

@revolunet
Copy link
Contributor

Hey there,

Thanks for the great plugin !

when using it with https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin we have a small issue :

This code, which evaluates the position from the webView, returns null :
return [self.webView stringByEvaluatingJavaScriptFromString:@"window.plugins.socialsharing.iPadPopupCoordinates();"];

The result is correct when calling from Safari directly; Any idea whats going on ?

thanks !

EddyVerbruggen added a commit to EddyVerbruggen/SocialSharing-PhoneGap-Plugin that referenced this issue Feb 21, 2015
@EddyVerbruggen
Copy link
Contributor

Hi, I'm afraid the WKWebView equivalent of UIWebViews stringByEvaluatingJavaScriptFromString is asynchronous rendering this approach of the SocialSharing plugin incompatible.

I have updated SocialSharing just now to deal with the null/nil result and position the popup at the bottom of the page (which is what iPhone does and what iPad did on iOS 7).

@revolunet
Copy link
Contributor Author

Ok thanks for detailed answer and the workaround!

@revolunet
Copy link
Contributor Author

@EddyVerbruggen : what do you think about adding a coords parameter to the share method ?

@EddyVerbruggen
Copy link
Contributor

I'm considering creating a new share function with a different name which simply takes a JSON object to specify anything you want. That way features like the iPad popup coordinates can easily be added without making a mess of the API. But don't hold your breath as it won't be any day soon.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants