Skip to content

Commit 15fb083

Browse files
authored
docs(unity_ii_deeplink): fix .well-known instructions for static-site (#1473)
The Android and iOS deep-link setup told users to create ii-bridge/public/.ic-assets.json5 with allow_raw_access — a legacy asset-canister config the static-site (certified-assets) canister ignores. Rewrite both to match how certified-assets actually serves .well-known/: - .well-known/ is uploaded automatically — no config needed. Dropped both .ic-assets.json5 steps. - assetlinks.json (.json extension) is served as application/json automatically — Android needs nothing extra. - apple-app-site-association is extensionless and defaults to application/octet-stream; iOS requires application/json, so add a ii-bridge/public/_headers Content-Type override (the certified-assets replacement for the legacy canister's extension inference). Verified on a local static-site deploy: assetlinks.json -> 200 application/json (auto); apple-app-site-association -> 200 application/octet-stream without, application/json with the _headers override. Closes #1461.
1 parent 7425a48 commit 15fb083

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

‎native-apps/unity_ii_deeplink/README.md‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,9 @@ dataNode.SetAttribute("pathPrefix", kAndroidNamespaceURI, "/authorize"); // add
184184

185185
Get the fingerprint with: `keytool -list -v -keystore <your-keystore>.jks`
186186

187-
**4. Create `ii-bridge/public/.ic-assets.json5`** to allow the asset canister to serve the hidden directory:
187+
The static-site canister uploads `.well-known/` automatically and serves `assetlinks.json` as `application/json` (inferred from its `.json` extension), so no extra configuration is needed.
188188

189-
```json5
190-
[{"match": ".well-known/**", "allow_raw_access": true}]
191-
```
192-
193-
**5. Update the callback URL in `ii-bridge/src/main.js`:**
189+
**4. Update the callback URL in `ii-bridge/src/main.js`:**
194190

195191
```js
196192
const url = "https://<your-canister-id>.icp0.io/authorize#delegation=" + ...
@@ -265,13 +261,16 @@ public class iOSPostBuildProcessor
265261

266262
Find your Team ID in the Apple Developer portal. Bundle ID is the one set in Unity Player Settings.
267263

268-
**4. Create `ii-bridge/public/.ic-assets.json5`** (same file as the Android step — works for both):
264+
**4. Create `ii-bridge/public/_headers`** to serve the association file as JSON:
269265

270-
```json5
271-
[{"match": ".well-known/**", "allow_raw_access": true}]
266+
`.well-known/` is uploaded automatically, but because `apple-app-site-association` has no file extension the static-site canister serves it as `application/octet-stream` by default, while iOS requires `application/json`. Override the content type with a `_headers` entry (this is the certified-assets replacement for the legacy asset canister's extension inference):
267+
268+
```
269+
/.well-known/apple-app-site-association
270+
Content-Type: application/json
272271
```
273272

274-
The asset canister must serve `apple-app-site-association` with `Content-Type: application/json`. The ICP asset canister infers this from the missing extension — verify with `curl -I https://<canister-id>.icp0.io/.well-known/apple-app-site-association`.
273+
After redeployment, verify with `curl -I https://<canister-id>.icp0.io/.well-known/apple-app-site-association` (expect `content-type: application/json`).
275274

276275
**5. Update the callback URL in `ii-bridge/src/main.js`:**
277276

0 commit comments

Comments
 (0)