1

I want to use deep-linking , for example consider my post url is http://myappsite/api/video/post_id , how can I implement deep-linking using this link. as facebook is doing with this url https://www.facebook.com/page_name/videos/post-id

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • Deep-linking and custom url scheme both are different. Deep-linking is advance then custom url scheme. – SPatel Jul 05 '18 at 12:46
  • How can I use deep-linking with my app when user click on my app's post url. for example, http://myappbackend/api/post_id/video/1 – jatinder singh Jul 05 '18 at 12:54
  • https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html?utm_source=revxblog – SPatel Jul 05 '18 at 13:04
  • https://stackoverflow.com/questions/35102745/how-to-upload-file-apple-app-site-association-for-universal-linking-in-server-fo – SPatel Jul 05 '18 at 13:10

3 Answers3

0

You need to implement universal links on website and app.

You can also use Branch to help you integrating universal links / deep linking.

Florent Morin
  • 842
  • 1
  • 10
  • 13
  • Ok Florent , Thanks for the response, Is there any other way to implement this without universal link? – jatinder singh Jul 09 '18 at 13:07
  • If it's not universal link, it's an app link. Format is `myapp://action`. Depending of your app goal, you can also implement share extension. – Florent Morin Jul 09 '18 at 14:44
0

You need link you mobile app and website by universal links and than you need parse url inside you ios code and open correct screen

Andrey
  • 1,186
  • 7
  • 11
  • Ok Andrey, Thanks for the response, Is there any other way to implement this without universal link? – jatinder singh Jul 09 '18 at 13:08
  • no, there are no other way. just universal links + App Links if you want to have it works when user click in article in Facebooks – Andrey Jul 10 '18 at 17:39
0

You have to implement Universal linking for acheaving this type of functionality. This would give you a good start .

https://medium.com/@abhimuralidharan/universal-links-in-ios-79c4ee038272

After that, when you click on the link, your application will open and following delegate function called in AppDelegate.

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
    print("Continue User Activity called: ")
    if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
        let url = userActivity.webpageURL!
        print(url.absoluteString)
        //handle url and open whatever page you want to open.
    }
    return true
}

The url.absolutelyString return the url string on which you tapped. Chop out your video_id and open the appropriate ViewController.

Ajay saini
  • 2,352
  • 1
  • 11
  • 25
  • Ok Ajay , Thanks for the response, Is there any other way to implement this without universal link? – jatinder singh Jul 09 '18 at 13:07
  • if you want to do this from your domain name. then you must implement universal link. otherwise if you wish to use custom url scheme, then you can achieve this by deep linking – Ajay saini Jul 09 '18 at 13:12