When to ask user for registration

Our team is currently working on a gas station app. Thee are in-app purchases, so we need users to register.

When should we ask users to register with our app?

Our team has considered two options

  1. ask for registration right after a user opens the app for the first time;

  2. when a user opens the app for the first time, we show him a map with the nearest gas stations. We ask for registration only when he chooses the gas station he wants to get to.