I need to return a json response in a route


#1

Hi, I was asked by a client to put a pwa into the google play store, for this one of the steps is to make a json object

[
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "xyz.appmaker.vhiisk",
      "sha256_cert_fingerprints": ["D1:62:5A:81:7D:F0:5F:AC:8C:85:80:01:B6:75:95:78:0E:82:E9:B8:BB:1E:F0:2A:5D:8A:17:65:E5:96:BD:8D"]
    }
  }
]

accessible in a route (.well-known/assetlinks), any advice on how can I proceed?
Or better yet some advice on how to put a pwa in the store!!!


#2

You need to create a manifest.json file and the android manifest.


#3

thanks for your response but the requirement from my client is that the app must be obtained from google play store :frowning:


#4

Can you explain this a bit further? I haven’t done anything with PWA’s and the play store, what’s the purpose of the object? I’m guessing verification? Does the object need to be accessible in all routes or just one? Can it be hard coded or do you need to fetch it? What do you do with the object once you have it?


#5

yes, is for verification and as I understood it has to be an specific route, /.well-known/assetlinks, i think that it can be hard coded and it is only to get the site verified.


#6

Well, these types of auth folders have to be on the server, so your PWA won’t be involved in this. You would simply have to save a json file somewhere on the server and then configure your webserver to serve this as repsonde to that route.

How that works totally depends on the webserver you are using for your backend.


#7

yep, that is what I thought but I was curious about the possibility to return something raw from a route, and I didn’t want to invest time in search on how to do it from apache, maybe a rewrite? thanks anyway