How to pass link query params to deeplink using Branch.io - branch.io

Is it possible to create a branch link that receives a query param, and then use this parameters as a path param to the deeplink passed to the app?
Example:
Branch link - something.app.link/something_else?id=1
Deeplink configuration inside branch panel (ex: $ios_deeplink_path): myapp://something_else/:id
Would this be possible (having this dynamic :id parameter)?

If your use case is to create dynamic links then definitely it is possible. If you would like to append custom data to one of the Quick Links you can do it in the following way -
https://your.app.link/fzmLEhobLD?content_id=123
For long links which can be created without network calls to Branch, you can have something like this -
https://your.app.link/fzmLEhobLD?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F
Similarly a dynamic long link would be -
https://your.app.link/?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F
You can reference the following Branch Documents for all above examples -
https://help.branch.io/using-branch/docs/creating-a-deep-link#section-create-deep-links
https://help.branch.io/using-branch/docs/creating-a-deep-link#section-long-links

Related

How to create an static api route after a dynamic route in Next.js?

I have an api that dynamically pulls a post. localhost/api/post/[postId]
I want to extend functionality to retrieve the comments of the post at the URL localhost/api/post/[postId]/comments
What is the correct way to structure this in Next.js? I am thinking to create a dynamic route and check if the query equals comment? localhost/api/post/[postId]/[comment]
The following file structure should work:
/pages/api/post/[postId]/index.js //Route: /api/post/1
/pages/api/post/[postId]/comments.js //Route: /api/post/1/comments
Besides that, just to follow good practices, I would recommend that you rename "post" to "posts", like that:
/pages/api/posts/[postId]/comments.js

How does Branch construct the url that's ultimately hidden in the *.app.link url?

I'm creating a branch link - which I can only test with the live version of the app - as such:
let routeString = "create"
let buo = BranchUniversalObject(canonicalIdentifier: PFUser.current()!.objectId!)
let linkProperties = BranchLinkProperties()
linkProperties.feature = "createItem"
linkProperties.addControlParam("$deeplink_path", withValue: routeString)
linkProperties.addControlParam("referrer", withValue: "someApp")
I assume this creates a link such as https://myApp.app.link/create?referrer=someApp
Is that correct or are the linkProperties constructed into some other shape? Thanks
Jackie from Branch here. Creating Branch links via SDK as you have, will generate short links that look like this: https:myApp.app.link/fbofj2(random characters). The link includes all the data and parameters you set during the creation.
Long links, on the other hand, have link properties appended to the link URL itself. This can be dynamically created on your end like so: https:myApp.app.link/?foo=bar.
To learn more, feel free to reference our documentation on link generation: https://docs.branch.io/pages/links/integrate/#short-links

Date range search using Google Custom Search API

I am using the Google Custom Search API to search for images. My implementation is using Java, and this is how I build my search string:
URL url = new URL("https://ajax.googleapis.com/ajax/services/search/images?"
+ "v=1.0&q=barack%20obama&userip=INSERT-USER-IP");
How would I modify the URL to limit search results, for example, to: 2014-08-15 and 2014-09-31?
You can specify a date range using the sort parameter. For your example, you would add this to your query string: sort=date:r:20140815:20140931.
This is documented at https://developers.google.com/custom-search/docs/structured_data#page_dates
Also if you use Google's Java API you can use the Query class and its setSort() method rather than building the URL by hand.
I think the better way is to put this into query itself. Query parameter contains 'after' flag which can be used like:
https://customsearch.googleapis.com/customsearch/v1?
key=<api_key>&
cx=<search_engine_id>&
q="<your_search_word> after:<YYYY-MM-DD>"

There are no 'DS.MODEL.find' method in ember data Tag: v1.0.0-beta.2?

I'd like to use didLoad callback for 'DS.MODEL.FIND', but can not find 'DS.MODEL.FIND' method in below webpage.
Also can not find "findQuery", Thanks.
http://emberjs.com/api/data/classes/DS.Model.html
find and similar methods should be called from the store now.
For example, if you have a model App.Post you can look up the record with id 1 in a route or controller with:
this.store.find('post', 1)
Instead of how you would in 0.13:
App.Post.find(1)
Also, I recommend using the latest build as there have been a lot of fixes since beta 2.

Recursive/Exploded uri variable with restlet

Does Restlet support exploded path variable (reference to URI Template RFC)?
An example would be /documents{/path*} where path can be for example "a/b/c/d/e".
This syntax doesn't seem to work with Restlet.
I'm creating a folder navigation api and I can have variable path depth, but I'm trying to have only one resource on the server side to handle all the calls. Is this something I can do with Restlet? I suppose I could create a custom router but if there is another way to do this I would like to know.
Thanks
It is possible to support this using matching modes.
For example:
myRouter.attach("/documents{path}",
MyResource.class).setMatchingMode(Template.START_WITH);
Hope this helps!
I'm doing the following
myRouter.attach("/documents/{path}", MyResource.class).setMatchingMode(Template.START_WITH);
Now I do get inside the resource GET method, but if I request the value of the path variable, I only get the first part (for example, /documents/a/b/c, path returns "a".) I use getRequest().getAttributes().get("path") to retrieve the value. Am I doing something wrong ?
Mathieu