I developed a medical app to enable user send health reports to four different people using Gmail Rest API. When the mail is sent, it redirects to permission page. when the permission page was clicked, it redirects back to Google website not the app and the mail does not send.
What do I do?
Based on the infos you provided (nearly zero) it is hard do answer/help.
I just tried the gmail rest api example. I configured a new client in the google console, i added gmail api to this client, i ran the example.
It opens the permission website from google, i accepted access, the website closed and i got back to my app. The mail ist then send.
If it does not redirect to your app then you probably used the wrong client type in the google console. Did you added a Android client and also added your SHA1 and the correct packagename to this?
You dont need to create a new project but it is mandatory that you create a new OAuth2 Android Client in the console for your project.