Giter VIP home page Giter VIP logo

Comments (4)

jmig avatar jmig commented on June 24, 2024

Here's what going on with your code:
[BFAppLinkNavigation resolveAppLinkInBackground:url] is actually failing. Because you're using continueWithSuccessBlock and you don't test for error then you're just missing it. You can go with continueWithBlock to actually handle this error.

[[BFAppLinkNavigation resolveAppLinkInBackground:URL] resolveLink continueWithBlock:^id(BFTask *task) {
    //if AppLinks failed fallback on the default "mechanism", you can also manually add your referral meta data, it's not really complicated to see what keys/values are added to the URL
     if (task.error) {
        [[UIApplication sharedApplication] openURL:URL];
        return nil;
    }

     //Do your stuff when AppLinks successfully resolved your URL

      return nil;
}];

If you look at the actual NSError, you will understand why it's failing

(lldb) po taskk.error
Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0x113e65390 {NSUnderlyingError=0x1181b0550 "unsupported URL", NSErrorFailingURLStringKey= receiver://xxx, NSErrorFailingURLKey= receiver://xxx, NSLocalizedDescription=unsupported URL}

So for now in my code I have a simply test on the URL scheme, if it's http or https I'm using AppLinks otherwise I'll use the classic openURL:.
Once again, it's really easy to add the referral data to your custom scheme URL. That's the beauty of AppLinks being open-source

from bolts-objc.

StevenVeshkini avatar StevenVeshkini commented on June 24, 2024

@jmig That's a good solution. However, don't you think that it would make sense to support custom URL Schemes in [BFAppLinkNavigation resolveAppLinkInBackground:url] without having to implement continueWithBlock?

from bolts-objc.

jmig avatar jmig commented on June 24, 2024

I would accept both answers from AppLink.

  1. It would be great to have this support out of the box.
  2. They're trying to make http/https urls the default deep-linking protocol and rely on AppLink for resolving it. So it's maybe by design.

from bolts-objc.

josephearl avatar josephearl commented on June 24, 2024

@mingflifb @nlutsenko-fb I think this should be closed per #47

from bolts-objc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.