Problem with page is loaded after login with gmail

I’m developing a native app and I’m using the states configuration let’s say for navigation between groups.

First of all I show in the index a group to login with gmail.

This is the workflow:

image

As you can see, when I click on the gmail logo the browser redirects to choose the gmail account to log in with and when I go back to my bubble app it first shows me the group which matches the default status.

Then it does change the status and shows the other group. But it looks pretty bad for the user.

Could you help me?

Thank you very much

1 Like

Best thing to do is not use states, use URL navigation querystrings that store data, for example yourapp.com?group=login then show the login group when the group is set to login.

Then, set a Callback URL for Google login (the url that Google takes you back to when it’s completed sign in, I think you find this either in the plugin or in your Google dev account) and set it to something like yourapp.com?group=success and then have a condition on the logged in group (maybe your dashboard or something) that shows itself only when the ?group= value is success.

That way only the right groups will appear and no incorrect groups will show as they are not set to show on page load.

In the example about, ‘group’, ‘success’ and ‘login’ can be anything you like, you just need them to tell other groups when to hide/show themselves.

Make sure by default all groups have ‘Visible on page load’ unchecked.

Hope that helps

1 Like

Thanks

But I read ( bubble even warns me in the issues ) that it is not recommended to use URL navigation in native apps.

The problem itself is the home page where the registration/login is done which is the group that I set when loading, I can not remove the default option because otherwise when starting the app would not see anything.

The warning is not to use url navigation that causes you to change the page. There is another form of url navigation, which uses page parameters on a single page, and where Bubble does not actually reload the page, that is fine for SPAs. Search the forum for url routing, parameters, slugs, etc to see how it’s done

2 Likes

I don’t mean navigating to other pages - just querystrings in the current page URL, there is nothing wrong with that aproach

hi do you know where to set the callback url within bubble?