Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Switch to older associated domain format (#1307)
Browse files Browse the repository at this point in the history
* Switch to older associated domain format

* caps
  • Loading branch information
whaught committed Dec 9, 2020
1 parent d334e2a commit 216445b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
11 changes: 2 additions & 9 deletions docs/link_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,8 @@ Sample iOS universal link metadata
"applinks": {
"details": [
{
"appIDs": [
"com.google.test.application"
],
"components": [
{
"/": "/*",
"comment": "handle all urls"
}
]
"appID": "com.google.test.application",
"paths": ["*"]
}
]
}
Expand Down
26 changes: 11 additions & 15 deletions pkg/controller/associated/ios.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,8 @@ type Applinks struct {
}

type Detail struct {
AppIds []string `json:"appIDs,omitempty"`
Components []Component `json:"components,omitempty"`
}

type Component struct {
Path string `json:"/,omitempty"`
Param string `json:"?,omitempty"`
Exclude *bool `json:"exclude,omitempty"`
Comment string `json:"comment,omitempty"`
AppID string `json:"appID,omitempty"`
Paths []string `json:"components,omitempty"`
}

type Appstrings struct {
Expand Down Expand Up @@ -81,14 +74,17 @@ func (c *Controller) getIosData(region string) (*IOSData, error) {
return nil, nil
}

details := make([]Detail, len(ids))
for i, id := range ids {
details[i] = Detail{
AppID: id,
Paths: []string{"*"},
}
}

return &IOSData{
Applinks: Applinks{
Details: []Detail{{
AppIds: ids,
Components: []Component{
{Path: "/*", Comment: "handle all urls"},
}},
},
Details: details,
},
}, nil
}

0 comments on commit 216445b

Please sign in to comment.