luisfcofv / react-native-deep-linking Goto Github PK
View Code? Open in Web Editor NEWSimple route-matching library to handle deep links
License: MIT License
Simple route-matching library to handle deep links
License: MIT License
no events are getting fire here is my code
` componentDidMount() {
// Google SignIn init
GoogleUtil.configureGoogleSignIn();
// Register schemes
DeepLinking.addScheme('recreative://');
// Deep linking
Linking.addEventListener('url', this.handleUrl);
var url = Linking.getInitialURL()
.then((url) => {
if (url) {
Linking.openURL(url);
}
})
.catch((err) => console.error('An error occurred', err));
DeepLinking.addRoute('/UserProfile/:id', ({ scheme, path, id }) => {
console.log('response for deeplinking');
// recreative://UserProfile
// this.setState({ response });
console.log('scheme checking', scheme); // `facebook://`
console.log('path checking', path); // `/profile/33138223345`
console.log('id checking', id); // `33138223345`
NavigationService.navigate('UserProfile');
});
// Twitter SignIn init
// TwitterUtil.init();
setTimeout(() => {
SplashScreen.hide();
}, 2000);
}
componentWillUnmount() {
// Deep linking unmounting
Linking.removeEventListener('url', this.handleUrl);
// network info change remove listener
NetworkInfo.removeNetworkInfoListener(
this.state.store.dispatch,
networkActions.networkInfoListener,
);
}
handleUrl = (url) => {
console.log('checking url', url);
Linking.canOpenURL(url).then((supported) => {
if (supported) {
DeepLinking.evaluateUrl(url);
}
});
};`
Hi, thanks for your efforts with this repo.
Seem really solid!
If I want to catch all routes, especially those that doesn't match specified routes, what's the best way to go about it?
Thanks in advance, Anton
all of the examples show deep linking from your app into another app, for example - like launching facebook. how about deep linking into your own app? does this support that too?
If I using url scheme to open my app, the deep linking could not work properly.
It will be cool to support the start up handling.
I implemented email verification for my application using this package. Android is working fine. But on iOS, the link redirect will not open the application
My Email Verification URL looks like this: https://app.myapp.com/core/?userReference=someValue
All I want is once from the email user clicks the verification link they need to redirect to the app for email verification
Hi,
How can I make this work while the app closed?
I've implement this and it's working when the app in foreground / background, but it's not working when the app closed. The listener only working when the app in foreground/background.
Really need help.
Thanks
7.14.0
to 7.14.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 3 commits.
62255af
Update CHANGELOG and bump version
655eb01
Merge pull request #2320 from golopot/issue-2319
9639d82
[Fix] prop-types
: fix crash on multiple destructuring
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
I just need to make sure everything is working as I intend. How can I test deep linking with a uri?
When I try to open deeplink on the android application β the application is restarted continuously.
RN 0.36.1
Only iOS is working in the example provided.
I can't find a way to get the full URL inside a handler of addRoute method. I can only get scheme, path and URL params but I also need the domain. I've tried to use Linking.getInitialURL but it returns null everytime
Do you have any plan to add TypeScript typings via https://github.com/DefinitelyTyped/DefinitelyTyped?
Can we also have reset scheme option? In Android, I am facing an issue where already running app is mounting scenes again on link open request and calling componentDidMount, which is pushing scheme again and causing routes callback to be called multiple times.
So I was hoping there will be some method like below to reset the scheme. Or is there already an option to reset schemes?
const resetScheme = () => { schemes.splice(0, schemes.length); };
If this is fine then, I can also send the pull request.
Hello!
Currently, this lib does not support query params.
What I mean is, suppose you have this route
DeepLinking.addScheme('domain://');
DeepLinking.addRoute('/queryparams/:id', ({id}) => console.log('id: ', id))
when evaluating the uri, id gets query params concatenated:
DeepLinking.evaluateUrl('domain://queryparams/1234?q=query&p=param');
// console.log => id: 1234?q=query&p=param
is there any way to get around this?
my intentions isn't to get the query params, but for them to not get concatenated to the last uri param.
probably in a next version, it would be nice for the addRoute callback to receive:
{ path, scheme, match, params, query }
I can send a PR with what I just wrote, but it would be a breaking change.
The routes are sometimes missing
addRoute does not work when routing via browser. But it is triggered when I go to the browser to write the direct address. What could be the reason?
Branch | Build failing π¨ |
---|---|
Dependency | husky |
Current Version | 0.13.2 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As husky is βonlyβ a devDependency 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 πͺ
The new version differs by 9 commits .
4b5011e
0.13.3
6b92bb8
Comments
c6f8bb1
0.13.3-0
a2da709
Prefer nvm over Node global install
652c7f0
Update README.md
d05a7b3
Update README.md
0bb5798
Fix tests
7af95d3
update failure message (#107)
be435ca
Update CHANGELOG.md
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
"react": "16.0.0-alpha.12",
"react-native": "0.46.4",
"react-native-deep-linking": "^2.1.0",
Suppose an url like this myclnq://register?firstName=Saran&lastName=kumar, how can i get firstName and lastName from this url.
In the example, retrieing one param is defined but not multiple params. pls give a solution
Simply does not react to any link being opened in the app.
This may be the react native Linking API issue too - I am not sure.
Not working in Simulator or physical device.
Version: 2.2.0
React Native: 0.63.4
I have cloned your project and I tried to running your project in my local but I didn't work properly like addEventListener is not working.
Please let me what should I do?
It works great if iOS app has been launched previously. App comes to foreground and open url event is called.
If app is not launched, the app will launch, however, the open url event never seems to get called?
Thanks in advance for any tips or suggestions.
Hi team , I am using this plugin for deeplink in my application my deeplink url as below
https://my.domain.com/services/auth/v1/unlock-account?token=1234
I set scheme and host in android as below
<data android:scheme="https" android:host="my.domain.com"/>
I write code in react native side as below
function addUnlockAccountRoute() {
DeepLinking.addRoute('/services/auth/v1/unlock-account/:token', ({scheme, path, token}) => {
console.log('unlock_account_deeplink_response_schema', scheme);
console.log('unlock_account_deeplink_response_path', path);
console.log('unlock_account_deeplink_response_token', token);
});
}
When i try to run above code route not found means i am not able to get value scheme, path and token value because my deep link URL includes query parmas like ?token=1234
so can you tell me how i can resolve this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.