Giter Club home page Giter Club logo

Comments (9)

roblav96 avatar roblav96 commented on August 23, 2024

@scavezze you need to add android:launchMode="singleTask" to your activity in your AndroidManifest.xml. This will certainly resolve your issue. I've had to solve this exact problem before.

from nativescript-urlhandler.

hypery2k avatar hypery2k commented on August 23, 2024

@scavezze Did I need to add the JavaProxy decorator and the extend?
Will try to add it to my plugin if needed

from nativescript-urlhandler.

scavezze avatar scavezze commented on August 23, 2024

@roblav96 it's already set to single task

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

I noticed 2 changes were made tho one for the docs and one other one so let me get the latest and try it out

from nativescript-urlhandler.

scavezze avatar scavezze commented on August 23, 2024

@hypery2k I think your really close i have tried whats currently avail and the following line throws a exception

application.android.init(this);

I think don't think you need that and the

protected onNewIntent(intent: android.content.Intent): void {
        super.onNewIntent(intent);
        if (intent.getDataString) {
            handleIntent(intent);
        }
    }

is called every time you receive a external link so i think you just need to remove that line then change handleIntent to something like this

export function handleIntent(intent: any) {
    let data = intent.getData();
    if (data !== lastReceivedData) {
        try {
            if (new String(intent.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);
        }
    }
}

from nativescript-urlhandler.

scavezze avatar scavezze commented on August 23, 2024

I modified my local version to what i recommended above and it works but again it stops the ActionBar -> ActionItem event from working. gonna try and figure that out .

from nativescript-urlhandler.

scavezze avatar scavezze commented on August 23, 2024

ActionBar -> ActionItem event is not a issue with the linking. I think it's something with when i am changing routes in the handler

from nativescript-urlhandler.

hypery2k avatar hypery2k commented on August 23, 2024

maybe you have to wrap it in a zone

from nativescript-urlhandler.

scavezze avatar scavezze commented on August 23, 2024

@hypery2k

https://gist.github.com/scavezze/28d2e69aa39b69796769d729fc1ee638 with the 0.4.0 version of your plugin works also so i will leave it upto you if you want to change to use protected onNewIntent(intent: android.content.Intent): void { or jsut add it to your documentation.

I am new to Nativescript/Typescript so I will look into zones

from nativescript-urlhandler.

scavezze avatar scavezze commented on August 23, 2024

@hypery2k , @roblav96
Thanks for your help i have it all working right now with the 0.4.0 version of your plugin

from nativescript-urlhandler.

Related Issues (20)

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.