3

I am working on price comparison application, in which I have products of ebay, in addition to many other vendors. I have web url of an ebay product, and I want to open that product page in ebay iOS app(If installed).

Other applications like amazon and walmart automatically open themselves when I open this web url in my app like

UIApplication.shared.open(urlToOpen, options: [:], completionHandler: nil)

if it is a walmart or amazon or newegg product, above line opens the product in respective app. but ebay app does not do this.

I have searched on internet. Found this SO Answer . But this is very old (Jul 4 '15). And it is not working

I have also read this ebay community thread. This is also very old thread (Oct 15, 2015). According to this thread,

The ability to open the app directly from an email link hasn't been added in yet, but it's a great suggestion. We're definitely working on this for a future update, but we don't have any specific details that we can share yet

So I am wondering if I can accomplish this task now?

Sample web url that I have

https://www.ebay.com/itm/Google-Pixel-32GB-Factory-Unlocked-5-0-12-3MP-4GB-RAM-Android-Smartphone/142444471228?_trkparms=5079%3A5000006423
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Awais Fayyaz
  • 2,275
  • 1
  • 22
  • 45

2 Answers2

2

If you look at ebay.com/apple-app-site-association you'll see that they have this AASA file being hosted for their Universal Links:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "T4JAZKL6NS.com.ebay.iphone",
                "paths": ["/notapath12345"]
            },
            {
                "appID": "658FM9ZWKC.com.ebayent.iphone",
                "paths": [
                    "NOT /itm/like/*",
                    "NOT /sch/*/*/bn_*",
                    "/itm/*",
                    "/sch/*"
                ]
            }
        ]
    }
}

From this, it looks like the ebay app with bundle id 658FM9ZWKC.com.ebayent.iphone should open (if it is installed) when a link is clicked on that has a path https://ebay.com/itm/* where * is a wildcard character. The Universal Links only open from certain apps. I recommend testing your links by pasting them into the notes app and tapping on them. It looks like the T4JAZKL6NS.com.ebay.iphone does not have any paths set up.

clayjones94
  • 2,648
  • 17
  • 26
  • The wildcard character '*' means anything, so the sample web url that i have given in question, should open the product in ebay app if installed? – Awais Fayyaz May 22 '18 at 12:09
  • Yes but only if the app you are trying to open has bundle ID `658FM9ZWKC.com.ebayent.iphone` – clayjones94 May 22 '18 at 16:07
  • If it has that bundle ID but does not open, then either ebay doesn't have its entitlements set up properly or the AASA file didn't download correctly so you'll have to delete the ebay app and try again – clayjones94 May 22 '18 at 16:18
  • How can i find out the the app i am trying to open has bundle ID `658FM9ZWKC.com.ebayent.iphone` ? – Awais Fayyaz May 23 '18 at 04:32
  • Thanks. I got the bunder ID using the link. bundle id of ebay app is `com.ebay.iphone`. Now, what about the bundle ID prefix `T4JAZKL6NS`? – Awais Fayyaz May 24 '18 at 05:19
  • Well from that you can assume that deep links will not open the app since the other has a bundle id with `com.ebayent.iphone`. I'm not sure how to get the prefix unfortunately, but I'm assuming that they put the right one in their AASA. – clayjones94 May 24 '18 at 17:57
1

Deeplinks are first configured on server side with some JSON config file stored in the root directory of Web Server. The JSON config file have data about which links can open the app.

If eBay has setup Deeplinks on server, you need to ensure the followings on App:

  • Associated domain added correctly in App Capabilities.
  • Sometimes the links don't work in safari, save the link in your notes app and try to open from Notes.
  • Debug Deeplinks related AppDelegate functions.