Giter Site home page Giter Site logo

eddyverbruggen / socialsharing-phonegap-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.8K 98.0 908.0 2.08 MB

👨‍❤️‍💋‍👨 Cordova plugin to share text, a file (image/PDF/..), or a URL (or all three) via the native sharing widget

License: MIT License

Objective-C 37.95% JavaScript 27.24% C# 2.97% Java 31.85%

socialsharing-phonegap-plugin's Introduction

PhoneGap / Cordova Social Sharing plugin

NPM version Downloads TotalDownloads Twitter Follow

paypal Every now and then kind folks ask me how they can give me all their money. So if you want to contribute to my pension fund, then please go ahead :)

Version 6.0.0 is compatible with Android X. See this issue for details. 5.6.8 is the last version before 6.0.0, so be sure to pick that if you run into Android X-related issues.

0. Index

  1. Description
  2. Screenshots
  3. Installation
  4. Usage on iOS and Android
  5. Web Share API
  6. Usage on Windows Phone
  7. Share-popover on iPad
  8. Whitelisting on iOS
  9. NSPhotoLibraryUsageDescription on iOS
  10. Import Types into an Ionic Angular Project

1. Description

This plugin allows you to use the native sharing window of your mobile device.

  • Share text, a link, a images (or other files like pdf or ics). Subject is also supported, when the receiving app supports it.
  • Supports sharing files from the internet, the local filesystem, or from the www folder.
  • You can skip the sharing dialog and directly share to Twitter, Facebook, or other apps.
  • Compatible with Cordova Plugman.
  • Officially supported by PhoneGap Build.

2. Screenshots

iOS 7 (iPhone)

ScreenShot

Sharing options are based on what has been setup in the device settings

ScreenShot

iOS 7 (iPad) - a popup like this requires a little more effort

ScreenShot

iOS 6 (iPhone)

ScreenShot

Android

ScreenShot

Windows Phone 8

ScreenShot

Alternative ShareSheet (iOS only, using the Cordova ActionSheet plugin)

ScreenShot

3. Installation

Automatically (CLI / Plugman)

SocialSharing is compatible with Cordova Plugman, compatible with PhoneGap 3.0 CLI, here's how it works with the CLI:

$ phonegap local plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git

or with Cordova CLI, from npm:

$ cordova plugin add cordova-plugin-x-socialsharing
$ cordova prepare

SocialSharing.js is brought in automatically. There is no need to change or add anything in your html.

Manually

1. Add the following xml to all the config.xml files you can find:

<!-- for iOS -->
<feature name="SocialSharing">
  <param name="ios-package" value="SocialSharing" />
</feature>
<!-- for Android (you will find one in res/xml) -->
<feature name="SocialSharing">
  <param name="android-package" value="nl.xservices.plugins.SocialSharing" />
</feature>
<!-- for Windows Phone -->
<feature name="SocialSharing">
  <param name="wp-package" value="SocialSharing"/>
</feature>

For sharing remote images (or other files) on Android, the file needs to be stored locally first, so add this permission to AndroidManifest.xml:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

For iOS, you'll need to add the Social.framework and MessageUI.framework to your project. Click your project, Build Phases, Link Binary With Libraries, search for and add Social.framework and MessageUI.framework.

2. Grab a copy of SocialSharing.js, add it to your project and reference it in index.html:

<script type="text/javascript" src="js/SocialSharing.js"></script>

3. Download the source files for iOS and/or Android and copy them to your project.

iOS: Copy SocialSharing.h and SocialSharing.m to platforms/ios/<ProjectName>/Plugins

Android: Copy SocialSharing.java to platforms/android/src/nl/xservices/plugins (create the folders)

Window Phone: Copy SocialSharing.cs to platforms/wp8/Plugins/nl.x-services.plugins.socialsharing (create the folders)

PhoneGap Build

Just add the following xml to your config.xml to always use the latest version of this plugin (which is published to plugins.cordova.io these days):

<gap:plugin name="cordova-plugin-x-socialsharing" source="npm" />

or to use an older version, hosted at phonegap build:

<gap:plugin name="nl.x-services.plugins.socialsharing" version="4.3.16" />

SocialSharing.js is brought in automatically. Make sure though you include a reference to cordova.js in your index.html's head:

<script type="text/javascript" src="cordova.js"></script>

4. Usage on iOS and Android

You can share text, a subject (in case the user selects the email application), (any type and location of) file (like an image), and a link. However, what exactly gets shared, depends on the application the user chooses to complete the action. A few examples:

  • Mail: message, subject, file.
  • Twitter: message, image (other filetypes are not supported), link (which is automatically shortened if the Twitter client deems it necessary).
  • Google+ / Hangouts (Android only): message, subject, link
  • Flickr: message, image (an image is required for this option to show up).
  • Facebook Android: sharing a message is not possible. You can share either a link or an image (not both), but a description can not be prefilled. See this Facebook issue which they won't solve. As an alternative you can use shareViaFacebookWithPasteMessageHint since plugin version 4.3.4. See below for details. Also note that sharing a URL on a non standard domain (like .fail) may not work on Android. Make sure you test this. You can use a link shortener to workaround this issue.
  • Facebook iOS: message, image (other filetypes are not supported), link. Beware that since a Fb update in April 2015 sharing a prefilled message is no longer possible when the Fb app is installed (like Android), see #344. Alternative: use shareViaFacebookWithPasteMessageHint.

Using the share sheet

It's recommended to use shareWithOptions as it's the most feature rich way to share stuff cross-platform.

It will also tell you if sharing to an app completed and which app that was (if that app plays nice, that is).

// this is the complete list of currently supported params you can pass to the plugin (all optional)
var options = {
  message: 'share this', // not supported on some apps (Facebook, Instagram)
  subject: 'the subject', // fi. for email
  files: ['', ''], // an array of filenames either locally or remotely
  url: 'https://www.website.com/foo/#bar?a=b',
  chooserTitle: 'Pick an app', // Android only, you can override the default share sheet title
  appPackageName: 'com.apple.social.facebook', // Android only, you can provide id of the App you want to share with
  iPadCoordinates: '0,0,0,0' //IOS only iPadCoordinates for where the popover should be point.  Format with x,y,width,height
};

var onSuccess = function(result) {
  console.log("Share completed? " + result.completed); // On Android apps mostly return false even while it's true
  console.log("Shared to app: " + result.app); // On Android result.app since plugin version 5.4.0 this is no longer empty. On iOS it's empty when sharing is cancelled (result.completed=false)
};

var onError = function(msg) {
  console.log("Sharing failed with message: " + msg);
};

window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);

You can still use the older share method as well

Here are some examples you can copy-paste to test the various combinations:

<button onclick="window.plugins.socialsharing.share('Message only')">message only</button>
<button onclick="window.plugins.socialsharing.share('Message and subject', 'The subject')">message and subject</button>
<button onclick="window.plugins.socialsharing.share(null, null, null, 'http://www.x-services.nl')">link only</button>
<button onclick="window.plugins.socialsharing.share('Message and link', null, null, 'http://www.x-services.nl')">message and link</button>
<button onclick="window.plugins.socialsharing.share(null, null, 'https://www.google.nl/images/srpr/logo4w.png', null)">image only</button>
// Beware: passing a base64 file as 'data:' is not supported on Android 2.x: https://code.google.com/p/android/issues/detail?id=7901#c43
// Hint: when sharing a base64 encoded file on Android you can set the filename by passing it as the subject (second param)
<button onclick="window.plugins.socialsharing.share(null, 'Android filename', 'data:image/png;base64,R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7', null)">base64 image only</button>
// Hint: you can share multiple files by using an array as thirds param: ['file 1','file 2', ..], but beware of this Android Kitkat Facebook issue: [#164]
<button onclick="window.plugins.socialsharing.share('Message and image', null, 'https://www.google.nl/images/srpr/logo4w.png', null)">message and image</button>
<button onclick="window.plugins.socialsharing.share('Message, image and link', null, 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, image and link</button>
<button onclick="window.plugins.socialsharing.share('Message, subject, image and link', 'The subject', 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, subject, image and link</button>

Example: share a PDF file from the local www folder:

<button onclick="window.plugins.socialsharing.share('Here is your PDF file', 'Your PDF', 'www/files/manual.pdf')">Share PDF</button>

Sharing directly to..

Twitter

<!-- unlike most apps Twitter doesn't like it when you use an array to pass multiple files as the second param -->
<button onclick="window.plugins.socialsharing.shareViaTwitter('Message via Twitter')">message via Twitter</button>
<button onclick="window.plugins.socialsharing.shareViaTwitter('Message and link via Twitter', null /* img */, 'http://www.x-services.nl')">msg and link via Twitter</button>

Facebook

<button onclick="window.plugins.socialsharing.shareViaFacebook('Message via Facebook', null /* img */, null /* url */, function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">msg via Facebook (with errcallback)</button>

Facebook with prefilled message - as a workaround for this Facebook (Android) bug. BEWARE: it's against Facebooks policy to prefil the message, or even hint the user to prefill a message for them. See this page for details.

  • On Android the user will see a Toast message with a message you control (default: "If you like you can paste a message from your clipboard").
  • On iOS this function used to behave the same as shareViaFacebook, but since 4.3.18 a short message is shown prompting the user to paste a message (like Android). This message is not shown in case the Fb app is not installed since the internal iOS Fb share widget still supports prefilling the message.
  • iOS9 quirk: if you want to use this method, you need to whitelist fb:// in your .plist file.
<button onclick="window.plugins.socialsharing.shareViaFacebookWithPasteMessageHint('Message via Facebook', null /* img */, null /* url */, 'Paste it dude!', function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">msg via Facebook (with errcallback)</button>

Whitelisting Facebook in your app's .plist:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fb</string>
</array>

Instagram

<button onclick="window.plugins.socialsharing.shareViaInstagram('Message via Instagram', 'https://www.google.nl/images/srpr/logo4w.png', function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">msg via Instagram</button>

Quirks:

  • Instagram no longer permits prefilling a message - you can prompt the user to paste the message you've passed to the plugin because we're adding it to the clipboard for you.

iOS Quirks:

  • Before trying to invoke shareViaInstagram please use canShareVia('instagram'.. AND whitelist the urlscheme (see below).
  • Although this plugin follows the Instagram sharing guidelines, the user may not only see Instagram in the share sheet, but also other apps that listen to the "Instagram sharing ID". Just google "com.instagram.exclusivegram" and you see what I mean.

WhatsApp

  • Note that on iOS when sharing an image and text, only the image is shared - let's hope WhatsApp creates a proper iOS extension to fix this.
  • Before using this method you may want to use canShareVia('whatsapp'.. (see below).
<button onclick="window.plugins.socialsharing.shareViaWhatsApp('Message via WhatsApp', null /* img */, null /* url */, function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">msg via WhatsApp (with errcallback)</button>
Sharing directly to someone

Note that on Android you can only send a 'text' and 'url' directly to someone, so files are ignored.

By phone number
<button onclick="window.plugins.socialsharing.shareViaWhatsAppToPhone('+31611111111', 'Message via WhatsApp', null /* img */, null /* url */, function() {console.log('share ok')})">msg via WhatsApp to phone number +31611111111</button>
By "abid" (iOS) or phone number (Android)
<button onclick="window.plugins.socialsharing.shareViaWhatsAppToReceiver('101', 'Message via WhatsApp', null /* img */, null /* url */, function() {console.log('share ok')})">msg via WhatsApp for Addressbook ID 101</button>

The first argument on iOS needs to be the Addressbook ID (or 'abid'). You can find those abid's by using the Cordova Contacts Plugin. The result in the success callback of the find function is a JSON array of contact objects, use the 'id' you find in those objects. Don't pass in an image on iOS because that can't be sent to someone directly unfortunately. Message and URL are fine though.

On Android pass in the phone number of the person you want to send a message to.

SMS

Note that on Android, SMS via Hangouts may not behave correctly

<!-- Want to share a prefilled SMS text? -->
<button onclick="window.plugins.socialsharing.shareViaSMS('My cool message', null /* see the note below */, function(msg) {console.log('ok: ' + msg)}, function(msg) {alert('error: ' + msg)})">share via SMS</button>
<!-- Want to prefill some phonenumbers as well? Pass this instead of null. Important notes: For stable usage of shareViaSMS on Android 4.4 and up you require to add at least one phonenumber! Also, on Android make sure you use v4.0.3 or higher of this plugin, otherwise sharing multiple numbers to non-Samsung devices will fail -->
<button onclick="window.plugins.socialsharing.shareViaSMS('My cool message', '0612345678,0687654321', function(msg) {console.log('ok: ' + msg)}, function(msg) {alert('error: ' + msg)})">share via SMS</button>
<!-- Need a subject and even image sharing? It's only supported on iOS for now and falls back to just message sharing on Android -->
<button onclick="window.plugins.socialsharing.shareViaSMS({'message':'My cool message', 'subject':'The subject', 'image':'https://www.google.nl/images/srpr/logo4w.png'}, '0612345678,0687654321', function(msg) {console.log('ok: ' + msg)}, function(msg) {alert('error: ' + msg)})">share via SMS</button>

Email

Code inspired by the EmailComposer plugin, note that this is not supported on the iOS 8 simulator (an alert will be shown if your try to).

window.plugins.socialsharing.shareViaEmail(
  'Message', // can contain HTML tags, but support on Android is rather limited:  http://stackoverflow.com/questions/15136480/how-to-send-html-content-with-image-through-android-default-email-client
  'Subject',
  ['[email protected]', '[email protected]'], // TO: must be null or an array
  ['[email protected]'], // CC: must be null or an array
  null, // BCC: must be null or an array
  ['https://www.google.nl/images/srpr/logo4w.png','www/localimage.png'], // FILES: can be null, a string, or an array
  onSuccess, // called when sharing worked, but also when the user cancelled sharing via email. On iOS, the callbacks' boolean result parameter is true when sharing worked, false if cancelled. On Android, this parameter is always true so it can't be used). See section "Notes about the successCallback" below.
  onError // called when sh*t hits the fan
);

If Facebook, Twitter, Instagram, WhatsApp, SMS or Email is not available, the errorCallback is called with the text 'not available'.

If you feel lucky, you can even try to start any application with the shareVia function:

<!-- start facebook on iOS (same as `shareViaFacebook`), if Facebook is not installed, the errorcallback will be invoked with message 'not available' -->
<button onclick="window.plugins.socialsharing.shareVia('com.apple.social.facebook', 'Message via FB', null, null, null, function(){console.log('share ok')}, function(msg) {alert('error: ' + msg)})">message via Facebook</button>
<!-- start facebook on Android (same as `shareViaFacebook`), if Facebook is not installed, the errorcallback will be invoked with message 'not available' -->
<button onclick="window.plugins.socialsharing.shareVia('facebook', 'Message via FB', null, null, null, function(){console.log('share ok')}, function(msg) {alert('error: ' + msg)})">message via Facebook</button>
<!-- start twitter on iOS (same as `shareViaTwitter`), if Twitter is not installed, the errorcallback will be invoked with message 'not available' -->
<button onclick="window.plugins.socialsharing.shareVia('com.apple.social.twitter', 'Message via Twitter', null, null, 'http://www.x-services.nl', function(){console.log('share ok')}, function(msg) {alert('error: ' + msg)})">message and link via Twitter on iOS</button>
<!-- if you share to a non existing/supported app, the errorcallback will be invoked with message 'not available' -->
<button onclick="window.plugins.socialsharing.shareVia('bogus_app', 'Message via Bogus App', null, null, null, function(){console.log('share ok')}, function(msg) {alert('error: ' + msg)})">message via Bogus App</button>

What can we pass to the shareVia function?

  • iOS: You are limited to 'com.apple.social.[facebook | twitter | sinaweibo | tencentweibo]'. If an app does not exist, the errorcallback is invoked and iOS shows a popup message asking the user to configure the app.
  • Android: Anything that would otherwise appear in the sharing dialoge (in case the share function was used. Pass a (part of the) packagename of the app you want to share to. The shareViaFacebook function for instance uses com.facebook.katana as the packagename fragment. Things like weibo, pinterest and com.google.android.apps.plus (Google+) should work just fine.

You can even test if a sharing option is available with canShareVia! You'll need to pass everything you want to share, because (at least on Android) some apps may only become available when an image is added. The function will invoke the successCallback when it can be shared to via shareVia, and the errorCallback if not. As a bonus on Android, the errorCallback contains a JSON Array of available packages you can pass to shareVia. You can even specify the activity if the app offers multiple sharing ways, passing 'packageName/activityName'. (for example, WeChat, passing 'com.tencent.mm' or 'com.tencent.mm/com.tencent.mm.ui.tools.ShareImgUI' to share to chat, passing 'com.tencent.mm/com.tencent.mm.ui.tools.ShareToTimeLineUI' to share to moments).

<button onclick="window.plugins.socialsharing.canShareVia('com.tencent.mm/com.tencent.mm.ui.tools.ShareToTimeLineUI', 'msg', null, img, null, function(e){alert(e)}, function(e){alert(e)})">is WeChat available on Android?</button>
<button onclick="window.plugins.socialsharing.canShareVia('com.apple.social.facebook', 'msg', null, null, null, function(e){alert(e)}, function(e){alert(e)})">is facebook available on iOS?</button>
// this one requires whitelisting of whatsapp:// on iOS9 in your .plist file
<button onclick="window.plugins.socialsharing.canShareVia('whatsapp', 'msg', null, null, null, function(e){alert(e)}, function(e){alert(e)})">is WhatsApp available?</button>
<button onclick="window.plugins.socialsharing.canShareVia('sms', 'msg', null, null, null, function(e){alert(e)}, function(e){alert(e)})">is SMS available?</button>
<button onclick="window.plugins.socialsharing.canShareVia('instagram', 'msg', null, null, null, function(e){alert(e)}, function(e){alert(e)})">is Instagram available?</button>
<!-- Email is a different beast, so I added a specific method for it -->
<button onclick="window.plugins.socialsharing.canShareViaEmail(function(e){alert(e)}, function(e){alert(e)})">is Email available?</button>

Want to share images from a local folder (like an image you just selected from the CameraRoll)?

// use a local image from inside the www folder:
window.plugins.socialsharing.share(null, null, 'www/image.gif', null); // success/error callback params may be added as 5th and 6th param
// .. or a local image from anywhere else (if permitted):
// local-iOS:
window.plugins.socialsharing.share(null, null, '/Users/username/Library/Application Support/iPhone/6.1/Applications/25A1E7CF-079F-438D-823B-55C6F8CD2DC0/Documents/.nl.x-services.appname/pics/img.jpg');
// local-iOS-alt:
window.plugins.socialsharing.share(null, null, 'file:///Users/username/Library/Application Support/iPhone/6.1/Applications/25A1E7CF-079F-438D-823B-55C6F8CD2DC0/Documents/.nl.x-services.appname/pics/img.jpg');
// local-Android:
window.plugins.socialsharing.share(null, null, 'file:///storage/emulated/0/nl.xservices.testapp/5359/Photos/16832/Thumb.jpg');
// .. or an image from the internet:
window.plugins.socialsharing.share(null, null, 'http://domain.com/image.jpg');

If you can't get the plugin to work, have a look at this demo project.

Notes about the successCallback (you can just ignore the callbacks if you like)

The plugin passes a boolean to the successCallback to let the app know whether or not content was actually shared, or the share widget was closed by the user. On iOS this works as expected (except for Facebook, in case the app is installed), but on Android some sharing targets may return false, even though sharing succeeded. This is not a limitation of the plugin, it's the target app which doesn't play nice. To make it more confusing, when sharing via SMS on Android, you'll likely always have the successCallback invoked. Thanks Google.

Sharing multiple images (or other files)

You can pass an array of files to the share and shareVia functions.

// sharing multiple images via Facebook (you can mix protocols and file locations)
window.plugins.socialsharing.shareViaFacebook(
  'Optional message, may be ignored by Facebook app',
  ['https://www.google.nl/images/srpr/logo4w.png','www/image.gif'],
  null);

// sharing a PDF and an image
window.plugins.socialsharing.share(
  'Optional message',
  'Optional title',
  ['www/manual.pdf','https://www.google.nl/images/srpr/logo4w.png'],
  'http://www.myurl.com');

Note that a lot of apps support sharing multiple files, but Twitter just doesn't accept more that one file.

Saving images to the photo album (iOS only currently)

You can save an array of images to the camera roll:

window.plugins.socialsharing.saveToPhotoAlbum(
  ['https://www.google.nl/images/srpr/logo4w.png','www/image.gif'],
  onSuccess, // optional success function
  onError    // optional error function
);

iOS quirk (with camera plugin)

When using this plugin in the callback of the Phonegap camera plugin, wrap the call to share() in a setTimeout(). The share widget has the same limitation as the alert dialogue mentioned in the Phonegap documentation.

Excluding some options from the widget

If you want to exclude (for example) the assign-to-contact and copy-to-pasteboard options, add this to your main plist file:

<key>SocialSharingExcludeActivities</key>
<array>
  <string>com.apple.UIKit.activity.AssignToContact</string>
  <string>com.apple.UIKit.activity.CopyToPasteboard</string>
</array>

Here's the list of available activities you can disable :

  • com.apple.UIKit.activity.PostToFacebook
  • com.apple.UIKit.activity.PostToTwitter
  • com.apple.UIKit.activity.PostToFlickr
  • com.apple.UIKit.activity.PostToWeibo
  • com.apple.UIKit.activity.PostToVimeo
  • com.apple.UIKit.activity.TencentWeibo
  • com.apple.UIKit.activity.Message
  • com.apple.UIKit.activity.Mail
  • com.apple.UIKit.activity.Print
  • com.apple.UIKit.activity.CopyToPasteboard
  • com.apple.UIKit.activity.AssignToContact
  • com.apple.UIKit.activity.SaveToCameraRoll
  • com.apple.UIKit.activity.AddToReadingList
  • com.apple.UIKit.activity.AirDrop

5. Web Share API

Chrome introduced the Web Share API to share data:

navigator.share({
  'title': 'Optional title',
  'text': 'Optional message',
  'url': 'http://www.myurl.com'
}).then(function() {
  console.log('Successful share');
}).catch(function(error) {
  console.log('Error sharing:', error)
});

It doesn't provide all the options that the other share methods do but it is spec compliant.

6. Usage on Windows Phone

The available methods on WP8 are: available, canShareViaEmail, share, shareViaEmail and shareViaSMS. Currently the first two always return true, but this may change in the future in case I can find a way to truly detect the availability.

The share function on WP8 supports two flavours: message only, or a combination of message, title and link.

Beware: for now please pass null values for all non used attributes, like in the examples below.

Sharing a message:

<button onclick="window.plugins.socialsharing.share('Message only', null, null, null)">message only</button>

Sharing a link:

<button onclick="window.plugins.socialsharing.share('Optional message', 'Optional title', null, 'http://www.x-services.nl')">message, title, link</button>

Sharing an image (only images from the internet are supported). If you pass more than one image as an array, only the first one is used:

<button onclick="window.plugins.socialsharing.share('Optional message', 'Optional title', 'https://www.google.nl/images/srpr/logo4w.png', null)">image only</button>

7. Share-popover on iPad

This no longer works since plugin version 5.5.0, see this issue.

Carlos Sola-Llonch, a user of this plugin, pointed me at an iOS document stating "On iPad, you must present the view controller in a popover. On iPhone and iPod touch, you must present it modally."

He also provided me with the required code to do so (thanks!). I've adapted it a little to make sure current behaviour is not altered, but with a little extra effort you can use this new popover feature.

The trick is overriding the function window.plugins.socialsharing.iPadPopupCoordinates by your own implementation to tell the iPad where to show the popup exactly. It need to be a string like "100,200,300,300" (left,top,width,height).

You need to override this method after deviceready has fired.

You have various options, like checking the click event on a button and determine the event.clientX and event.clientY, or use this code Carlos showed me to grab the coordinates of a static button somewhere on your page:

window.plugins.socialsharing.iPadPopupCoordinates = function() {
  var rect = document.getElementById('share_button').getBoundingClientRect();
  return rect.left + "," + rect.top + "," + rect.width + "," + rect.height;
};

Note that since iOS 8 this popup is the only way Apple allows you to share stuff, so this plugin has been adjusted to use this plugin as standard for iOS 8 and positions the popup at the bottom of the screen (seems like a logical default because that's where it previously was as well). You can however override this position in the same way as explained above.

Note: when using the WkWebView polyfill the iPadPopupCoordinates overrides doesn't work so you can call the alternative setIPadPopupCoordinates method to define the popup position just before you call the share method.

example :

var targetRect = event.targetElement.getBoundingClientRect(),
    targetBounds = targetRect.left + ',' + targetRect.top + ',' + targetRect.width + ',' + targetRect.height;

window.plugins.socialsharing.setIPadPopupCoordinates(targetBounds);
window.plugins.socialsharing.share('Hello from iOS :)')

8. Whitelisting on iOS

Since iOS 9 you have to make sure to whitelist the applications you want to use for sharing. Without whitelisting "query schemes", you may get the error callback invoked when calling the canShareVia function (and possibly the shareVia). You can verify this is a permissions issue by observing the output in Xcode for something like:

-canOpenURL: failed for URL: "whatsapp://app" - error: "This app is not allowed to query for scheme whatsapp"

You have a few options to prevent this by whitelisting the application you want to share via:

Directly editing the .plist file

Manually edit the .plist file - either from within Xcode or using a text editor. You can see example entries above (look for LSApplicationQueriesSchemes). While this is simple to do, the changes may be lost when rebuilding the project or tweaking the platform (e.g. upgrading) and is less recommended.

Use query schema plugin

There is a plugin designed specifically to address query schema whitelisting. You can find the plugin and how to use it here. In general, after installation, you can change plugin.xml file under the plugin subfolder within the plugins directory of your project to add the required schemas. Here again though, you have to edit an additional file and should take care not to overwrite it when making changes to your project.

Use Custom Config plugin

The Custom Config plugin (here) allows you to add configuration to your platforms "native" configuration files (e.g. .plist or AndroidManifest.xml) through the project's main config.xml file.

To address query schema issue, after installaing the plugin you can edit the iOS platform section of your config.xml (in the project main folder) to include the required entries:

<?xml version='1.0' encoding='utf-8'?>
<widget id="your.app.id"
        version="0.9.1"
        xmlns="http://www.w3.org/ns/widgets"
        xmlns:cdv="http://cordova.apache.org/ns/1.0">

    <!-- a bunch of elements like name, description etc -->

    <platform name="ios">

        <!-- add this entry -->
        <config-file platform="ios" target="*-Info.plist" parent="LSApplicationQueriesSchemes">
            <array>
                <string>whatsapp</string>
                <!-- add more query scheme strings -->
            </array>
        </config-file>
    </platform>
</widget>

The advantage with this method is that editing is done in the config.xml file which will most often be in your source control anyway and hence, changes to it will be reserved.

9. NSPhotoLibraryUsageDescription on iOS

This plugin requires permissions to the users photos. Since iOS 10 it is required that you provide a description for this access.

The plugin configures a default description for you. If you do need to customise it, you can set a Cordova variable when installing:

$ cordova plugin add cordova-plugin-x-socialsharing --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="This app uses your photo library" --variable PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION="This app saves images your photo library"

10. Import Types into an Ionic Angular Project

If you do not already have a typings file definition, create one inside your src folder, for examplesrc/typings.d.ts

Add this reference into your typings file definition:

/// <reference path="../node_modules/cordova-plugin-x-socialsharing/types/index.d.ts" />

socialsharing-phonegap-plugin's People

Contributors

alexbuijs avatar bennimmo avatar bryant1410 avatar cairin avatar cesarak avatar dnoliver avatar eddyverbruggen avatar jerodfritz avatar karlvr avatar macdonst avatar mikealo avatar mobilitytiago avatar nhoffmann avatar okulygin avatar onlydave avatar osro avatar othierry-asi avatar phfsantos avatar pimverlangen avatar rafaeloliveirafaria avatar revolunet avatar sachingarg05 avatar santiq avatar sebastianschirmer avatar sebt avatar subranil avatar tadaa avatar tomercagan avatar vleango avatar wischweh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

socialsharing-phonegap-plugin's Issues

TypeError: 'undefined' is not an object

I'm getting this error when trying to implement this plugin on iOS6+ using build.phonegap. Here is what I have:

config.xml

<gap:plugin name="nl.x-services.plugins.socialsharing"/>

index.html

function share(){
window.plugins.socialsharing.share('message',null,'image');
}

I'm sure it's something obvious but for some reason I just can't get it to work :(

issue with Facebook and twitter sharing on iOS7

I implemented this. I’m using cordova (phonegap) 3.0.

It works good in iOS6.

In iOS7 the sharing view is not showing the Facebook and twitter icon. If I try to share directly with Facebook, for example:

<button onclick="window.plugins.socialsharing.shareViaFacebook('Message via Facebook', null, null, console.log('share ok'), function(errormsg){alert(errormsg)})">msg via Facebook (with errcallback)</button>

I get back the message error that “is not available”. I’m guessing from this part of the code of the socialsharing.m class:
(void)share:(CDVInvokedUrlCommand*)command {

if (!NSClassFromString(@”UIActivityViewController”)) {
CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];

Has anyone experience this issue with iOS7 implementation of this component and the Facebook and twitter sharing functionality?

ios7

I've tried the plugin in ios7 and the user can only share using the mail, message or twitter, there isn't the option of sharing using facebook or whatsapp. Is this being solved or is there any way to solve it?

Link and Message not post on facebook

I am using phonegap build. I am facing following issue:
I am not able to sent message and link via this plugin
I have used message and link
When i click on button it shows popup box of various social sharing app. I had selected
facebook app. it did no shows any predefine message or link in post area.

Please help..
Thanks in Advance

Cordova 3.3.0 throws an error

02-23 13:32:46.663: E/Web Console(21344): Uncaught TypeError: Converting circular structure to JSON at file:///android_asset/www/cordova.js:904

That's the error I've when trying to use this plugin. Others plugins are working just fine.

Use of undeclared identifier '_tempStoredFile' in SocialSharing.m

When I try to build my project I get the following error:

The following build commands failed:
 CompileC build/App.build/Debug-iphonesimulator/App.build/Objects-normal/i386/SocialSharing.o App/Plugins/nl.x-services.plugins.socialsharing/SocialSharing.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

It seems that the problem is Use of undeclared identifier '_tempStoredFile' here

I believe this to have been introduced recently, because my app built fine on Friday.

Thanks

Does this work with Pinterest?

Never know where to ask these questions. Github needs a question forum. Also looks like you just added the ability to share directly with out the middleman dialog. That's exactly what I was looking for.

Callbacks

Hello,

I am using the plugin and have the following code in my JS.

window.plugins.socialsharing.share(message, null, image, url,
    function(d) {
      console.log(d);
    }, function(e) {
      console.log(e);
    });

In my iOS I have removed all of the UIActivities that I do not want. That is working fine, but I am not seeing my callbacks (or perhaps I am expecting something different).

I was hoping to be able to detect HOW the user has shared the post, be it to Facebook, Twitter, etc.

Is this possible? I have just updated to the most recent version of the plugin, using Cordova 3.2.0

Thanks,

--d

Tweeting a base64 image

I'm trying to achieving tweeting a screenshot of the app page. I.e. let someone share a snapshot of the html on the page. I've managed to work out the first bit by generating a canvas of some html, converting the canvas to an image.

I just need to attach that image to the tweet.

Do you think this is achievable?

share via sms?

Hi,
Is it possible to directly open the sms dialog? same as shareViaWhatsApp, only shareViaSMS?

Thanks,
Doron

Android: facebook share does't work

Now on my Android 4.4.2 and 2.3.7 devices is possible to share only a local image via facebook. I did try all your sample commands and these don’t work for sharing via facebook. Twitter/email/etc. shares work fine.

whatsapp support?

Hi, I'm using phonegap 2.x and I can't upgrade it to 3.x in order to use the new plugin which supports whatsapp sharing, could u update your plugin to support whatsapp sharing in this version?
Thx!

Sharing inside a Camera callback

My first attempt at using the plugin worked easily. I then switched to using it inside a Camera callback, like so:

    navigator.camera.getPicture(function(file) {
        console.log('um....');
        window.plugins.socialsharing.share(null, null, file);
        console.log('222um....');
    },function(err) {
        console.log("poo ",err);
    }, {
        quality:75,
        destinationType:Camera.DestinationType.FILE_URI,
        sourceType:source
    });

And it doesn't work. Nor do I get any type of error. It just does... nothing. Any ideas?

Can't Share PDF files on IOS 7.0.4

Hi, I love the plugin, however I'm running into issues when I attempt to Share a PDF file.

The device I'm using is an iPad 3 running IOS 7.0.4. Using your sample project as a guide I can share an image, for example the following line of code will add 'test.jpg', to my email when choosing 'Mail' from the share options:

window.plugins.socialsharing.share('Here is your Image', 'test subject', 'www/test.jpg');

However, if I place demo.pdf in the exact same folder location as 'test.jpg', and use the following code, then the pdf will not appear on the Mail (the subject and email body will).

window.plugins.socialsharing.share('Here is your PDF', 'test subject', 'www/demo.pdf');

I've also tried using a PDF location on a remote website using its full URL (as per the documentation), and even encoding one as base 64, and no luck with those options either...

Thanks!

Facebook iOs7 doesn't appear

Hi!
I used this plugin with Android and it works very well, but on iOs 7, Facebook doesn't appear on the share panel, why?

Thx!

[IOS] ERROR: Method 'share:' not defined in Plugin 'SocialSharing'

Hello,
I'm trying to use this plugin into my iOS app built with PhoneGap 3.1.0, I installed the plugin using the automatic installation.

When I try to share a content using a method like this:

window.plugins.socialsharing.share('Message, subject, image and link', 'The subject', 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')

into the console I see this:

<Warning>: ERROR: Method 'share:' not defined in Plugin 'SocialSharing'
<Warning>: -[CDVCommandQueue executePending] [Line 117] FAILED pluginJSON = ["http:\/\/www.x-services.nl"

and obviously I can't share anything.

any ideas?
thank you :)

base64 encoded image; sharing on Facebook fails; Android 4.2.2

Hi,

I have a problem with the facebook and base64 encoded image on Android 4.2.2.

When I try to share an image on facebook I get an FileNotFound.

Only facebook seem to have problems. I can share on twitter and by using email.

The log extract is below. Please let me know if you need more info.

Thank you very much.

I/InputReader(  461): Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.1364 ] when=469593483371000
I/InputDispatcher(  461): Delivering touch to: action: 0x4
I/InputDispatcher(  461): Delivering touch to: action: 0x0
I/InputReader(  461): Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=469593527316000
I/InputDispatcher(  461): Delivering touch to: action: 0x1
D/SensorService(  461):  [AR] 0.4 6.2 7.6
D/SensorService(  461): AutoRotationSensor::process: Ar_SensorChanged oldrotation = [0], rotation = [255]
V/WindowOrientationListener(  461): Rotation Sensor : x=255.0
E/EnterpriseContainerManager(  461): ContainerPolicy Service is not yet ready!!!
D/EnterpriseDeviceManager(  461): ContainerId: 0
W/LicenseLogService(  461): log() is called by non admin
D/SensorService(  461):  [AR] 0.2 6.9 7.9
D/SensorService(  461): AutoRotationSensor::process: Ar_SensorChanged oldrotation = [255], rotation = [0]
V/WindowOrientationListener(  461): Rotation Sensor : x=0.0
I/power   (  461): *** acquire_dvfs_lock : lockType : 1  freq : 1008000 
D/CustomFrequencyManagerService(  461): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT  frequency : 1008000  uid : 1000  pid : 461  pkgName : ACTIVITY_RESUME_BOOSTER@6
W/ActivityManager(  461): mDVFSHelper.acquire()
E/SurfaceFlinger(  486): #### captureScreenImplLocked
D/WindowManager(  461): computeScreenConfigurationLocked() set config.orientation=2 dw=1280 dh=800 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5255 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5224 com.android.server.am.ActivityStack.realStartActivityLocked:932 
D/PowerManagerService(  461): setKeyboardVisibility: false
D/AbsListView(27722): unregisterIRListener() is called 
I/power   (  461): *** release_dvfs_lock : lockType : 1 
I/power   (  461): *** acquire_dvfs_lock : lockType : 1  freq : 1008000 
D/CustomFrequencyManagerService(  461): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 1008000  uid : 1000  pid : 461  tag : ACTIVITY_RESUME_BOOSTER@6
D/CustomFrequencyManagerService(  461): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT  frequency : 1008000  uid : 1000  pid : 461  pkgName : ACTIVITY_RESUME_BOOSTER@6
W/ActivityManager(  461): mDVFSHelper.acquire()
D/WindowManager(  461): computeScreenConfigurationLocked() set config.orientation=2 dw=1280 dh=800 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5255 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5224 com.android.server.am.ActivityStack.realStartActivityLocked:932 
D/PowerManagerService(  461): setKeyboardVisibility: false
D/SensorService(  461):   0.2 6.6 6.9
V/AlarmManager(  461): waitForAlarm result :4
V/AlarmManager(  461): trigger ELAPSED_REALTIME_WAKEUP or RTC_WAKEUP
V/AlarmManager(  461): waitForAlarm result :4
V/AlarmManager(  461): trigger ELAPSED_REALTIME_WAKEUP or RTC_WAKEUP
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
D/ProgressBar( 5362): setProgress = 0
D/ProgressBar( 5362): setProgress = 0, fromUser = false
D/ProgressBar( 5362): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
D/ProgressBar( 5362): setProgress = 0
D/ProgressBar( 5362): setProgress = 0, fromUser = false
D/ProgressBar( 5362): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/ProgressBar( 5362): setProgress = 0
D/ProgressBar( 5362): setProgress = 0, fromUser = false
D/ProgressBar( 5362): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/AbsListView( 5362): Get MotionRecognitionManager
D/AbsListView( 5362): onVisibilityChanged() is called, visibility : 8
D/AbsListView( 5362): unregisterIRListener() is called 
D/MotionRecognitionService(  461):  ssp status : false
D/AbsListView( 5362): Get MotionRecognitionManager
D/AbsListView( 5362): onVisibilityChanged() is called, visibility : 4
D/AbsListView( 5362): unregisterIRListener() is called 
D/AbsListView( 5362): onVisibilityChanged() is called, visibility : 4
D/AbsListView( 5362): unregisterIRListener() is called 
D/AbsListView( 5362): onVisibilityChanged() is called, visibility : 0
D/AbsListView( 5362): unregisterIRListener() is called 
D/AbsListView( 5362): onVisibilityChanged() is called, visibility : 0
D/AbsListView( 5362): unregisterIRListener() is called 
D/dalvikvm( 5362): GC_FOR_ALLOC freed 4835K, 43% free 14994K/25900K, paused 204ms, total 205ms
I/dalvikvm-heap( 5362): Grow heap (frag case) to 19.293MB for 3145744-byte allocation
D/STATUSBAR-NetworkController(15522): refreshSignalCluster: data=-1 bt=false
D/dalvikvm( 5362): GC_FOR_ALLOC freed 50K, 38% free 18016K/28976K, paused 134ms, total 134ms
I/SurfaceFlinger(  486): id=820(17) createSurf 0x40c397c4 (1x1),1 flag=404, DomposerAct
D/STATUSBAR-StatusBarManagerService(  461): manageDisableList what=0x0 pkg=WindowManager.LayoutParams
D/ProgressBar( 5362): updateDrawableBounds: left = 0
D/ProgressBar( 5362): updateDrawableBounds: top = 0
D/ProgressBar( 5362): updateDrawableBounds: right = 16
D/ProgressBar( 5362): updateDrawableBounds: bottom = 16
D/AbsListView( 5362): unregisterIRListener() is called 
E/fb4a(:<default>):MqttOperationManager( 5362): Unexpected duplicate message ID -1 for operation PINGRESP.
I/SurfaceFlinger(  486): id=820 Removed DomposerAct (5/7)
I/SurfaceFlinger(  486): id=821(18) createSurf 0x4092591c (1280x752),1 flag=4, DomposerAct
W/BufferQueue(  486): [com.facebook.katana/com.facebook.katana.activity.composer.ComposerActivity] cancelBuffer: BufferQueue has been abandoned!
I/SurfaceFlinger(  486): id=820 Removed DomposerAct (-2/8)
D/AbsListView( 5362): unregisterIRListener() is called 
D/AbsListView( 5362): unregisterIRListener() is called 
E/EnterpriseContainerManager(  461): ContainerPolicy Service is not yet ready!!!
D/EnterpriseDeviceManager(  461): ContainerId: 0
W/LicenseLogService(  461): log() is called by non admin
W/IInputConnectionWrapper(27722): showStatusIcon on inactive InputConnection
D/AbsListView( 5362): unregisterIRListener() is called 
E/dalvikvm( 5362): adjustAdaptiveCoef max=4194304, min=1048576, ut=568
D/dalvikvm( 5362): GC_CONCURRENT freed 267K, 39% free 17949K/28976K, paused 13ms+76ms, total 439ms
D/AbsListView( 5362): unregisterIRListener() is called 
I/power   (  461): *** release_dvfs_lock : lockType : 1 
D/CustomFrequencyManagerService(  461): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 1008000  uid : 1000  pid : 461  tag : ACTIVITY_RESUME_BOOSTER@6
W/ActivityManager(  461): mDVFSHelper.release()
I/SurfaceFlinger(  486): id=815 Removed DhooserActi (4/7)
I/SurfaceFlinger(  486): id=805 Removed QatrimonioT (2/6)
I/SurfaceFlinger(  486): id=815 Removed DhooserActi (-2/6)
I/SurfaceFlinger(  486): id=805 Removed QatrimonioT (-2/6)
D/AbsListView(27722): onDetachedFromWindow
W/Settings( 1022): Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
D/FaceDetector( 5362): verifyConfiguration: input: [1024x768], current: [0x0], syncMode: 0
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(1) - 17041055
I/Choreographer( 1022): Skipped 35 frames!  The application may be doing too much work on its main thread.
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - 17041055
I/SurfaceFlinger(  486): id=822(18) createSurf 0x409363e4 (1280x1),1 flag=4, JnputMethod
W/ResourceType(15522): Attempt to retrieve bag 0x01030068 which is invalid or in a cycle.
W/ResourceType(15522): Attempt to retrieve bag 0x01030067 which is invalid or in a cycle.
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@448ebbc0needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
W/IdleConnectionHandler( 5362): Removing a connection that never existed!
D/dalvikvm( 1022): GC_FOR_ALLOC freed 2570K, 51% free 6308K/12848K, paused 73ms, total 74ms
I/dalvikvm-heap( 1022): Grow heap (frag case) to 9.625MB for 1899536-byte allocation
D/dalvikvm( 1022): GC_FOR_ALLOC freed 11K, 37% free 8152K/12848K, paused 37ms, total 37ms
D/AbsListView( 5362): unregisterIRListener() is called 
E/dalvikvm( 1022): adjustAdaptiveCoef max=4194304, min=1048576, ut=568
D/dalvikvm( 1022): GC_CONCURRENT freed 77K, 37% free 8165K/12848K, paused 10ms+20ms, total 79ms
D/FaceDetector( 5362): 0 tags, 0.580000 seconds min: 0 max: 11 conf: 2
D/SensorService(  461):   0.3 6.6 7.2
I/InputReader(  461): Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.1365 ] when=469597701876000
I/InputDispatcher(  461): Delivering touch to: action: 0x4
I/InputDispatcher(  461): Delivering touch to: action: 0x0
I/InputReader(  461): Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=469597760470000
I/InputDispatcher(  461): Delivering touch to: action: 0x1
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(1) - -81159568
W/ResourceType(15522): Attempt to retrieve bag 0x01030068 which is invalid or in a cycle.
W/ResourceType(15522): Attempt to retrieve bag 0x01030067 which is invalid or in a cycle.
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@44699a70needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
W/ResourceType(15522): Attempt to retrieve bag 0x010301f7 which is invalid or in a cycle.
E/SurfaceFlinger(  486): #### captureScreenImplLocked
D/STATUSBAR-NetworkController(15522): refreshSignalCluster: data=-1 bt=false
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(3) - 17041055
D/LightsService(  461): [SvcLED] turnOff:: id = 4mIsIDUsingPatternLED = true
D/LightsService(  461): [SvcLED] setSvcLedStateLocked:: id = 4, color = 0, mode = Off, set = Off
D/LightsService(  461): [SvcLED] ForcedSvcLEDTask is running.
D/LightsService(  461): [SvcLED] setSvcLedLightLocked : mSvcLedState : 0x0  priority : 7  mSvcLedMode : 1
D/LightsService(  461): [SvcLED] wake unlock
I/LightsService(  461): fileWriteString. value : LightsService
I/SurfaceFlinger(  486): id=822 Removed JnputMethod (4/6)
I/SurfaceFlinger(  486): id=822 Removed JnputMethod (-2/6)
I/power   (  461): *** acquire_dvfs_lock : lockType : 1  freq : 1008000 
D/CustomFrequencyManagerService(  461): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT  frequency : 1008000  uid : 1000  pid : 461  pkgName : ACTIVITY_RESUME_BOOSTER@6
W/ActivityManager(  461): mDVFSHelper.acquire()
D/WindowManager(  461): computeScreenConfigurationLocked() set config.orientation=2 dw=1280 dh=800 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5255 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5224 com.android.server.am.ActivityStack.resumeTopActivityLocked:2672 
D/PowerManagerService(  461): setKeyboardVisibility: false
I/SurfaceFlinger(  486): id=823(19) createSurf 0x409363e4 (1x1),1 flag=4, Uoast
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
D/PowerManagerService(  461): [api] acquire WakeLock flags=0x2000000a tag=WindowManager uid=1000 pid=461
D/AbsListView( 5362): unregisterIRListener() is called 
D/AbsListView( 5362): unregisterIRListener() is called 
I/SurfaceFlinger(  486): id=824(26) createSurf 0x4093601c (1280x752),1 flag=404, QatrimonioT
D/STATUSBAR-StatusBarManagerService(  461): manageDisableList what=0x0 pkg=WindowManager.LayoutParams
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@446b0198needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
E/EnterpriseContainerManager(  461): ContainerPolicy Service is not yet ready!!!
D/EnterpriseDeviceManager(  461): ContainerId: 0
W/LicenseLogService(  461): log() is called by non admin
D/dalvikvm( 5362): GC_FOR_ALLOC freed 3779K, 42% free 15023K/25900K, paused 284ms, total 286ms
D/AbsListView( 5362): [unregisterDoubleTapMotionListener]
I/dalvikvm-heap( 5362): Grow heap (frag case) to 19.321MB for 3145744-byte allocation
I/Monitor (  461): SIOP:: Current AP = 0, CP = 0
D/dalvikvm( 5362): GC_FOR_ALLOC freed 39K, 38% free 18055K/28976K, paused 174ms, total 174ms
I/MotionRecognitionManager( 5362):   .unregisterListener : / listener count = 0->0,  
D/AbsListView( 5362): unregisterIRListener() is called 
D/AbsListView( 5362): [unregisterDoubleTapMotionListener]
D/WindowManager(  461): computeScreenConfigurationLocked() set config.orientation=2 dw=1280 dh=800 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5255 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5224 com.android.server.am.ActivityStack.resumeTopActivityLocked:2672 
D/PowerManagerService(  461): setKeyboardVisibility: false
D/CordovaActivity(27722): Incoming Result
D/CordovaActivity(27722): Request code = 1
D/CordovaActivity(27722): We have a callback to send this result to
I/CordovaLog(27722): Changing log level to DEBUG(3)
D/Whitelist(27722): Unlimited access to network resources
I/CordovaLog(27722): Found start page location: index.html
I/MotionRecognitionManager( 5362):   .unregisterListener : / listener count = 0->0,  
D/AbsListView( 5362): unregisterIRListener() is called 
D/CordovaActivity(27722): Resuming the App
D/CordovaActivity(27722): CB-3064: The errorUrl is null
D/WebView (27722): loadUrlImpl: called
D/webcore (27722):  CORE loadUrl: called
D/webkit  (27722): Firewall not null
D/webkit  (27722): euler: isUrlBlocked = false
D/LocationManagerService(  461): getLastLocation: Request[POWER_LOW network requested=0 fastest=0 num=1]
W/IInputConnectionWrapper( 5362): showStatusIcon on inactive InputConnection
E/Watchdog(  461): !@Sync 15651
D/dalvikvm(  339): GC_EXPLICIT freed 40K, 30% free 4199K/5936K, paused 3ms+3ms, total 77ms
I/power   (  461): *** release_dvfs_lock : lockType : 1 
D/CustomFrequencyManagerService(  461): releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 1008000  uid : 1000  pid : 461  tag : ACTIVITY_RESUME_BOOSTER@6
W/ActivityManager(  461): mDVFSHelper.release()
I/SurfaceFlinger(  486): id=821 Removed DomposerAct (4/7)
I/SurfaceFlinger(  486): id=821 Removed DomposerAct (-2/7)
D/dalvikvm(  339): GC_EXPLICIT freed <1K, 30% free 4199K/5936K, paused 2ms+3ms, total 46ms
D/AbsListView( 5362): onDetachedFromWindow
D/AbsListView( 5362): onDetachedFromWindow
E/dalvikvm(  339): adjustAdaptiveCoef max=4194304, min=1048576, ut=568
D/dalvikvm(  339): GC_EXPLICIT freed <1K, 30% free 4199K/5936K, paused 2ms+3ms, total 53ms
D/dalvikvm( 5362): GC_CONCURRENT freed 178K, 38% free 17974K/28976K, paused 55ms+51ms, total 885ms
W/System.err( 5362): java.io.IOException: read failed: ENOENT (No such file or directory)
W/System.err( 5362):    at libcore.io.IoBridge.read(IoBridge.java:442)
W/System.err( 5362):    at java.io.FileInputStream.read(FileInputStream.java:179)
W/System.err( 5362):    at java.io.InputStream.read(InputStream.java:163)
W/System.err( 5362):    at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
W/System.err( 5362):    at java.io.BufferedInputStream.read(BufferedInputStream.java:309)
W/System.err( 5362):    at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
W/System.err( 5362):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:623)
W/System.err( 5362):    at com.facebook.bitmaps.FbBitmapFactory.a(FbBitmapFactory.java:131)
W/System.err( 5362):    at com.facebook.bitmaps.BitmapScalingUtils$ImageSource.a(BitmapScalingUtils.java:383)
W/System.err( 5362):    at com.facebook.bitmaps.BitmapScalingUtils.a(BitmapScalingUtils.java:490)
W/System.err( 5362):    at com.facebook.bitmaps.BitmapScalingUtils.a(BitmapScalingUtils.java:418)
W/System.err( 5362):    at com.facebook.bitmaps.BitmapScalingUtils.b(BitmapScalingUtils.java:638)
W/System.err( 5362):    at com.facebook.bitmaps.BitmapScalingUtils.a(BitmapScalingUtils.java:615)
W/System.err( 5362):    at com.facebook.bitmaps.NativeImageResizer.a(NativeImageResizer.java:82)
W/System.err( 5362):    at com.facebook.photos.upload.uploaders.MultiPhotoUploader.a(MultiPhotoUploader.java:412)
W/System.err( 5362):    at com.facebook.photos.upload.uploaders.MultiPhotoUploader.b(MultiPhotoUploader.java:219)
W/System.err( 5362):    at com.facebook.photos.upload.uploaders.MultiPhotoUploader.a(MultiPhotoUploader.java:160)
W/System.err( 5362):    at com.facebook.photos.upload.service.PhotosUploadServiceHandler.a(PhotosUploadServiceHandler.java:143)
W/System.err( 5362):    at com.facebook.photos.upload.service.PhotosUploadServiceHandler.a(PhotosUploadServiceHandler.java:97)
W/System.err( 5362):    at com.facebook.fbservice.service.BlueServiceQueue.e(BlueServiceQueue.java:299)
W/System.err( 5362):    at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:53)
W/System.err( 5362):    at com.facebook.fbservice.service.BlueServiceQueue$3.run(BlueServiceQueue.java:230)
W/System.err( 5362):    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
W/System.err( 5362):    at java.util.concurrent.FutureTask.run(FutureTask.java:234)
W/System.err( 5362):    at com.facebook.common.executors.ListenableScheduledFutureImpl.run(ListenableScheduledFutureImpl.java:59)
W/System.err( 5362):    at android.os.Handler.handleCallback(Handler.java:725)
W/System.err( 5362):    at android.os.Handler.dispatchMessage(Handler.java:92)
W/System.err( 5362):    at android.os.Looper.loop(Looper.java:175)
W/System.err( 5362):    at android.os.HandlerThread.run(HandlerThread.java:60)
W/System.err( 5362): Caused by: libcore.io.ErrnoException: read failed: ENOENT (No such file or directory)
W/System.err( 5362):    at libcore.io.Posix.readBytes(Native Method)
W/System.err( 5362):    at libcore.io.Posix.read(Posix.java:123)
W/System.err( 5362):    at libcore.io.BlockGuardOs.read(BlockGuardOs.java:149)
W/System.err( 5362):    at libcore.io.IoBridge.read(IoBridge.java:432)
W/System.err( 5362):    ... 28 more
D/skia    ( 5362): ---- read threw an exception
D/skia    ( 5362): --- decoder->decode returned false
E/BitmapFactory( 5362): Unable to decode stream: java.io.FileNotFoundException: /data/data/com.facebook.katana/cache/uploads/180f30e7-51ab-4c66-85f2-69f20ef6b3c9_1.jpg.tmp: open failed: ENOENT (No such file or directory)
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
V/MediaPlayer-JNI(10247): native_setup
V/MediaPlayer(10247): constructor
V/MediaPlayer(10247): setListener
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@446d40f0needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@426b9250needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
D/ProgressBar(15522): setProgress = 69
D/ProgressBar(15522): setProgress = 69, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@44940a70needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/ProgressBar(15522): setProgress = 84
D/ProgressBar(15522): setProgress = 84, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/STATUSBAR-NetworkController(15522): refreshSignalCluster: data=-1 bt=false
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
D/SensorService(  461):  [AR] 1.2 4.2 8.2
D/SensorService(  461): AutoRotationSensor::process: Ar_SensorChanged oldrotation = [0], rotation = [255]
V/WindowOrientationListener(  461): Rotation Sensor : x=255.0
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@427287a8needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/SensorService(  461):  [AR] 0.8 5.7 7.7
D/SensorService(  461): AutoRotationSensor::process: Ar_SensorChanged oldrotation = [255], rotation = [0]
V/WindowOrientationListener(  461): Rotation Sensor : x=0.0
D/dalvikvm(15522): GC_CONCURRENT freed 2324K, 76% free 12116K/48500K, paused 3ms+16ms, total 93ms
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@447f6ed0needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
D/SensorService(  461):   -0.7 5.4 8.2
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@42730a38needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
W/fb4a(:<default>):PhotosUploadServiceHandler( 5362): Partial upload MultiPhotoUploader: com.facebook.photos.upload.uploaders.PartialUploadException: java.io.FileNotFoundException: /data/data/com.facebook.katana/cache/uploads/180f30e7-51ab-4c66-85f2-69f20ef6b3c9_1.jpg.tmp: open failed: ENOENT (No such file or directory)
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@4478c540needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
W/fb4a(:<default>):BlueServiceQueue( 5362): Exception during service
W/fb4a(:<default>):BlueServiceQueue( 5362): com.facebook.photos.upload.uploaders.PartialUploadException: java.io.FileNotFoundException: /data/data/com.facebook.katana/cache/uploads/180f30e7-51ab-4c66-85f2-69f20ef6b3c9_1.jpg.tmp: open failed: ENOENT (No such file or directory)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.photos.upload.uploaders.MultiPhotoUploader.b(MultiPhotoUploader.java:303)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.photos.upload.uploaders.MultiPhotoUploader.a(MultiPhotoUploader.java:160)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.photos.upload.service.PhotosUploadServiceHandler.a(PhotosUploadServiceHandler.java:143)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.photos.upload.service.PhotosUploadServiceHandler.a(PhotosUploadServiceHandler.java:97)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.fbservice.service.BlueServiceQueue.e(BlueServiceQueue.java:299)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:53)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.fbservice.service.BlueServiceQueue$3.run(BlueServiceQueue.java:230)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.common.executors.ListenableScheduledFutureImpl.run(ListenableScheduledFutureImpl.java:59)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at android.os.Handler.handleCallback(Handler.java:725)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at android.os.Handler.dispatchMessage(Handler.java:92)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at android.os.Looper.loop(Looper.java:175)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at android.os.HandlerThread.run(HandlerThread.java:60)
W/fb4a(:<default>):BlueServiceQueue( 5362): Caused by: java.io.FileNotFoundException: /data/data/com.facebook.katana/cache/uploads/180f30e7-51ab-4c66-85f2-69f20ef6b3c9_1.jpg.tmp: open failed: ENOENT (No such file or directory)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at libcore.io.IoBridge.open(IoBridge.java:416)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at java.io.FileInputStream.<init>(FileInputStream.java:78)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.protocol.DataStreamBody.a(DataStreamBody.java:25)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.apache.entity.mime.HttpMultipart.a(HttpMultipart.java:207)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.apache.entity.mime.HttpMultipart.a(HttpMultipart.java:225)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.apache.entity.mime.MultipartEntity.writeTo(MultipartEntity.java:187)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.entity.mime.MultipartEntityWithProgressListener.writeTo(MultipartEntityWithProgressListener.java:37)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:162)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:272)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:119)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:428)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.FbHttpClientImpl.execute(FbHttpClientImpl.java:176)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.FbHttpClientImpl.execute(FbHttpClientImpl.java:158)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.FbHttpClientRequestExecutor.a(FbHttpClientRequestExecutor.java:45)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.executors.QeHttpRequestExecutor.a(QeHttpRequestExecutor.java:50)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.RequestFlowStateController.a(RequestFlowStateController.java:67)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.FbRedirectController.a(FbRedirectController.java:92)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.FbHttpRequestProcessor.b(FbHttpRequestProcessor.java:160)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:139)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.FbHttpRequestProcessor.b(FbHttpRequestProcessor.java:103)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:196)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:374)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:151)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.http.protocol.AbstractSingleMethodRunner.a(AbstractSingleMethodRunner.java:26)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.photos.upload.uploaders.MultiPhotoUploader.a(MultiPhotoUploader.java:468)
W/fb4a(:<default>):BlueServiceQueue( 5362):     at com.facebook.photos.upload.uploaders.Multi
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
D/STATUSBAR-StatusBarManagerService(  461): sendNotification(2) - -81159568
D/ProgressBar(15522): setProgress = 87
D/ProgressBar(15522): setProgress = 87, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/ProgressBar(15522): setProgressDrawable mProgressDrawable = null, d = android.graphics.drawable.LayerDrawable@44856a30needUpdate = false
D/ProgressBar(15522): setProgressDrawable drawableHeight = 7
D/ProgressBar(15522): setProgress = 0
D/ProgressBar(15522): setProgress = 0, fromUser = false
D/ProgressBar(15522): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100
D/SurfaceWidgetClient( 1067): [123491/10] SurfaceWidgetClient onTrimMemory level: 60
D/SurfaceWidgetClient( 1067): [123491/10] releasing widget instance (paused: true): 1
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ThumbnailCache( 1667): Low Memory: Freed 0 textures from compression queue, 0 from write queue, 0 from the pinned list, 0 from the cache.
W/ManagedEGLContext( 1667): doTerminate failed: EGL count is 3 but managed count is 1
D/accuweather( 1067): [Accuweather_J_Tab]>>> WR:379 [0:0] releaseResources 
D/Launcher(  803): onTrimMemory. Level: 60
D/Launcher(  803): releaseShadows called
I/SurfaceFlinger(  486): id=823 Removed Uoast (6/6)
I/SurfaceFlinger(  486): id=823 Removed Uoast (-2/6)
D/PowerManagerService(  461): [api] [s] userActivity : event: 0 flags: 0 (uid: 1000 pid: 461)
D/PowerManagerService(  461): [api] release WakeLock flags=0x2000000a tag=WindowManager uid=1000 pid=461 (0x0)
D/PowerManagerService(  461): [api] applyWakeLockFlagsOnReleaseLocked : userActivityNoUpdateLocked is called : SCREEN_BRIGHT_WAKE_LOCK        'WindowManager' ON_AFTER_RELEASE (uid=1000, pid=461, ws={WorkSource: uids=[10117]}) (elapsedTime=3918)
D/STATUSBAR-NetworkController(15522): refreshSignalCluster: data=-1 bt=false
V/AlarmManager(  461): waitForAlarm result :4
V/AlarmManager(  461): trigger ELAPSED_REALTIME_WAKEUP or RTC_WAKEUP
D/SensorService(  461):   -0.7 5.8 7.7
D/STATUSBAR-NetworkController(15522): refreshSignalCluster: data=-1 bt=false

Query available share providers/check if a specific provider available

First i must thank you and say its a great plugin.

I'm missing the ability to check if a specific share provider available (before actually trying to share with it) so i can modify the app's UI
or even get a list of the available share providers

I believe i can write the java code for that(most of the code is already there), but not the objective c.

Also do you think there is a way to integrate that android share UI with the plugin?
http://developer.android.com/images/ui/actionbar-shareaction.png
http://developer.android.com/training/sharing/shareaction.html

the application quits after sharing

Hi! I'm using your plugin in my application on Cordova 3.20 and:

after sharing something on facebook the application quits
after sharing something on twitter it stays in twitter instead of going back to my app

moreover, if i try to re enter in my application i get an error.
Do you have any idea on this issue?
Thank you!

Android screenshot

Hi,
I think an Android screenshot is necessary in the readme.

Just because "pic or it did not happen" :)

Best regards

Problem on iOS

I have a problem with the SocialSharing plugin on iOS.

In config.xml I have added the line:

<gap:plugin name="nl.x-services.plugins.socialsharing" version="2.1" />

In the index.html I have added:

<script type="text/javascript" src="SocialSharing.js"></script>

When I call the following line, I get true (the share function is available):

typeof window.plugins.socialsharing.share == 'function'

When I call this one, nothing happens:

window.plugins.socialsharing.share('My text');

I have tested it on iOS 6 as well as iOS 7. I have also tested it with the success and error callback, but I did not get any message:

window.plugins.socialsharing.share('text', 'title', '', function() {alert('success')}, function(msg) {alert('error: ' + msg)}); 

By the way I'm using PhoneGap 2.7.0 in my project.

Can you tell me what I'm doing wrong? Thank you very much in advance.
Thomas

Does this work with Cordova?

I know this says it's a phonegap plugin but will it work for Cordova too? It doesn't seem to for me.

I am using netbeans which uses Cordova!

Thank you.

Android share with "always" or "just now"

Hi.
In my android the plugin show a window with all the app to share with. At the bottom there are two button "always" and "just now".
The problem should be that the button "always" bind the share action to the application.
There is a way to open the share windows without these buttons?

Thank you

"CordovaInterface.getThreadPool()" required

Hi,

I'm using the plugin with Android 4.3 and when I try to use any "shareVia..." function (ie: shareViaWhatsApp) I get the following message:

THREAD WARNING: exec() call to SocialSharing.shareViaWhatsApp blocked the main thread for 85ms. Plugin should use CordovaInterface.getThreadPool().

Any idea how to resolve it?

Thanks very much and congratulations for the work.

Base64 file parameter

I would like to suggest the attachment of the base64 encoded files directly as a parameter. It might be useful when the file to attach and share is the canvas content.

Cannot read property 'socialsharing' of undefined on phonegap

I am using this project on PGBuild

I have added this to config.xml:

<gap:plugin name="nl.x-services.plugins.socialsharing" />

I am still getting "Cannot read property 'socialsharing' of undefined on phonegap" when I try

window.plugins.socialsharing.share('I am testing Camshare. #testing', null, document.querySelector('img').src, null);

Did I miss something?

IOS 7 - Doesn't seem to invoke share dialog

So i thought all was working great but I pulled up our app in IOS 7 and click on the share directly to "facebook" I get no dialog and no error. Just doesn't launch. So I went back to IOS 6 to test and the dialogs launch perfectly.

Could there be a setting or something blocking this in IOS 7? I believe it's related to SLViewcontroller.

  1. Start up your app in ios 7
  2. Do not have any accounts setup in sharing.
  3. Click your share button (you should pop back into xcode) no error just can't continue.

After reading a post on a stackoverflow (http://stackoverflow.com/questions/19259149/slcomposeviewcontroller-addurl-issues-ios7) - I tried adding my account details for facebook. Then I did the following:

  1. Start up app in ios 7
  2. Clicked facebook share - now message dialog appears and you can share.

I think it's looking for a failure method to fire when the dialog can't be loaded (in ios 7).

Bug? Installation with phonegap 3.0.0-0.14.3

Hi guys, I'm very happy that exist a plugin like this.
However I'm getting some error during the installation:

bedspax:www duccio$ phonegap -v
3.0.0-0.14.3
bedspax:www duccio$ phonegap local plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
[phonegap] adding the plugin: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git

/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/config-changes.js:364
throw new Error('grafting xml at s
^
Error: grafting xml at selector "widget" from "/Users/duccio/Sites/yo/platforms/android/res/xml/config.xml" during config install went bad :(
at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/config-changes.js:364:51
at Array.forEach (native)
at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/config-changes.js:331:63
at Array.forEach (native)
at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/config-changes.js:315:45
at Array.forEach (native)
at Object.module.exports.add_plugin_changes (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/config-changes.js:310:35)
at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/config-changes.js:410:28
at Array.forEach (native)
at Object.module.exports.process (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/util/config-changes.js:409:49)

Any ideas?

some issues with Android and iOS

Android 4.03,HTC Sensational XL
Android 4.11,ASUS Transformer Pad
iOS 7.04,Ipad mini

When I use this method in Android and iOS

this is method 1

window.plugins.socialsharing.share('content', 'subject', 'https://www.google.com/images/srpr/logo4w.png', null);

this is method 2

if(navigator.userAgent.match(/(Android)/g)) { var keywords = "com.facebook.katana"; }
if(navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { var keywords = "fb://"; }
window.plugins.socialsharing.shareVia(keywords, 'content', null, null, 'https://www.google.com/images/srpr/logo4w.png', alert('su'), function(msg) { alert('nok: ' + msg); });

Android method 1 (the pic look like normal,and when I press the back button,it will show the confirm window)
http://www.littlebau.com/social/01.jpg
http://www.littlebau.com/social/back.jpg

Android method 2 (the pic had been Widening,and when I press the back button,it will not show the confirm window,I know it could be Android Facebook app problem,but how to as same as method 1 ?)
http://www.littlebau.com/social/02.jpg

ios method 1 (can't see the facebook app,so I can't do other testing...)
http://www.littlebau.com/social/ios.png

ios method 2 (it will alert "nok:not supported")

Finally,please look at the Android method 1 and method 2 facebook's pic
http://www.littlebau.com/social/fb.gif

3.1 iOS, crashes

Just saw this plug-in, sounds awesome! Unfortunately, it crashes on iOS. I'm on Phonegap 3.1 and need to stay on it for the keyboard fixes for iOS7.

window.plugins.socialsharing.available(function(isAvailable) {
if (isAvailable) {
window.plugins.socialsharing.share('My text');
// .. (or like this):
}
});

2013-10-26 16:16:14.194 Hiyu[25593:a0b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[**NSCFArray objectAtIndex:]: index (3) beyond bounds (3)'
* First throw call stack:
(
0 CoreFoundation 0x0012c5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0244e8b6 objc_exception_throw + 44
2 CoreFoundation 0x0012c3bb +[NSException raise:format:] + 139
3 CoreFoundation 0x00121340 -[__NSCFArray objectAtIndex:] + 160
4 Hiyu 0x0005bc8f -[SocialSharing share:] + 463
5 Hiyu 0x0001d506 -[CDVCommandQueue execute:] + 902
6 Hiyu 0x0001cd19 -[CDVCommandQueue executePending] + 697
7 Hiyu 0x0001c859 -[CDVCommandQueue enqueCommandBatch:] + 153
8 Hiyu 0x0001ca06 -[CDVCommandQueue fetchCommandsFromJs] + 182
9 Hiyu 0x0001c91f -[CDVCommandQueue maybeFetchCommandsFromJs:] + 159
10 libobjc.A.dylib 0x0246081f -[NSObject performSelector:withObject:] + 70
11 Foundation 0x020a3c18 __NSThreadPerformPerform + 285
12 CoreFoundation 0x000b58af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 15
13 CoreFoundation 0x000b523b __CFRunLoopDoSources0 + 235
14 CoreFoundation 0x000d230e __CFRunLoopRun + 910
15 CoreFoundation 0x000d1b33 CFRunLoopRunSpecific + 467
16 CoreFoundation 0x000d194b CFRunLoopRunInMode + 123
17 GraphicsServices 0x0389c9d7 GSEventRunModal + 192
18 GraphicsServices 0x0389c7fe GSEventRun + 104
19 UIKit 0x0039294b UIApplicationMain + 1225
20 Hiyu 0x00023b2c main + 92
21 libdyld.dylib 0x02c47725 start + 0
22 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Confusion with the link not being included in Twitter Preview.

When I want to share a link in Twitter via this plugin, in the preview of what I'm about to share, the link is hidden. I can see the image and the message but the link is not visible. This is fine for me, because I'm the developer and I know that the link is safely included, but...
...this is quite confusing for the end user because even though the link is already included, they won't be able to see the link (not until they have already shared the tweet) and in some cases they will try to add a link on their own, disregarding that there is already a link included.

So is it possible to add the link in the preview of Twitter share as part of the message (at the end of the message)?

Unable to find application to perform this function

Thanks for a great plugin!

Manual install of plugin for phonegap 3.3, this is a local build for Android.
Testing on Galaxy S4 and Nook HD Plus.
Facebook app is installed on both devices, and appears in the share window.

The following works just fine:

       window.plugins.socialsharing.share('Message and image', null, 'https://www.google.nl/images/srpr/logo4w.png', null);

However if I try to invoke facebook only with:

   window.plugins.socialsharing.shareViaFacebook('Message via Facebook', null, null, console.log('share ok'), function(errormsg){alert(errormsg)});

OR

       window.plugins.socialsharing.shareVia('facebook', 'Message via FB', null, null, null, console.log('share ok'), function(msg) {alert('nok: ' + msg)})

I get the native sharing window showing (with heading 'Choose an action') with the message: Unable to find application to perform this action.

Any ideas?

No facebook / twitter icons

I followed the steps mentioned in the documentation and the plugin works with Cordova 3.1 on IOS 6.

I only see the mail icon. The facebook and twitter icons are not available. Am I missing something?

Link is never included. Image is included only a few times.

Hello, first of all congrats on the great plugin.

Unfortunately, no matter what I've tried I couldn't get it to include the link in Twitter or Facebook.
Also the image is included intermittently. Sometimes it is properly attached and some times it is not.

I'm using Phonegap 3.1 (not the build) / iOS 7 / iPhone 4 and iPhone 5.

Not working on iOS

Hey great plugin, works well on Android. But I cant seem to get it to work on iOS. Am I missing something?

var message = 'the message';
var subject = 'the subject';
var image = 'https:image.url';
var link = 'http://www.somesite.com';

window.plugins.socialsharing.share( message, subject, image, link);

I am using iOS7, could that be it?

Android 4.4.2 Kitkat and Android 4.3 JellyBean

Dont work the plugin in these platforms. You know why? the Log displayed me on Eclipse is this:

Failed to ensure directory: /storage/sdcard/Android/data/como.example.socialsharing/files

Automatically Run Specific App

Hi,

Is it possible to automatically run app for sharing whenever window.plugins.socialsharing.share() is called? For instance, I would only want to call Facebook everytime. Because currently, Android still lets me choose what app to run to share.

data base64 not working

This is not working:

<button onclick="window.plugins.socialsharing.share('test', null, 'data:image/png;base64,R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7', null)">base64 image only</button>

iphone4/ ios7
working fine with url/file image
without the "message" field, offers to save the image only, with "message" the image get's lost in translation.
Thanks

Cannot invoke ShareDialog with iFrame

If the SRC of iFrame contain any value, the Share Dialog cannot display.

If the sharing content does not contain iFrame or contains iframe with SRC = empty or null - The Share Dialog display perfectly.

Share message on Android

Hi Eddy,

Why is not possible to share a message or text in Android? When you do share is essential to share text, especially on Facebook. What are the alternatives to solve this? What plans are there to add this functionality?

Thanks in advance,
Alejandro

Phonegap Build (3.1.0) on iOS, window.plugins.socialsharing is undefined

I have a Phonegap build application that uses the social sharing plugin. The android build works fine, iOS (7) does not work. (the whole object does not exist in the DOM)

included the latest version in config.xml
<gap:plugin name="nl.x-services.plugins.socialsharing" />

included the js reference on the index after including phonegap.js
<script src="js/plugins/SocialSharing.js"></script>

logging the window.plugins.socialsharing gives undefined on iOS and the right object on Android

iOS: sharing on Facebook with link does not work

Well, I can post on Facebook when using sth. like "My text with a link: http://domain.com", but Facebook doesn't fetch the link and does fancy stuff with it (display title and image). Works on Android though.

Is there anything you can change about the way Facebook handles links within text on iOS?

Thanks!

The default content question

I am using PGB 3.3 with 3.8.1 plugin
when I use this method

window.plugins.socialsharing.shareVia('facebook', 'Message via FB', null, null, null, console.log('share ok'), function(msg) {alert('nok: ' + msg)})

window.plugins.socialsharing.share(....)

the default content "Message via FB"
in Android 4.0.3,the default word can't appear
http://www.littlebau.com/social2/android.png
in iOS 7.0.6,the default word appear
http://www.littlebau.com/social2/ios.png

is it a native Facebook app limit by Android and iOS?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.