How to show photo credits in Apple News along with caption

111 views Asked by At

We are integrating WordPress with Apple News. We are able to show the photo caption, but we are unable to show photo credits. By Apple News documentation only caption is available. But there are few publisher in AN showing credits too. Any hint will be help full.

https://developer.apple.com/documentation/apple_news/photo#properties

enter image description here

2

There are 2 answers

0
donohoe On

Apple News allows you to do this with HTML and Markdown but you can also avail of inlineTextStyles. Just note where the what position (character count) you want the style to begin and end.

In this case, that first open-bracket begins at character number 23, and closes at character 43.

{
    "role": "caption",
    "text": "The text of the caption (Jane X for Reuters)",
    "textStyle": "default-body",
    "inlineTextStyles": [
        {
            "rangeStart": 23,
            "rangeLength": 43,
            "textStyle": {
                "textColor": "#FF0000",
                "backgroundColor": "#000"
            }
        }
    ]
}

Source: https://developer.apple.com/documentation/apple_news/inlinetextstyle

1
JSilv On

The "caption" property in the Apple News Photo component is actually just there for accessibility purposes / for when the photo is full screen, it doesn't show up beneath the image. What you'll need to do instead is a Caption component beneath the Photo component. You can see an example of this here in the Apple News documentation.