Reputation: 777
Does someone know how to verify a domain with Apple using React.js at the url mydomain.com/.well-known/apple-developer-merchantid-domain-association.txt
I tried to create the .well-known folder in public folder and put the apple-developer-merchantid-domain-association.txt file inside. I'm able to access the file (just access, not download) but the verification still fail on Apple website. Does someone has an other solution ?
I also made a custom route like this
<Route path="/.well-known/apple-developer-merchantid-domain-association.txt" render={() => (
<link rel="apple-developer-merchantid-domain-association.txt file" href="%PUBLIC_URL%/.well-known/apple-developer-merchantid-domain-association.txt" />
)}
Upvotes: 1
Views: 4346
Reputation: 41
Make one directory in public directory of you repo. With name ".well-known" then add the "apple-developer-merchantid-domain-association" file inside it. This file is accessible then.
public > .well-known > apple-developer-merchantid-domain-association
Upvotes: 2
Reputation: 79
What I did on my react app, hosted on heroku with Stripe (which provides Apple Pay) :
"build": "react-scripts build"
.
Add "mkdir -p ./build/.well-known && cp ./applepay/apple-developer-merchantid-domain-association ./build/.well-known/"
.
It will create during the build an new directory (mkdir) and copy (cp) the verification file inside it."scripts": {
...,
"build": "react-scripts build && mkdir -p ./build/.well-known && cp ./applepay/apple-developer-merchantid-domain-association ./build/.well-known/",
...,
},
I hope it helped!
Upvotes: 7