Specs/Announcements/0.3.0

From mediawiki.org

This page documents the various configuration options available when defining announcements to be shown in the Wikipedia mobile apps via the featured feed endpoint.

Note: Currently, announcement definitions are hard-coded in MCS as needed and deployed as part of the normal deployment process. Eventually, we plan to set up on-wiki announcement configurations, likely using JsonConfig, so that the app teams can create and update announcements directly without requiring a service deployment by Reading Infrastructure.

Name Type Required Platform version Description Example
id string Y 1 unique (among current announcement objects) ID of the announcement 201809ANDROID
type enum Y 1 announcement type, one of [ 'survey', 'fundraising', 'announcement' ] fundraising
start_time string Y 1 ISO 8601 date/time representing the earliest the announcement should be shown 2018-08-09T20:00:00Z
end_time string Y 1 ISO 8601 date/time representing the latest the announcement should be shown 2018-08-16T20:00:00Z
platforms string[] Y 1 array of platforms on which this announcement should be shown, consisting of one or more of [ 'iOSApp', 'iOSAppV2', 'AndroidApp', 'AndroidAppV2' ] [ 'AndroidAppV2' ]
text string Y 1 body text of the announcment. must NOT be HTML-formatted for iOS v1 (platform 'iOSApp') but may be HTML-formatted for others. '<b>hello</b><br><br>world'
countries string[] Y 1 array of ISO 3166 country codes for countries in which the announcement should be shown. clients will match these to request header GeoIP data. [ 'US', 'CA' ]
action object Y 1 object containing two properties:

- title (string, required) - button text for the action button on the announcement

- url (string, required) - URL to which the user should be directed when the action button is clicked

{ title: 'Foo', url: 'http://example.com' }
image_url string N 1 URL for an image file to be displayed on the announcment card https://upload.wikimedia.org/wikipedia/en/5/5f/Original_Doge_meme.jpg
caption_HTML string N 1 Additional HTML-formatted content to display below the announcement, usually a privacy statement and link to privacy policy. NOTE: Must be <p>-wrapped for iOS v1 (platform 'iOSApp'), and must not be for others. See <a href="https://foundation.wikimedia.org/wiki/Privacy_policy">privacy policy</a>.
negative_text string N 2 text to show on a "negative" button on the announcement. if absent, the button is not shown No thanks
image_height integer N 2 height, in device-independent pixels (dp), of the image portion of the announcement card 48
logged_in boolean N 2 Optional boolean flag controlling whether announcements should be shown based on the user login state.

Set to true if the announcement should be shown only if the user is logged in.

Set to false if the announcement should be shown only if the user is NOT logged in.

If not defined, the announcement will be shown regardless of the user's login state.

true
beta boolean N 2 Optional boolean flag controlling the release builds for which the announcement should be shown.

Android:

Set to true if the announcement should be shown only in pre-production builds (beta, alpha, dev).

Set to false if the announcement should be shown only in release builds.

If not defined, the announcement will be shown for all builds.

iOS:

Not shown if true.

true
reading_list_sync_enabled boolean N 2 Optional boolean flag controlling whether announcements should be shown based on whether the user has enabled reading list syncing.

Android:

Set to true if the announcement should be shown only if the user has enabled reading list syncing.

Set to false if the announcement should be shown only if the user has NOT enabled reading list syncing.

If not defined, the announcement will be shown regardless of whether the user has enabled reading list syncing.

iOS:

Not shown if true.

true