从iOS应用程序打开Facebook Messenger

时间:2014-07-30 14:56:56

标签: ios facebook url text messenger

有谁知道如何使用预先填写的文字打开Facebook Messenger应用程序?

例如,要在指定用户处打开Messenger应用程序,您可以编写以下内容:

 NSURL *fbURL = [NSURL URLWithString:@"fb-messenger://user-thread/USER_ID"]; 
if ([[UIApplication sharedApplication] canOpenURL: fbURL]) {
    [[UIApplication sharedApplication] openURL: fbURL];
}

对于Whats应用程序非常简单:

NSURL *whatsappURL = [NSURL URLWithString:[NSString stringWithFormat:@"whatsapp://send?text=%@", @"String to post here"]];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
    [[UIApplication sharedApplication] openURL: whatsappURL];
}

2 个答案:

答案 0 :(得分:5)

有这样的功能,但它只存在于Facebook的SDK中。

看看这个 - https://developers.facebook.com/docs/ios/share#message-dialog

答案 1 :(得分:1)

快速4和5

 private void initRecyclerView() {

        MoreAdapter moreAdapter= new MoreAdapter(this);
        rvMoreItems.setLayoutManager(new LinearLayoutManager(this));
        rvMoreItems.setAdapter(moreAdapter);
        moreAdapter.setData(dataList);

    }
相关问题