Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using an out-of-app browser #142

Open
MarkusUlbricht opened this issue Nov 18, 2020 · 0 comments
Open

Using an out-of-app browser #142

MarkusUlbricht opened this issue Nov 18, 2020 · 0 comments

Comments

@MarkusUlbricht
Copy link

Which platform(s) does your issue occur on?

  • Android

Please, provide the following version numbers that your issue occurs with:

  • CLI: 6.3.3

  • Cross-platform modules: 6.5.21

  • Runtime(s):

    "nativescript": {
    "id": "org.nativescript.DemoAuthTest",
    "tns-android": {
    "version": "6.5.0"
    },
    "tns-ios": {
    "version": "6.5.0"
    }
    },
    "description": "NativeScript Application",
    "license": "SEE LICENSE IN ",
    "repository": "",
    "dependencies": {
    "@nativescript/theme": "~2.3.0",
    "nativescript-oauth2": "^3.0.1",
    "nativescript-vue": "~2.4.0",
    "tns-core-modules": "~6.5.0"
    },
    "devDependencies": {
    "@babel/core": "~7.1.0",
    "@babel/preset-env": "~7.1.0",
    "babel-loader": "~8.0.0",
    "nativescript-dev-webpack": "~1.5.0",
    "nativescript-vue-template-compiler": "~2.4.0",
    "node-sass": "^4.7.1",
    "vue-loader": "~15.4.0"
    },

Please, tell us how to recreate the issue in as much detail as possible.

I am very new to nativescript and I am using nativescript vue and try to configure ouath2 in a way that the login works via an out-of-app browser.

According to the documentation, the following two steps should achieve the out-of-app browser bevavior for Android: In the AndroidManifest.xml,
"Find the section named com.tns.NativeScriptActivity and add the attribute android:launchMode='singleTask' "
"inside the activity add a new section with your custom url scheme(s)."

In order to keep it simple, I tried to figure it out with the vue-demo and I did copy&paste with the instructions, so the activity section in my AndroidManifest looks as follows:

	<activity
		android:name="com.tns.NativeScriptActivity"
		android:launchMode="singleTask"
		android:label="@string/title_activity_kimera"
		android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
		android:theme="@style/LaunchScreenTheme">

		<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

		<intent-filter>
			<action android:name="android.intent.action.MAIN" />
			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>

		<intent-filter>
			<action android:name="android.intent.action.VIEW"/>
			<category android:name="android.intent.category.DEFAULT" />
			<category android:name="android.intent.category.BROWSABLE" />
			<!-- Custom URL Schemes -->
			<data android:scheme="com.googleusercontent.apps.932931520457-buv2dnhgo7jjjjv5fckqltn367psbrlb"/>
			<data android:scheme="msalf376fa87-64a9-89a1-8b56-e0d48fc08107"/>
		</intent-filter>
	</activity>

Even after the modifications to the AndroidManifest.xml, the login page is shown via an in-app web view, and not via an out-of-app browser. Does anybody know how to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant