Giter Club home page Giter Club logo

nativescript-urlhandler's Introduction

NativeScript URL Handler Plugin

NOT MAINTAINED ANYMORE, use this plugin.

nativescript-urlhandler's People

Contributors

dannyfeliz avatar greenkeeper[bot] avatar hypery2k avatar kaisten avatar mitko-kerezov avatar mn-martin avatar one-adam-nolan avatar shuunen avatar speigg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nativescript-urlhandler's Issues

apple-app-site-association / applinks

Does this plugin work with applinks (apple-app-site-association).

I have my app loading with myapp:// and your plugin works perfectly.

I'm really struggling to find anything on the internet as to how to find out what deep link opened the app.

Hopefully I'm not wasting your time with this questions and you might know of something.

Android, Not redirecting to app after login in mobile browser(MIC Login)

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the version "nativescript-urlhandler": "^1.3.0",

Current Behavior

I have done all the configurations given for android:

added android:launchMode="singleTask" to main activity
added intent filter





Expected Behavior

When doing login , app navigates to mobile browser, after success login it should redirect back to app.

Failure Information

Not redirecting back to app

Steps to Reproduce

  1. install "nativescript-urlhandler": "^1.3.0" in Nativescript angular code sharing project
  2. Add the configurations given in this plugin homepage.
  3. run the app using tns run android
  4. Click on login button it will redirect to browser, after login we should be navigated back to app.
  5. Not navigating back to app.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

NativeScript version:
Java version:
NodeJS and NPM version:
Platform(s) running:

Demo Project

ℹ Please link to or upload a project we can download that reproduces the issue.

Failure Logs


Plugin fails to load for Vue project

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository

Current Behavior

Following the instructions but plugin fails to load and reports error

Expected Behavior

The plugin should load and fire during app startup

Failure Information

Added the plugin as follows: tns plugin add nativescript-urlhandler
package.json says: "nativescript-urlhandler": "^1.3.0",

This is my app.js:

import Vue from 'nativescript-vue'
import RadSideDrawer from 'nativescript-ui-sidedrawer/vue'
Vue.use(RadSideDrawer)

import { handleOpenURL } from "nativescript-urlhandler" // .handleOpenURL;
import App from './components/App'

Vue.config.silent = !__DEV__

new Vue({
  render: h => h(App),
  created() {
    // handleOpenURL(url) => { console.log('handleOpenUrl', url) }
    handleOpenURL(function(appURL) {
      console.log('Got the following appURL', appURL);
    });
}
}).$start()

Can't start the app:

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. create a new project
  2. add the plugin
  3. use the app.js from above

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

NativeScript version: nativescript/core 8.3.0
Java version: n/a
NodeJS and NPM version: Tried on node 16 and node 18
Platform(s) running: Xcode Version 13.4.1 (13F100)

Demo Project

ℹ Please link to or upload a project we can download that reproduces the issue.
https://github.com/dcolley/ns-vue-urlhandler

Failure Logs

$ ns run ios

ERROR in ./app/app.js 6:0-55
Module not found: Error: Can't resolve 'nativescript-urlhandler' in '/Users/derek/demoproj/example-app2/app'
resolve 'nativescript-urlhandler' in '/Users/derek/demoproj/example-app2/app'
  Parsed request is a module
  using description file: /Users/derek/demoproj/example-app2/package.json (relative path: ./app)
    resolve as module
      looking for modules in /Users/derek/demoproj/example-app2/node_modules
        single file module
          using description file: /Users/derek/demoproj/example-app2/package.json (relative path: ./node_modules/nativescript-urlhandler)
            no extension
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler doesn't exist
            .ios.vue
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.vue doesn't exist
            .vue
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.vue doesn't exist
            .ios.ts
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.ts doesn't exist
            .ts
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ts doesn't exist
            .ios.js
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.js doesn't exist
            .js
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.js doesn't exist
            .ios.mjs
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.mjs doesn't exist
            .mjs
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.mjs doesn't exist
            .ios.css
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.css doesn't exist
            .css
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.css doesn't exist
            .ios.scss
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.scss doesn't exist
            .scss
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.scss doesn't exist
            .ios.json
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.json doesn't exist
            .json
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.json doesn't exist
        /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler doesn't exist
      /Users/derek/demoproj/example-app2/app/node_modules doesn't exist or is not a directory
      looking for modules in /Users/derek/demoproj/example-app2/node_modules
        single file module
          using description file: /Users/derek/demoproj/example-app2/package.json (relative path: ./node_modules/nativescript-urlhandler)
            no extension
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler doesn't exist
            .ios.vue
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.vue doesn't exist
            .vue
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.vue doesn't exist
            .ios.ts
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.ts doesn't exist
            .ts
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ts doesn't exist
            .ios.js
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.js doesn't exist
            .js
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.js doesn't exist
            .ios.mjs
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.mjs doesn't exist
            .mjs
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.mjs doesn't exist
            .ios.css
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.css doesn't exist
            .css
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.css doesn't exist
            .ios.scss
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.scss doesn't exist
            .scss
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.scss doesn't exist
            .ios.json
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.ios.json doesn't exist
            .json
              /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler.json doesn't exist
        /Users/derek/demoproj/example-app2/node_modules/nativescript-urlhandler doesn't exist
      /Users/derek/demoproj/node_modules doesn't exist or is not a directory
      /Users/derek/metaspan/node_modules doesn't exist or is not a directory
      /Users/derek/node_modules doesn't exist or is not a directory
      /Users/derek/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory

webpack 5.74.0 compiled with 1 error in 222 ms
Webpack compilation complete. Watching for file changes.

Angular: No callback provided

Following the setup guide, setting up the handler in the application component seemed to be too late, receiving: No callback provided. Please ensure that you called "handleOpenURL" during application init!

I tried to look at the angular-demo but couldn't find any mention of handleOpenUrl. Is that just an unfinished place holder at the moment or was there something I missed?

Adding the handler in main.ts seemed to log the expected results but it is not the ideal place to have it.

Up to date documentation for NS cli 6 and web URLs

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Changes

There is no documentation on how to setup app links for web urls. If I have a website and an app I would like to use this package to enable links to my website to open the user's app if it's installed according to the Android app links tutorial.

However, they use some assistant tool from Android Studio and it is not clear how we can set this up for ourselves using nativescript with Vue, Angular or React and this package. The current demo is also outdated it seems as the AndroidManifest does not have the autoVerify attribute on the intent-filter and is not supported for NativeScript cli 6

I would like to see an up to date chapter and demo using web urls instead of the current demo://test scheme which is not useful when wanting to link to a website.

applicationOpenURLSourceApplicationAnnotation is deprecated

applicationOpenURLSourceApplicationAnnotation is deprecated, and doesn't get called when the app is launched from a url (only if the app is already running). application:openURL:options: gets called in both situations, and should be used instead.

The plugin doesn't work on iOS

Hello

What did you do?

I installed the plugin successfully then created my own URL Scheme. When I type my own URL Scheme in a browser, it goes to the app correctly but handleOpenURL method is not called and I can't get anything.

What did you expect to happen?

I expected, handleOpenURL ran and I can get the App URL in App Component.

What happened instead?

The method,handleOpenURL, was not raised.

Your Environment

NativeScript version: 5.4.0
Java version:
NodeJS and NPM version: NodeJS: v8.9.1
Platform(s) running: iPhone 6s iOS 12.3.1

Demo Project

N/A

app.component

import { Component, OnInit } from "@angular/core";
import { NavigationEnd, Router } from "@angular/router";
import { AppURL, handleOpenURL } from "nativescript-urlhandler";

@Component({
    moduleId: module.id,
    selector: "ns-app",
    templateUrl: "app.component.html",
})

export class AppComponent implements OnInit {
    constructor(
        private router: Router,
    ) {}

    public ngOnInit() {
        handleOpenURL((appURL: AppURL) => {
            console.log("Got the following appURL", appURL);
        });
    }
 }

Android NS 5.4 does not work with android:host="__PACKAGE__" in Manifest

Using version 1.3.0 of nativescript-urlhandler

Just a PSA, for whatever reason the plugin did not seem to work with Android when android:host="__PACKAGE__" was included in the AndroidManifest along with the scheme. Removing that particular piece fixes the issue.

Copy of the working element

	<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme">

		<activity android:name="com.tns.NativeScriptActivity" ... android:launchMode="singleTask">

			<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" />
<!---- Here ----->              <data android:scheme="myappscheme" />  
			</intent-filter>
		</activity>

		<activity android:name="com.tns.ErrorReportActivity" />
	</application>

handleOpenURL is called each time that the application is resumed

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository

Current Behavior

Function handleOpenURL is called each time that the application is resumed (goes to front) with the latest deeplink consumed.

Expected Behavior

Function handleOpenURL would be called only when the deeplink is used to bring the app to front.

Failure Information

I am trying to setup a redirection to a certain page after the deeplink is clicked on. It works just fine, but when I navigate away from the deeplinked page, next time the application is resumed I get redirected back to the deeplinked page again. Looks like handleOpenURL memorizes the last used deeplink and calls the callback with it everytime the app is brought to front.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  ngOnInit() {
    console.log('Initializing app component');

    handleOpenURL((appUrl: AppURL) => {
      console.log('Opening deeplink', appUrl.path, JSON.stringify(Array.from(appUrl.params.entries())
        .reduce((object, [key, value]) => {
          object[key] = value;
          return object;
        }, {})
      ));
      return this.zone.run(() => {
        switch (appUrl.path) {
          case 'abc':
            return this.routerExtensions.navigate([
              'abc/' + appUrl.params.get('def') + '/' + appUrl.params.get('xyz')
            ], {clearHistory: true}).then(() => console.log('App :: Navigating to abc'));
          case  'xyz':
            return this.routerExtensions.navigate([
              'xyz/' + appUrl.params.get('abc')
            ], {clearHistory: true}).then(() => console.log('App :: Navigating to xyz'));
          default:
            return this.routerExtensions.navigate([
              'home'
            ], {clearHistory: true}).then(() => console.log('App :: Navigating to home'));
        }
      });
    });
}

Context

NativeScript version: 5.1.0
Java version: 1.8.0_211
NodeJS and NPM version: v8.11.4 and 6.10.1
Platform(s) running: Android

Demo Project

ℹ None...

Failure Logs

JS: Opening deeplink xyz {"abc":"123"}
JS: App :: Navigating to xyz

Add support for NativeScript 8+

Do you have any plans to add support for NativeScript 8 ? Currently I always have to go to node_nodules and change require("application") to require("@nativescript/core/application")

Intent-Action not matching

        if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) {
...
        }
new String(intent.getAction()).valueOf()
"android.intent.action.VIEW"
new String(android.content.Intent.ACTION_VIEW).valueOf()
"android.intent.action.MAIN"

Empty URL parameters on Android

Versions:
"tns-core-modules": "2.5.2",
"tns-android": "version": "3.0.0-rc.1"

When testing on emulator appURL.params is an empty map.
adb shell am start -W -a android.intent.action.VIEW -d "myApp://mobile?recoveryToken=22\&[email protected]"

This is my AndroidManifest.xml

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="myApp"
            android:host="mobile" />
    </intent-filter>

I managed to get it working by changing urlhandler.common.js into this:

function extractAppURL(urlParam) {
    if (!!urlParam) {
        var url_1 = urlParam.toString(), params = {}, urlWithPath = url_1.indexOf('//') < url_1.length - 2, urlWithParams = url_1.indexOf('?') !== -1, path = urlWithPath ? url_1.substring(url_1.indexOf('//') + 2, urlWithParams ? url_1.indexOf('?') : url_1.length) : null, parameters = url_1.substring(url_1.indexOf('?') + 1).split('&');
        // create JSON object
        if (urlWithParams) {
            for (var i = 0, len = parameters.length; i < len; i++) {
                var paramData = parameters[i].split('=');
                params[paramData[0]] = paramData[1] ? paramData[1] : null;
            }
        }

Unexpect token import in tns_modules/nativescript-urlhandler/urlhandler.js

import * as application from 'application';
import { getCallback, extractAppURL } from './urlhandler.common';
export { handleOpenURL } from './urlhandler.common';
var lastReceivedData = null;
application.android.on(application.AndroidApplication.activityResumedEvent, function (args) {
    var data = args.activity.getIntent().getData();
    if (data !== lastReceivedData) {
        try {
            if (new String(args.activity.getIntent().getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) {
                getCallback()(extractAppURL(data));
                lastReceivedData = data;
            }
        }
        catch (e) {
            console.error('Unknown error during getting App URL data', e);
        }
    }
});

I am very new to typescript but i think that with a target of es5 those import statements should be require statements. I think

App URL doesn't work on Android

Hi Martin,

First of all, thank you for sharing this plug-in. I have implemented it successfully in IOS. However, I couldn't make it work on Android. Then, I tried your demo app and got the same result. It only works on IOS.

Thanks in advance for your support.

OS --> Mac

NativeScript version:
4.2.4

Java version:
1.8.0_181-b13

NodeJS and NPM version:
10.10 / 6.4.1

Platform(s) running:
IOS -> Runs fine on Emulator
Android -> Fails on Emulator

Demo Project

The Demo project in this repo

I always get blank component page when I call router.navigateByUrl() in handleOpenURL()?

What did you do?

I try to call router.navigateByUrl('targetComponent') in handleOpenURL(), but I always got a blank component page without console log.

What did you expect to happen?

I can get the appURL in handleOpenURL() and I would like to navigate to some target router with some console log for the target component initialization.

What happened instead?

I just got a blank component page with back button in the header. If I click the back button, it will go to the entry component with all console log which should print out during the target component life cycle.

Your Environment

NativeScript version: 3.3.0-2017-10-16-9974
Java version: 1.8.0_144
NodeJS and NPM version: 7.4.0 and 4.0.5
Platform(s) running: Android

Demo Project

N/A

An in-range update of tns-core-modules is breaking the build 🚨

Version 3.0.1 of tns-core-modules just got published.

Branch Build failing 🚨
Dependency tns-core-modules
Current Version 3.0.0
Type peerDependency

This version is covered by your current version range and after updating it in your project the build failed.

As tns-core-modules is “only” a peerDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • greenkeeper/verify Greenkeeper verified pull request Details
  • continuous-integration/travis-ci/pr The Travis CI build is in progress Details
  • continuous-integration/travis-ci/push The Travis CI build passed Details
  • continuous-integration/jenkins/branch This commit cannot be built Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

URLSchemas work, but the url is not passed to the function

It doesn't seem that the function handleOpenUrl is ever fired.

I have tried in my main-page.js:

handleOpenURL(function(appURL) {
	console.log("Hello " + appURL);
});

But nothing happens and no error is giving.

Is there a demo app for this project?

Empty params

I'm catching the following link: https://myapp.it/test/redirectPage.html?itemType='xxx' with the following code:
handleOpenURL((appURL: AppURL) => { console.log(JSON.stringify(appURL.params['itemType'])); });

but params is an empty object, and appURL.path doesn't contain the params (it is: myapp.it/test/redirectPage.html)

This is AndroidManifest configuration:

<data android:scheme="https" android:host="myapp.test.com" android:pathPrefix="/manager" />

Callback handling issue on iOS

What did you do?

I've installed the plugin to handle the URL sent from a Share Extension to my main app. I've placed the handleUrl() function in the app.component.ts inside ngOnInit() so I can use other Angular components for the callback.

What did you expect to happen?

I was expecting that when receiving the URL from the share extension, the callback function will be called.

What happened instead?

However, when the app is resumed this works fine but when the app it's closed and opened using the URL the callback is not defined. I believe this happens because the bootstrapping for the angular happens after the call of "didFinishLaunchingWithOptions()" so the callback is not yet defined.

Your Environment

NativeScript version: 4.0.0
Java version: -
NodeJS and NPM version: node v8.11.1, npm v5.6.0
Platform(s) running: macOS, iOS

Documentation is not enough the call back is never called.

I have followed the directions exactly. but the urlHandler never fires. I am running into this issue

NativeScript/NativeScript#3738

i have followed the directions above to cextend the native script activity but It precludes using your handler witch i really like because it helps pars the url and will work on ios. I tried adding

protected onNewIntent(intent: android.content.Intent): void {
	super.onNewIntent(intent) 
        this.setIntent(intent); 
}

instead of

protected onNewIntent(intent: android.content.Intent): void {
	super.onNewIntent(intent)
	if (intent.getDataString) {
		let data = intent.getDataString()
		if (data) {
			console.log('data', data)
		}
	}
}

This solves the issue and i can use your plugin without issue unfortunately this seems to break the ActionBar -> ActionItem click event i am not sure why

have you run into these issues using your plugin? am i missing something. I would really appreciate your help.

Callback never called on iOS

Hi ! I tried to use this plugin for my deep links. On ANdroid no problem, it's work. But on iOS the callback is never called. I followed the instructions : change Info.plist, call handleOpenURL into the app.component.ts (into ngOnInit).

Did I miss something ?

callback only called when app wasn't running

I have the following intent-filter:

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

			<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>
				<data android:scheme="https" android:host="some.hostname.com" />
				<action android:name="android.intent.action.VIEW" />
				<category android:name="android.intent.category.DEFAULT" />
				<category android:name="android.intent.category.BROWSABLE" />
			</intent-filter>
		</activity>

and a handleOpenURL(...) call in the AppModule constructor. It works wonderfully, but only the first time a link is clicked, triggering the app to load up. If the app was already running when the link is clicked, it's brought to foreground, but the callback for handleOpenURL isn't called.

Am I missing something or is this a bug?

Unable to open URL

Edit - not an issue... issue was me... I needed to add config to app/App_Resources/iOS... I was adding to the generated plist... sorry

Callback sometimes not called

CLOSED because the problem was not related to this plugin.

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository

Current Behavior

Using oauth plugin for logging in, I have the redirect url to my url scheme.
Sometimes it works and the callback function is called, but sometime it doesn't work. I always see the url called in the log (I guess it's the plugin that print it?) but sometimes the callback is not called.

Failure Information

app.component.ts:

import { Component } from "@angular/core";
import { handleOpenURL, AppURL } from 'nativescript-urlhandler';
import * as querystring from "querystring";
import { User  } from "./model/users/user";
import { AuthenticationService  } from "./services/auth.service";
import { Route, Router } from "@angular/router";
import * as moment from 'moment';
import {exit} from 'nativescript-exit';

@Component({
    selector: "ns-app",
    moduleId: module.id,
    templateUrl: "./app.component.html"
})
export class AppComponent { 

    constructor(
        private authenticationService: AuthenticationService,
        private router: Router
    ) {}

    ngOnInit(){
        handleOpenURL((appURL: AppURL) => {
            if(!appURL) return;
            let auth = querystring.parse(appURL.path);
            let u = new User();
            console.log(JSON.stringify(auth));
            u.token = auth.access_token;
            let expiration = moment();
            expiration.add(parseInt(auth.expires_in), "seconds");
            u.tokenExpiration = expiration;
            this.authenticationService.setUser(u);
            this.router.navigate(['']);
        });
    }
}

Url scheme in Android Manifest:

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

			<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" />
                <data android:host="auth" android:scheme="ed" />
            </intent-filter>
		</activity>

In console, after the app reopen and the browser closes itself, I see this:
JS: ed://auth/#code=bbd0cf23047fc66e813c96...........
That should be the url that trigger the callback function.

Thanks in advance, I searched everywhere but without solutions...

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

NativeScript version: 5.4.0
Java version: javac 11.0.3
NodeJS and NPM version: Node v8.10.0 - Npm 3.5.2
Platform(s) running: Android

Relative Path Interpretation Issues

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository

Current Behavior

Currently there is no opportunity to interpret the relative path passed via the URL scheme.

I.E. exampleApp://comments/1

Expected Behavior

The plugin should return the relative path of the URL scheme inside the promise so that the app may navigate to the appropriate intended route.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

NativeScript version:
Java version:
NodeJS and NPM version:
Platform(s) running:

"nativescript-urlhandler": "^1.3.0",
"nativescript-vue": "^2.4.0",
  "nativescript": {
    "id": "example.app.name",
    "tns-android": {
      "version": "6.3.1"
    },
    "tns-ios": {
      "version": "6.3.0"
    }
  },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.