pwa-builder / PWABuilder

The simplest way to create progressive web apps across platforms and devices. Start here. This repo is home to several projects in the PWABuilder family of tools.
https://docs.pwabuilder.com
Other
2.71k stars 280 forks source link

[BUG] After login with Google OAuth app opens in-app browser rather than the application on IOS #4816

Closed aysegulkavaklii closed 1 week ago

aysegulkavaklii commented 2 weeks ago

What happened?

After the Google OAuth page opened in the in-app browser and a successful login was completed, Google redirected the user to api.metamax.com.tr, and then our API redirected the user to pwa.metamax.com.tr, which is the application domain. However, the user continued to stay in the in-app browser rather than being redirected to the application. This issue only occurs on iOS; there are no problems on Android or the web. Simulator Screenshot - iPhone 15 Pro - 2024-09-19 at 13 41 41

After some research, I added Universal Links. My apple-app-site-association file is accessible at https://metamax.com.tr/.well-known/apple-app-site-association.

I configured associated domains in Xcode as follows: applinks .metamax.com.tr.

Am I missing something or doing something wrong?

How do we reproduce the behavior?

  1. Download the applicationhttps://apps.apple.com/tr/app/metamax/id6526502933?l=tr
  2. Try to login with google

What do you expect to happen?

When google OAuth page is opened in a in-app browser, once the user is done using it, the passed redirect_uri should be opened in the native app.

What environment were you using?

Platfrom: IOS

Additional context

No response

maiconcarraro commented 2 weeks ago

@aysegulkavaklii pretty sure all redirect chain must be added to the WKAppBoundDomains see https://github.com/pwa-builder/PWABuilder/issues/4672#issuecomment-1973631146

and you can't add as wildcard, would be better to debug this from your xcode since it provides the information on xcode logs, sharing the xcode logs the community can help you better 😊

aysegulkavaklii commented 1 week ago

https://github.com/pwa-builder/PWABuilder/issues/4672#issuecomment-2303358702 adding authOrigins ["accounts.google.com","api.metamax.com.tr","accounts.youtube.com"] to Settings.swift file solved my problem. Thanks a lot!

maiconcarraro commented 1 week ago

@aysegulkavaklii awesome, you can also add the permitted URLs before downloading image

if solved, you can close this, thank you!

jgw96 commented 1 week ago

I am going to close this for now as it sounds like its solved. Thanks @maiconcarraro !