When I read the doc of app invite (https://firebase.google.com/docs/invites/android) they say that to Receive invitations
The code above requires a connected GoogleApiClient with AppInvite.API enabled.
but i have no idea how to do this ...
Take a look at the Firebase Invites Quickstart project.
There is also general information in the Guide for Accessing Google APIs.