nativescript-social-share
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "nativescript-social-share", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A NativeScript module to use the native social sharing widget", | ||
@@ -5,0 +5,0 @@ "main": "social-share.js", |
@@ -5,3 +5,2 @@ var application = require("application"); | ||
function getIntent(type) { | ||
@@ -28,6 +27,14 @@ var intent = new android.content.Intent(android.content.Intent.ACTION_SEND); | ||
image.android.compress(android.graphics.Bitmap.CompressFormat.JPEG, 100, stream); | ||
var path = android.provider.MediaStore.Images.Media.insertImage( | ||
context.getContentResolver(), image.android, "TempFile" + numberOfImagesCreated, null); | ||
var imageFileName = "socialsharing" + numberOfImagesCreated + ".jpg"; | ||
var newFile = new java.io.File(context.getExternalFilesDir(null), imageFileName); | ||
var fos = new java.io.FileOutputStream(newFile); | ||
fos.write(stream.toByteArray()); | ||
fos.flush(); | ||
fos.close(); | ||
intent.putExtra(android.content.Intent.EXTRA_STREAM, | ||
android.net.Uri.parse(path)); | ||
android.net.Uri.fromFile(newFile)); | ||
@@ -34,0 +41,0 @@ share(intent, subject); |
Sorry, the diff of this file is not supported yet
176357
60