Reputation: 656
I'm trying to integrate the universal link in my iOS app. In order to test, I configured a sample Django application on Heroku and added the apple-app-site association file to the root of the application.
GET request to domain_url/apple-app-site-association provides the following result
{
"applinks": {
"apps": [],
"details": [
{
"appID": "XXXXXXXXXX.com.app.myapp",
"paths": ["*"]
}
]
}
}
Following is the code in python that serves the request
path = os.path.join(os.getcwd(), 'apple-app-site-association')
with open(path , 'r') as myfile:
data=myfile.read()
response = HttpResponse(content=data)
response['Content-Type'] = 'application/json'
return response
I tried the branch.io validator with my server URL and it was fine.
But https://search.developer.apple.com/appsearch-validation-tool/ is returning the following response
Error no apps with domain entitlements The entitlement data used to verify deep link dual authentication is from the current released version of your app. This data may take 48 hours to update.
I configured the associated domain and updated the profiles. I tried opening the app on iPhone by clicking the link in both the mail app and notes app. But the link is opening to Safari, not the app.
I tried reinstalling the app. But nothing works. Where did I go wrong?
Any help will be appreciated.
Upvotes: 1
Views: 921
Reputation: 537
An easier way is to just render a template as JSON
at a URL. Below is an example:
from django.views.generic.base import TemplateView
path('.well-known/apple-app-site-association', TemplateView.as_view(template_name='frontend/apple-app-site-association', content_type='application/json',)),
Then you can just put the file in your templates folder.
Upvotes: 5