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

前端 未结 3 2027
南笙
南笙 2021-01-25 20:01

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

相关标签:
3条回答
  • 2021-01-25 20:37

    You can use fb-messenger://share?link= or fb-messenger://share?text=

    0 讨论(0)
  • 2021-01-25 20:44

    I don´t think it´s possible - and after all the message always must be 100% user generated so it does not really make sense to attach any message.

    0 讨论(0)
  • 2021-01-25 20:57

    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.

    0 讨论(0)
提交回复
热议问题