Apple’s app review is flawed – when users delete an app, it ask to rate. But if users like an app, it does not ask to rate. That is bias.
If a user did not delete your app, it should not be a worthless app and should have a positive review. As a developer, we should prompt users to rate and comment an app after using it a number of times.
What we can do is to detect that the app has started a number of times, and show a polite prompt to the user to ask him to rate the app. If user choose to rate the app, he will be redirected to App Store to rate and comment.
I am not directly providing the code to do that, as Arashpayan has done that excellently.