Comments (4)
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.
@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.
I would accept both answers from AppLink.
- It would be great to have this support out of the box.
- 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.
@mingflifb @nlutsenko-fb I think this should be closed per #47
from bolts-objc.
Related Issues (20)
- This project will change it's license?
- Documents not available at 1.9.0 on cocoapods.org. HOT 1
- EXC_BAD_ACCESS in BfTask.m
- Next Version Release? HOT 5
- 7 Semantic Issues in XCode 10.1 with Bolts 1.9.0 HOT 3
- ``` HOT 2
- setException deprecated
- Apple Review HOT 10
- Need the Bolts framework with mac catalyst support HOT 2
- Script build_framework.sh fails HOT 1
- need latest BoltsFramework HOT 1
- Built framework lacks slices HOT 2
- Bolts not updating to 1.9.1
- REMOVE ALL UIWEBVIEW REFERENCES OR TEXT IN README.MD
- IPhone
- Crash BFTask.m - Line 54 Crashed: com.parse.asynctaskqueue.sync SIGABRT ABORT 0x00000001b70da95c HOT 3
- U
- Failed to install apps when using Carthage and Xcode12.5 HOT 1
- Is Bolts relevant in 2022 for handling simple deeplinks opening from Facebook?
- Library not loaded: @rpath/Bolts.framework/Versions/A/Bolts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bolts-objc.