Object

LinkAddition

The addition object for defining links in text components that don’t use HTML or Markdown formatting.

Properties

rangeLength
integer
(Required)

The number of text characters to highlight as the link.

rangeStart
integer
(Required)

The starting character index for which the link addition is meant. A range starts at 0 for the first character.

If rangeStart is specified, rangeLength is required.

type
string
(Required)

The type of addition. Use link.

(Required)

The URL to open when a user interacts with the range of text specified in the addition.

Discussion

Use a Link addition to add a link in a text component. You can link to an anchor in the same document, to another document in News, or to an external site.

Example

{ "components": [ { "role": "body", "text": "This is an example of a link addition", "additions": [ { "type": "link", "URL": "http://www.apple.com", "rangeStart": 0, "rangeLength": 20 } ] } ]}

Relationships

Inherits From

See Also

Links

object ComponentLink

The component addition object for making a component interactive and opening a link to another location in News.

object Addition

Properties shared by all addition types.

object ComponentAddition

Properties shared by all types of component additions.

type SupportedURLs

Links that go to Apple News, other Apple apps, and external sites.

type SupportedInternalURLs

Links that go to Apple News and other Apple apps.