小编Den*_*ean的帖子

从iOS应用程序打开Facebook Messenger

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

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

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

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

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

url text facebook ios messenger

10
推荐指数
1
解决办法
9053
查看次数

标签 统计

facebook ×1

ios ×1

messenger ×1

text ×1

url ×1