Patch of #155 , since the PR was merged it bit to early. Anyway, thanks @viezel !
Demo:
var Social = require("dk.napp.social");
var win = Ti.UI.createWindow({
backgroundColor : "#fff",
title: "Social Module"
});
var btn = Ti.UI.createButton({
title : "Share"
});
btn.addEventListener("click", showActivityPopover);
function showActivityPopover() {
if (Social.isActivityViewSupported()) {
Social.activityPopover({
text : "Share Image",
subject : "Share Image",
view : btn
});
}
}
var nav = Ti.UI.iOS.createNavigationWindow({
window : win
});
win.setRightNavButton(btn);
nav.open();
// -- Use Case 1) Button in window
// win.add(btn);
// win.open();
// -- Use Case 2) Button in navigationBar
var nav = Ti.UI.iOS.createNavigationWindow({
window: win
});
win.setRightNavButton(btn);
nav.open();
Patch of #155 , since the PR was merged it bit to early. Anyway, thanks @viezel !
Demo: