I have generated and loaded a Google Digital Asset Links(DAL) file to https://myexample.com/.wellknown/assetlinks.json. Read and execute perms are set. The file is below:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.myexample.testqiew2.app",
"sha256_cert_fingerprints":
["7A:D5:67: ... :E9:5E"]
}
}]
The robots.txt file does not block access, and I am in the US.
The AppLink Assistant in Associate website passes the first three checks but fails on the fourth with: Digital Asset Links file not found at https://myexample.com/.wellknown/assetlinks.json"
The Statement List Generator and Tester responds with "No app deeplinking permission found for com.myexample.testqiew2.app at myexample.com".
I have searched through android-instant-apps, android-studio, and android tags and haven't found other ways to prove the file I know is there is accessible.
I even tried:
https://digitalassetlinks.googleapis.com/v1/statementslist:list?source.web.site=https//quixr.com&relation=delegate_permission/common.handle_all_urls
but got a Google 404.
I have not uploaded code to the Play Store yet. I am still just trying to verify the infrastructure is in order. Is there any other way I can test why the DAL file is not being seen even though it is there?
Thanks guys. It turned out that, after I became convinced there weren't any more cracks for anything to have fallen through, I started wondering if there were redirects going on at the server. There I found that the document root needed to be changed in conjunction with installing the SSL certificate. Changing that so /.well-known branched off the root made the DAL file accessible. The AppLinks Assistant accessed it, and so did the StatementListGenerator.
So it was the server, not the AIA configuration at all. Thanks again for your help.
After all these years I migrated to a different hosting service. I was surprised that there was no /.well-known directory with the assetlinks.json file in it. Yet the App Links Assistant worked fine and so, apparently, did the app.
I found assetlinks.json in the /public_html directory which functions as the root for my domain. In this intervening time, it looks like the InstantApp system has accepted that location. So don't worry that you can't find .well-known.
Related
I'm having an android app that is having an instant app version. My instant app can be launched & run without installation from deep link. This is how my deep domain assetlinks.json looks like:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.<app name>",
"sha256_cert_fingerprints":
["<app fingerprint>"]
}
}]
It is working fine, but what I want to achieve is to have "fallback" web application when user would have disabled instant apps or have older device. I've tried to host react.js web application on this domain with assetlinks.json file in public folder(to make it available) and it was not working at all, android phone treated this domain as usual website and instant app was not launching like on previous configuration. Same thing goes for hosting empty index.html file. It is also breaking instant app invocation process. Any ideas this this can be configured ?
this is how instant app invocation screen looks like
Alright, I've managed to find a solution, it is pretty easy one. My deep links most of the time have data passed as path such as /type/value. The solution is to create clear index.html file with javascript attached like this:
<script>
window.location.href = '<FALLBACK WEB APP URL>' +
window.location.pathname;
</script>
This code extracts path from the deep link and adds it to web app link. Next, index.html needs to be served for every folder of deep domain, but domain needs to also allow to read assetlinks.json file if needed. This solution work pretty well with instant apps - it is not breaking invocation process, and is is also compatible with iOS AppClips.
Is it possible to filter what specific URLs get routed to the android app using the assetlinks.json file? I would like to do the filter prior to even coming into the app. I'd like to do it in the assetlinks.json file. I currently have app links working routing all traffic on our domain, BUT what I really want is something like this:
I only want links that have the specific parameter of quesid=210906192 to open via the app
Example of link:
https://example.com/example/inside.asp?mode=questionnaire&from=list&src=sys&srcid=1&quesid=2109061920&mobile=1
This is my current assetlinks.json file. I was thinking maybe relation is the piece I'm looking for to only match based on a rule like matching a parameter, but I haven't found any documentation yet on my current scenario.
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example.mobile",
"sha256_cert_fingerprints":
["03:.......:F4:7E:CB:CD:7A:4C:05"]
}
}]
Thanks for any information you can provide.
I think it is very simple .while getting from json you put all link into one arraylist
at that time you should filter one by one by putting the if statement in it like below
if(links.contains("quesid=210906192"){
arraylist.add(links);
}
int other case if your link end with specific word then you can put
links.endwith("quesid=210906192")
So, basically I'm at step 1 of implementing App Links, I stumbled upon this tool:
https://developers.google.com/digital-asset-links/tools/generator
I give it my domain name, my package name, and I copy paste my App package fingerprint from the play store console. it generate an assetlinks.json file for me, I put it as required at https://my-domain/.well-known/assetlinks.json I test downloads, it works, then I ask this tool to test it, it says
No app deep linking permission found for package_name at my_domain.
my logs indicate that GoogleAssociationService came and took the file (200 status response and the correct number of bytes).
So basically I put the good values, it generates it, and then fetch it and tells me it's wrong, what am I missing ? how can he not be happy with what he generated itself ?
When we came across this issue we have also investigated logs of our proxy and have seen that the "assetlinks.json" file had been successfully downloaded.
In our case, the problem was with Content-Type. In our case, it was the "application/octet-stream" type. According to the documentation, Content-Type should have the type "application/json". We have changed the content type and everything started working as expected.
Check the requirements using the link above and verify that all of them are met by crossing off all potential reasons one by one.
Update 2022-10-30: The provided link is not available anymore. I have used a cached version to fetch the information below:
You must publish your JSON verification file at the following
location:
https://domain.name/.well-known/assetlinks.json
Be sure of the following:
The assetlinks.json file is served with content-type application/json.
The assetlinks.json file must be accessible over an HTTPS connection,
regardless of whether your app's intent filters declare HTTPS as the
data scheme.
The assetlinks.json file must be accessible without any
redirects (no 301 or 302 redirects).
If your app links support
multiple host domains, then you must publish the assetlinks.json file
on each domain. See Supporting app linking for multiple hosts.
Do not
publish your app with dev/test URLs in the manifest file that may not
be accessible to the public (such as any that are accessible only with
a VPN). A work-around in such cases is to configure build variants to
generate a different manifest file for dev builds.
I have the Medium app install on my iPhone.
When doing a search on Google Chrome app, when I clicks on a medium.com link in the search results, it open my Medium app.
How can this happen? How can Google Chrome can interpret https://medium.com to medium://?
So the feature in particular you are referring to is Universal Links and requires both server side and client side modifications.
On the server side / website you need to add an AASA (Apple App Site Association) file. This file is simply a JSON file that contains the specific applinks urls for the corresponding app identifier. A sample is shown below.
{
"applinks": {
"apps": [],
"details": [{
"appID": "ABCDEBBQ.com.medium.ios",
"paths": ["*"]
}]
}
}
If you note the paths key in the JSON above you will see that there is a star or wildcard symbol. This simply means open any URL on my websites’ domain. For example www.medium.com/topposts will open in the medium iOS app. It should be noted that you can explicitly define your paths to either include or exclude.
On the client side (Xcode) you’ve gotta setup the associated domains capability inside of your application and specify the applinks service for your domain in this case www.medium.com
Lastly you’ve gotta add the capability to your application identifier inside of the developer portal.
After all of this configuration is completed you should now have a ‘link’ between your website and application.
Apple handles all of this logic internally in iOS and since it’s closed source I cannot give you the exact implementation details but the just of it is that when you visit the domain (medium.com) on your iOS device it downloads the AASA file from the webserver (the AASA file must be hosted on a secure server and can only be downloaded over HTTPS) and the operating system then checks whether there is a corresponding application on the device that matches the appId specified in the AASA file. If both the paths and appIds match it then launches the medium iOS application on the phone.
That’s how it works. I hope that I’ve articulated it well enough.
is there a way of getting access to the details of each one programatically?
There is an open source project called Android Market API which allows you to do the following:
You can browse market with any carrier or locale you want.
Search for apps using keywords or package name.
Retrieve an app info using an app ID.
Retrieve comments using an app ID.
Get PNG screenshots and icon
It is located here: http://code.google.com/p/android-market-api/
Hope this helps you out. =)
As a workaround, you can use appbrain api. It has RSS feeds for lists of apps with description of each one.
Link is in here:
http://www.appbrain.com/info/api
Unfortunately there is still no official API for Google Play Store (previously known as Android Market) to access Android apps' meta-data (or any other stats).
As mentioned in other answers, you could develop your own web crawler, parse the HTML page and extract the app meta-data you need (e.g. title, descriptions, price, etc). This topic has been covered in this other question.
Another option is to use an open-source library based on ProtoBuf to fetch meta-data about an app, here the link to the project: https://code.google.com/archive/p/android-market-api.
This library fetches app meta-data from Google Play on behalf of a valid Google account, but you still need a crawler to "find" which apps are available and schedule their meta-data retrieval. This other open-source project can help you with that: https://code.google.com/archive/p/android-marketplace-crawler.
If you don't want to implement all that by yourself, you could use a third-party service to access Android apps meta-data through a JSON-based API. For instance, 42matters.com (the company I work for) offers an API for both Android and iOS to retrieve apps' meta-data, here more details:
https://42matters.com/app-market-data
In order to get the Title, Icon, Description, Downloads for an app you can use the "lookup" endpoint as documented here:
https://42matters.com/docs/app-market-data/android/apps/lookup
This is an example of the JSON response for the "Angry Birds Space Premium" app:
{
"package_name": "com.rovio.angrybirdsspace.premium",
"title": "Angry Birds Space Premium",
"description": "Play over 300 interstellar levels across 10 planets...",
"short_desc": "The #1 mobile game of all time blasts off into space!",
"rating": 4.3046236038208,
"category": "Arcade",
"cat_key": "GAME_ARCADE",
"cat_keys": [
"GAME_ARCADE",
"GAME",
"FAMILY_EDUCATION",
"FAMILY"
],
"price": "$1.15",
"downloads": "1,000,000 - 5,000,000",
"version": "2.2.1",
"content_rating": "Everyone",
"promo_video": "https://www.youtube.com/embed/g6AL9YqRHaI?ps=play&vq=large&rel=0&autohide=1&showinfo=0&autoplay=1",
"market_update": "2015-07-03T00:00:00+00:00",
"screenshots": [
"https://lh3.googleusercontent.com/ZmuBQzIy1G74coPrQ1R7fCeKdJmjTdpJhNrIHBOaFyM0N2EYdUPwZaQjnQUtiUDGmac=h310",
"https://lh3.googleusercontent.com/Xg2Aq70ZH0SnNhtSKH7xg9jCfisWgmmq3C7xQbx6YMhTVAIRqlRJeH8GYtjxapb_qR4=h310",
"https://lh3.googleusercontent.com/T4o5-2_UP82sj4fSSegbjrGmslNHlfvtEYuZacXMSOC55-7eyiKySw05lNF1QQGO2FeU=h310",
"https://lh3.googleusercontent.com/f2ennaLdivFu5cQQaVPKsRcWxB8FS5T4Bkoy3l0iPW9-GDDnTVRhvR5kz6l4m8FL1c8=h310",
"https://lh3.googleusercontent.com/H-9M03_-O9Df1nHr2-rUdjtk2aeBY3bAxnqSX3m2zh_aV8-K1t0qU1DxLXnK0GrDAw=h310"
],
"created": "2012-03-22T08:24:00+00:00",
"developer": "Rovio Entertainment Ltd.",
"number_ratings": 20812,
"price_currency": "$",
"icon": "https://lh3.ggpht.com/aQaIEGrmba1ENSEgUtArdm3yhJUug7BRWlu_WaspoJusZyHv1rjlWtYqe_qRjE_Kmh1E=w300",
"icon_72": "https://lh3.ggpht.com/aQaIEGrmba1ENSEgUtArdm3yhJUug7BRWlu_WaspoJusZyHv1rjlWtYqe_qRjE_Kmh1E=w72",
"market_url": "https://play.google.com/store/apps/details?id=com.rovio.angrybirdsspace.premium&referrer=utm_source%3D42matters.com%26utm_medium%3Dapi"
}
Alternatively, we also have a DATA FEED DUMP to access all mobile app data at once: https://42matters.com/docs/app-market-data/file-dump/android-app-details (on this page you can also find a free sample of data for your tests).
I hope this helps, otherwise feel free to get in touch with me. I know this topic quite well and can point you in the right direction.
Regards,
Andrea
You could build a website crawler and crawl the various android app stores and get all the data for the apps.
Not all apps are on the Google Android Market. There are other Android stores like:
Appbrain
Applanet
AndAppStore
AppstoreHQ
etc...
Not all App Stores have APIs so the best way to do it is by crawling their website.