Thi*_*oyd 5 javascript facebook facebook-sharer ipad facebook-graph-api
从我在iPad上的混合应用程序中,只要用户点击相应的按钮,我就想通过FB和Twitter分享某些URL.这是我为twitter做的(有效):
shareStyleOnTwitter : function(styleId, title) {
var httpUrl = 'twitter://post?message=';
var url = 'www.mywebsite.com/'+styleId;
var params = 'Check out '+title+' on #mywebsite '+url;
window.location = httpUrl+encodeURIComponent(params);
}
Run Code Online (Sandbox Code Playgroud)
这将打开一个Twitter应用程序,其中包含一个带有消息的帖子对话框窗口.用户只需点击"推文"按钮即可发布.
我使用的功能是FB(不起作用):
shareStyleOnFB : function(styleId, title, imageUrl){
var httpUrl = 'fb://publish/profile/#me?text=';
var params = 'www.mywebsite.com/'+styleId;
console.log(httpUrl+encodeURIComponent(params));
window.location = httpUrl+encodeURIComponent(params);
},
Run Code Online (Sandbox Code Playgroud)
这会打开一个带有我的Feed的FB应用程序,但没有带有消息的共享/发布/状态窗口.
我从这些主题中采纳了这些想法:
Facebook iPhone应用程序支持的所有自定义URL方案是什么?
如何使用iOS上的原生Twitter应用程序打开Twitter推文?
有人能告诉我FB URL方案有什么问题吗?
归档时间: |
|
查看次数: |
982 次 |
最近记录: |