简体   繁体   中英

how to send a message to facebook messenger using url scheme?

Is it possible to send a message to the facebook messenger using url scheme? after searching for schemes I found that messenger opens using fb://messaging/ does anybody know how to attach a message?(without attaching specific userId)

ex: twitter://post?message=hello

you should try this

    Intent sendIntent = new Intent();
    sendIntent.setAction(Intent.ACTION_SEND);
    sendIntent.putExtra(Intent.EXTRA_TEXT, "Your message");
    sendIntent.setType("text/plain");
    sendIntent.setPackage("com.facebook.orca");

    try {
        startActivity(sendIntent);
    } catch (android.content.ActivityNotFoundException ex) {
        ToastHelper.show(this, "Please Install Facebook Messenger");
    }

It will open Facebook Messenger app, select a friend and the message will be send.

我认为这是不可能的-毕竟,消息始终必须是100%用户生成的,因此附加任何消息都没有任何意义。

您可以使用fb-messenger://share?link=fb-messenger://share?text=

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM