Comments (9)
@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.
@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.
@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.
@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.
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.
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.
maybe you have to wrap it in a zone
from nativescript-urlhandler.
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.
@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)
- Android, Not redirecting to app after login in mobile browser(MIC Login)
- Plugin fails to load for Vue project HOT 1
- Add support for NativeScript 8+ HOT 1
- Mark this repository as deprecated
- App URL doesn't work on Android HOT 1
- nativescript-Urlhandler not working in iOS. HOT 2
- not working properly when app is closed HOT 3
- apple-app-site-association / applinks HOT 10
- Can this console log be removed please HOT 1
- Is it supporting bitcoin:XXX url scheme?
- Unable to open URL
- New patch release? HOT 2
- The plugin doesn't work on iOS HOT 26
- Callback sometimes not called
- Empty params HOT 1
- handleOpenURL is called each time that the application is resumed HOT 13
- Android NS 5.4 does not work with android:host="__PACKAGE__" in Manifest HOT 6
- Up to date documentation for NS cli 6 and web URLs HOT 1
- Running the Url handler with nativescript-facebook in IOS HOT 2
- Relative Path Interpretation Issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-urlhandler.