nativescript-social-share
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "nativescript-social-share", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A NativeScript module to use the native social sharing widget", | ||
@@ -8,7 +8,4 @@ "main": "social-share.js", | ||
"platforms": { | ||
"ios": "1.1.0", | ||
"android": "1.1.0" | ||
}, | ||
"tns-ios": { | ||
"version": "1.1.2" | ||
"ios": "1.4.0", | ||
"android": "1.4.0" | ||
} | ||
@@ -15,0 +12,0 @@ }, |
@@ -10,2 +10,4 @@ # NativeScript Social Share Plugin | ||
Run the following command from the root of your project: | ||
``` | ||
@@ -12,0 +14,0 @@ $ tns plugin add nativescript-social-share |
@@ -1,4 +0,16 @@ | ||
function share(thingToShare) { | ||
var frameModule = require("ui/frame"); | ||
function share(thingToShare, index) { | ||
var activityController = UIActivityViewController.alloc() | ||
.initWithActivityItemsApplicationActivities([thingToShare], null); | ||
var presentViewController = activityController.popoverPresentationController; | ||
if (presentViewController) { | ||
var page = frameModule.topmost().currentPage; | ||
if (page && page.ios.navigationItem.rightBarButtonItems && | ||
page.ios.navigationItem.rightBarButtonItems.count > 0) { | ||
presentViewController.barButtonItem = page.ios.navigationItem.rightBarButtonItems[0]; | ||
} else { | ||
presentViewController.sourceView = page.ios.view; | ||
} | ||
} | ||
UIApplication.sharedApplication().keyWindow.rootViewController | ||
@@ -15,2 +27,2 @@ .presentViewControllerAnimatedCompletion(activityController, true, null); | ||
} | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
56
60
167066