Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Sharing exit app in android #126

Closed
sashagrunge opened this issue Jun 2, 2014 · 16 comments
Closed

Social Sharing exit app in android #126

sashagrunge opened this issue Jun 2, 2014 · 16 comments

Comments

@sashagrunge
Copy link

Success callback is not called because the app is quitted when user select a share options. The app crashed when user return to the app manually.

Works on ios not android.

@EddyVerbruggen
Copy link
Owner

Can you share your project so I can take a look?

@sashagrunge
Copy link
Author

The project cannot be shared .. following is the log. Hope there are some hints..

06-02 17:49:44.168: D/CordovaActivity(29950): Paused the application!
06-02 17:49:44.168: D/CordovaWebView(29950): Handle the pause
06-02 17:49:44.218: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.278: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.288: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.348: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.358: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.358: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.368: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.368: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.368: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.368: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.368: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.378: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.378: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.378: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.378: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.378: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.388: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.388: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.388: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.388: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.388: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.388: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.408: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.408: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.408: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.408: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.408: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.408: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.418: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.418: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.418: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.418: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.418: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.418: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.428: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.428: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.428: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.428: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.428: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.428: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.428: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.438: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.438: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.448: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.448: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.448: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.448: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.448: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.448: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.448: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.458: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.458: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.458: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.458: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.458: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.458: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.458: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.458: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.468: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.478: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.528: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:49:44.558: D/AbsListView(29950): Get MotionRecognitionManager
06-02 17:49:44.618: D/AbsListView(29950): onVisibilityChanged() is called, visibility : 4
06-02 17:49:44.618: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:49:44.618: D/AbsListView(29950): onVisibilityChanged() is called, visibility : 0
06-02 17:49:44.618: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:49:44.638: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:49:44.778: D/dalvikvm(29950): GC_FOR_ALLOC freed 890K, 17% free 21876K/26344K, paused 36ms, total 37ms
06-02 17:49:44.788: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:49:44.818: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:49:44.878: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:49:44.908: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:50:12.215: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:50:12.435: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:50:12.845: D/CordovaActivity(29950): CordovaActivity.onDestroy()
06-02 17:50:12.845: D/CordovaWebView(29950): >>> loadUrlNow()
06-02 17:50:13.196: D/CordovaWebViewClient(29950): onPageFinished(about:blank)
06-02 17:50:13.196: D/CordovaActivity(29950): onMessage(onPageFinished,about:blank)
06-02 17:50:13.196: D/CordovaActivity(29950): onMessage(exit,null)
06-02 17:50:13.716: D/AbsListView(29950): onDetachedFromWindow
06-02 17:50:13.716: D/AbsListView(29950): unregisterIRListener() is called
06-02 17:50:53.305: W/ApplicationPackageManager(29950): getCSCPackageItemText()
06-02 17:50:53.325: I/CordovaLog(29950): Changing log level to DEBUG(3)
06-02 17:50:53.325: I/CordovaLog(29950): Found start page location: index.html
06-02 17:50:53.325: D/Whitelist(29950): Unlimited access to network resources
06-02 17:50:53.325: D/CordovaActivity(29950): CordovaActivity.onCreate()
06-02 17:50:53.355: D/CordovaWebView(29950): CordovaWebView is running on device made by: samsung
06-02 17:50:53.365: D/JsMessageQueue(29950): Set native->JS mode to 2
06-02 17:50:53.365: D/CordovaActivity(29950): CordovaActivity.init()
06-02 17:50:53.365: D/CordovaWebView(29950): >>> loadUrl(file:///android_asset/www/index.html)
06-02 17:50:53.365: D/PluginManager(29950): init()
06-02 17:50:53.385: W/ContextImpl(29950): Failed to ensure directory: /storage/extSdCard/Android/data/files
06-02 17:50:53.385: W/ContextImpl(29950): Failed to ensure directory: /storage/extSdCard/Android/data/com.thousandheads.tvsizefinder/cache
06-02 17:50:53.385: D/CordovaWebView(29950): >>> loadUrlNow()
06-02 17:50:53.395: I/CordovaLog(29950): Changing log level to DEBUG(3)
06-02 17:50:53.395: I/CordovaLog(29950): Found start page location: index.html
06-02 17:50:53.395: D/Whitelist(29950): Unlimited access to network resources
06-02 17:50:53.395: D/CordovaActivity(29950): Resuming the App
06-02 17:50:53.395: D/CordovaActivity(29950): CB-3064: The errorUrl is null
06-02 17:50:53.415: D/SoftKeyboardDetect(29950): Ignore this event
06-02 17:50:53.465: D/SoftKeyboardDetect(29950): Ignore this event
06-02 17:50:53.485: D/CordovaActivity(29950): onMessage(onPageStarted,file:///android_asset/www/index.html)
06-02 17:50:53.535: E/AndroidProtocolHandler(29950): Unable to open asset URL: file:///android_asset/www/css/index.css
06-02 17:50:53.565: D/CordovaWebViewClient(29950): onPageFinished(file:///android_asset/www/index.html)
06-02 17:50:53.565: D/CordovaActivity(29950): onMessage(onPageFinished,file:///android_asset/www/index.html)
06-02 17:50:55.567: D/CordovaActivity(29950): onMessage(spinner,stop)
06-02 17:50:55.607: I/chromium(29950): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
06-02 17:50:55.657: I/chromium(29950): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported

@EddyVerbruggen
Copy link
Owner

Nope, I really need the project, sorry.

@marcsyp
Copy link

marcsyp commented Jun 2, 2014

In the past, where this sort of situation has arisen (not being able to
share a full project for the purposes of debugging), it can be helpful if
you can reproduce the error in a smaller, sample app, which can be shared.
I went through this process a few weeks ago, and it turned out that the
process of paring down the app to something manageable and shareable helped
me find the problem myself....

Just a thought.

Marc

On Mon, Jun 2, 2014 at 10:39 AM, Eddy Verbruggen notifications@github.com
wrote:

Nope, I really need the project, sorry.


Reply to this email directly or view it on GitHub
#126 (comment)
.

Marc Syp, Application Engineer
San Francisco, CA

WARNING: The information contained in this message is legally
privileged and proprietary information intended only for the use of
the individual or entity named above. If the reader of this message is
not the intended recipient, you are hereby notified that any
dissemination, distribution, or copy of this message is strictly
prohibited. If you have received this message in error, please
immediately delete the original message and notify the sender.
Communication of the information contained in this message to any
unauthorized persons may be a violation of state or federal laws.

@robertosobachi
Copy link

Hi,

I'm working on the same project and having the same issues when selecting Twitter and share. After sharing with Twitter the app crashes.

We are using Wikitude plugin together with Social Sharing.

The main index.html is using this code:

<script type="text/javascript" src="cordova.js"></script>
<script src="architect://architect.js"></script>
<script type="text/javascript">
var app = {

    initialize: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },

    actionsCalled: function(e) {
        e.preventDefault();
        e.stopPropagation();
    },

    onDeviceReady: function() {
        app.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
        app.wikitudePlugin.isDeviceSupported(app.onDeviceSupportedCallback, app.onDeviceNotSupportedCallback);
    },

    // Update DOM on a Received Event
    receivedEvent: function(id) {},
    onUrlInvoke: function(url) {
        if (url.indexOf('share') > -1) {
            var shareCallback = function(message) {
                console.log('success: ' + message);
            };

            window.plugins.socialsharing.share('Test Message', null, null, shareCallback, shareCallback);
        }
    },
    onDeviceSupportedCallback: function() {
        // setting callback functions that are called when the ARchitect World finished launching or failed.
        app.wikitudePlugin._onARchitectWorldLaunchedCallback = app.onARchitectWorldLaunched;
        app.wikitudePlugin._onARchitectWorldFailedLaunchingCallback = app.onARchitectWorldFailedLaunching;
        app.wikitudePlugin._augmentedRealityMode = "IR";
        app.wikitudePlugin.setOnUrlInvokeCallback(app.onUrlInvoke);
        app.wikitudePlugin.loadARchitectWorld('www/app/index.html');
    },

    onARchitectWorldLaunched: function() {},
    onARchitectWorldFailedLaunching: function() {},

    onDeviceNotSupportedCallback: function() {
        app.receivedEvent('Unable to launch ARchitect Worlds on this device');
    }
};

app.initialize();
</script>

The wikitude app has this simple code:

<script type="text/javascript"> $(function() { var shareClick = function(event) { event.preventDefault(); document.location = "architectsdk://button?action=share"; } $("#share-button").on("click", shareClick); }); </script>

@robertosobachi
Copy link

The wikitude app has this simple code:

$(function() {
    var shareClick = function(event) {
        event.preventDefault();
        document.location = "architectsdk://button?action=share";
    }

    $("#share-button").on("click", shareClick);
});

@EddyVerbruggen
Copy link
Owner

Hi, the only thing I see is the number of arguments for the share function is not correct in this line:

window.plugins.socialsharing.share('Test Message', null, null, shareCallback, shareCallback);

@robertosobachi
Copy link

Also using window.plugins.socialsharing.share('Test Message') creashes on Android, works on iOS

@robertosobachi
Copy link

I added a sample app with the SocialSharing plugin failing posting on Twitter: https://github.com/1000heads/SocialSharing-PhoneGap-Test

I'm only using window.plugins.socialsharing.share('Test Message'); on a Samsung Galaxy S4 without Memory card

@EddyVerbruggen
Copy link
Owner

So by failing with the testapp you mean it's crashing when sharing on your Galaxy S4?
Could you run 'adb logcat' and see what error pops up during the crash?

@sktniranjan
Copy link

This plugin used to share with installed social apps. I would like to share message with facebook and twitter whether installed or not in device. Is this possible?

@EddyVerbruggen
Copy link
Owner

You can share to FB and Twitter without installing the app on iOS, but you need to configure your accounts in the Settings app to be able to do so.

@robertosobachi
Copy link

@EddyVerbruggen I don't think there's any error popping up, the Twitter screen is closing and you're back on the icon screen. This is not happening on other devices I've tested.

@sktniranjan
Copy link

Thank you Eddy. Anyway i need to sign in to my facebook and twitter accounts in my device settings right?

I have few more questions:
I have installed facebook in my device, but i have not sign in facebook that is in Settings of device. How it will work? It should work with my facebook which is installed from app store right?

What about android? I think here i should install fb and twiiter apps in to my device? is it?

@EddyVerbruggen
Copy link
Owner

Android: you need the apps.

iOS: the apps are ignored. You need to configure them in the Settings app. If not, when using share, you will not see Twitter for example. If you use shareViaTwitter and don't have it configured in the Settings app, your user will be prompted to configure Twitter and if he clicks OK he is taken to the Settings app.

@EddyVerbruggen
Copy link
Owner

@robertosobachi I've been guessing the problem for a while but I can't do anything without debugging your entire project. Just too many variables at play.

Please try one thing on your side: wrap the call to socialsharing.share in a setTimeout of a second or so, maybe those plugins aren't playing nice together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants