I want to make a custom share menu on which apps stuff can be shared and add some custom options.
I don't like the standard createchooser because apparently nobody knows how to customize this crap: Android - ShareActionProvider Share Menu add particular option
So what would be the code to send text to facebook or any other particular app?
You'd have to implement SDKs provided by each app that you want to share with.
E.g. here's Facebook's Sharing SDK
In this way, you would limit which applications users can share with, to those that you've integrated. This isn't what you want, you should continue using Android's ShareActionProvider as that flips the dependency around, to where third-party apps implement sharing, and you just talk to the Android Sharing API.