viezel / TiSocial.Framework

iOS6+ Social.Framework. Appcelerator apps are able to share content to Facebook and Twitter.
MIT License
259 stars 102 forks source link

Callback or addEventListener("cutomActivity", function(){}); not working for customActivity #169

Open Niral2110 opened 6 years ago

Niral2110 commented 6 years ago

I am using module 1.8.4 with SDK 6.1.1.GA Here I am facing an issue with customActivity callback. Even I am not able to get "customActivity" event fired on tap of customButton. Code being used is as following.

var downloadButton = {
    title: "Download",
    type: "Download",
    image: "images/download.png",
    callback: function() {
       console.log("This is a customActivity to download report ");
    }
};
customButtons.push(downloadButton);

Social.addEventListener("complete", function(e) {
    Alloy.Globals.eventListenerAdded = true;
    console.log("complete: ");
    console.log(e);
    if (e.platform == "activityView" || e.platform == "activityPopover") {
        switch (e.activity) {
            case Social.ACTIVITY_TWITTER:
                console.log("User is shared on Twitter");
                break;
            case Social.ACTIVITY_CUSTOM:
                console.log("This is a customActivity: " + e.activityName);
                break;
        }
    }
});
Social.addEventListener("customActivity", function(e) {
    console.log("customActivity:");
    console.log(e);
});

not able to get response in any of the above catches for customActivity. Is there anything I am doing wrong ?