Hello all,
First post in the forums! I hope this question has not been answered already and I missed it. If it has, I apologize in advance.
I downloaded the Shiny demo code. I updated the AccountManager to use my domain. I placed the required file on my server in the .well-known folder. Here is my code. Note: I replaced example with my real domain.
{
"applinks": {
"details": [
{
"appIDs": [ "CC8JC8QC9K.com.example.Shiny" ],
}
]
},
"webcredentials": {
"apps": [ "CC8JC8QC9K.com.example.Shiny" ]
}
}
One thing I'm not clear on is what applinks are and if it is even needed for this service or not. In either case, I went ahead and included it.
I added webcredentials:example.com
to the Associated domains section under Signing Capabilities for my target. Again, example is replaced with my domain. I also included applinks:example.com
since I don't fully understand the importance of that just yet.
I have enabled Associated Domain for the app in my developer account and imported the AuthenticationServices framework into the project.
When I run the app I get the following errors.
2023-03-30 15:57:43.005597-0500 Shiny[64202:1563051] [Authorization] ASAuthorizationController credential request failed with error: Error Domain=com.apple.AuthenticationServices.AuthorizationError Code=1001 "(null)" 2023-03-30 15:57:43.007370-0500 Shiny[64202:1562730] Request canceled.
I also noticed this in the sample code.
// Fetch the challenge from the server. The challenge needs to be unique for each request.
let challenge = Data()
Am I supposed to be doing something on my server? If so, where? I'm just not grasping why an Apple service such as this even relies on the developer's server to begin with.
A couple of final things to mention just in case it is relevant.
- I have a wildcard domain.
- My site uses a www redirect.
- I do use https://
What am I missing? Any help would be greatly appreciated!