...you can use the new
in-app review API.
The only potential problem that I can think of is that API gives total control over to google and google uses some algorithm to decide when to prompt the user or not. Meaning it's not guaranteed that calling the api will definitely cause a rating prompt to be displayed to the user.
I believe google suggests that your app should call this api on a regular basis, and google will eventually decide when its time to prompt the user. And after it prompts the user and they either select a rating or select "Don't ask me again", it sets some flag to indicate never prompt the user again (so your app can continue to keep calling the API without worry that it's bothering the user).
I even think I remember reading that google specifically prohibits calling their api if:
1) After asking the user how they would rate your app, and then only calling the API if it's a high number.
2) Telling the user to "Please make sure you leave us a high rating on the next screen" right before calling the API.
However, I feel using the API in a specific way can still be beneficial vs. your own built-in ratings bar because if you use your own rating bar then send the user over to the playstore to leave the actual rating, this would result in a TWO step process in which the user has to rate your app twice, once in your app, then again in the playstore. Which is not a good UX.
So, what I would probably do is configure my app to not have any built-in ratings bar, and also initially not call the google API. My app would instead count the number of times the user runs my app. Then when the count gets to something significant, like 100, then I'll trigger my app to start calling the google api on a regular basis. This way, by waiting until the user runs my app 100 times, I can sort of be confident that they like the app because they keep using it
And then at some point, with my app keep calling the google api, it will result in google's ratingbar appearing and the user will then only have to rate the app once.
Alternatively, if you want total control of when the prompt will appear to the user, you could "wait until 100 runs", then use
Filippo's routine to see if they already left a review, and if not, then prompt them if they want to and then send them to the store page to do so.