Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update PGSocialShare for 2.x

  • Loading branch information...
commit 809b1680cda99d7aff72d6704b3cb684a2afba58 1 parent c8035ac
@purplecabbage authored
View
2  WindowsPhone/PGSocialShare/PGSocialShare.cs
@@ -41,7 +41,7 @@ public class ShareOptions
public void share(string options)
{
- ShareOptions opts = JSON.JsonHelper.Deserialize<ShareOptions>(options);
+ ShareOptions opts = JSON.JsonHelper.Deserialize<ShareOptions[]>(options)[0];
switch (opts.shareType)
{
case ShareType.Status :
View
45 WindowsPhone/PGSocialShare/PGSocialShare.js
@@ -3,42 +3,23 @@
-(function(){
+(function(window){
- var PGSocialShare =
+ var cdv = window.cordova || window.Cordova;
+
+ window.plugins.pgSocialShare =
{
- ShareType:
+ shareStatus:function(msg)
{
- status:0,
- link:1
- }
- }
-
- Cordova.addConstructor(function() {
+ var options = {"message":msg,"shareType":0}; // 0 == status
+ cdv.exec(null,null,"PGSocialShare","share",options);
+ },
- navigator.plugins.pgSocialShare =
+ shareLink:function(title,url,msg)
{
- shareStatus:function(msg)
- {
- var options = {"message":msg,"shareType":PGSocialShare.ShareType.status};
- Cordova.exec(null,null,"PGSocialShare","share",options);
- },
-
- shareLink:function(title,url,msg)
- {
- var options = {"message":msg,
- "title":title,
- "url":url,
- "shareType":PGSocialShare.ShareType.link};
-
- Cordova.exec(null,null,"PGSocialShare","share",options);
- }
+ var options = {"message":msg, "title":title, "url":url, "shareType":1}; // 1 == link
+ cdv.exec(null,null,"PGSocialShare","share",options);
}
+ }
-
-
- });
-
-
-
-})();
+})(window);
Please sign in to comment.
Something went wrong with that request. Please try again.