Okta authentication sdk for o365 teams app

we developed custom teams app. we created a oidc web application with implicit (hybrid) grant type on okta and the custom teams app is using the the javascript sdk. The returned access token is used in downstream service call.

It works when the custom application is run on teams web application.

When the custom application runs on the teams desktop client, the authClient.token.getWithPopup opened a new browser window. Once credential is submitted, the token is not returned to the teams custom app runs on the teams desktop client and the custom app shows process in progress and get stuck waiting for authentication

Is the implementation for custom teams app need to be tailored for the target teams clients, i.e. teams web app vs teams desktop client? For custom teams app run on teams desktop client, does the corresponding oidc application should be configured as native app and different sdk to be used? If we want to deploy to mobile, do we need another implementation of the custom app using sdk specific for ios as well?