equivalent to android's share intent concept for iPhone using titanium?

人走茶凉 提交于 2019-12-24 16:22:49

问题


I want to add share content functionality in my iOS app. I am developing an app in titanium for iPhone. I want to add a share button that when a user clicks will open a dialog box contains many different option like Facebook, twitter, email , and print.


回答1:


Unless this has been included in the Appcelerator Framework, you are going to have to write a module

"Share Screen" iOS 6




回答2:


There is a module for this that wraps the Social.framework on iOS. Ive used it in my own apps and its quite nice. Find it here.

And a small example of how to make it work.

        var Social = require('com.0x82.social');
        Social.showActivityItems({
            activityItems : ["http://stackoverflow.com"]
        });
        Social.addEventListener('activityWindowClosed', function(e) {
            if (e.completed) {
                alert('Shared successfully');
            }
        });


来源:https://stackoverflow.com/questions/17440935/equivalent-to-androids-share-intent-concept-for-iphone-using-titanium

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!