Get deeplink URL in iOS?
See original GitHub issueFrom @zahid-dapperapps on February 13, 2017 13:39
Documentation has code for android that is working and I am able to get value of what is being passed.
application.android.on(application.AndroidApplication.activityResumedEvent, (args) => {
var intentData = args.activity.getIntent().getData();
});
How can I do the same for iOS? documentation has code for iOS for resume event but it doesn’t really show how to get whats being passed via deeplink url
application.on(application.resumeEvent, function (args: application.ApplicationEventData) {
if (args.android) {
console.log("Activity:================= " + args.android);
} else if (args.ios) {
console.log("UIApplication:============== " + args.ios);
}
});
Copied from original issue: NativeScript/ios-runtime#727
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Deep linking using URL scheme in iOS - Halodoc Blog
We'll look at deep linking on iOS and how to make an app's URL scheme. ... At the bottom of the page, you'll...
Read more >Deep linking and URL scheme in iOS
When we talk about deep linking for mobile app, it means creating a specific URL to open a mobile application. It separate into...
Read more >What is Deep Linking in iOS? - Originate
Deep linking consists of using a hyperlink that links to a specific piece of content within an app. The specific content could be...
Read more >Handling deeplinks in your app - Donny Wals
On iOS, it's possible to send users from one app to the next or to send them from a webpage into an app....
Read more >Deep Linking in iOS Using URL Scheme - Dev Genius
Deep linking is the use of semantic links to guide a user to particular content in-app. How to implement Deep linking in iOS?...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you could take a look at my plugin: https://www.npmjs.com/package/nativescript-urlhandler
Hi @zahid-dapperapps, To be able to use a deep link in iOS, you should make some changes in your project Info.plist and implement
applicationHandleOpenURL
delegate method, which allows you to get the URL. You could review the below-attached description, how you could do that in your app.The first step is to include
CFBundleURLName
key in yourapp/App_Resources/iOS/Info.plist
file. For example:<your app id>
could get it from the projectpackage.json
file and should look like the following stringorg.nativescript.issue3632
.To be able to implement
UIApplicationDelegate
and itsapplicationHandleOpenURL
method, you should installtns-platform-declarations
withnpm install tns-platform-declarations --save
and to follow setup instructions in npm here.The final steps is to implement the needed method in app.ts file for TypeScript project and app.js file for pure JavaScript template:
to be able to open the app with some parameters you could use URL similar to
appgo://org.nativescript.issue3632?test=test
andgetParameterByName
allows you to get single parameter.Hope this information helps.