ArticleState
: string
in package
Article processing states returned by the Apple News API.
Represents the current state of an article in the Apple News publishing pipeline. Use the helper methods to check common state conditions.
Tags
Table of Contents
Cases
- DUPLICATE = 'DUPLICATE'
- The article is a duplicate of another article and isn't visible in the News app.
- FAILED_PROCESSING = 'FAILED_PROCESSING'
- The article failed during processing and isn't visible in the News app.
- FAILED_PROCESSING_UPDATE = 'FAILED_PROCESSING_UPDATE'
- A previous version of the article is visible in the News app, but an update failed during processing.
- LIVE = 'LIVE'
- The article has been published, has finished processing, and is visible in the News app.
- PROCESSING = 'PROCESSING'
- The article has been published and is processing.
- PROCESSING_UPDATE = 'PROCESSING_UPDATE'
- A previous version of the article is visible in the News app, and an update is currently in processing.
- TAKEN_DOWN = 'TAKEN_DOWN'
- The article was previously visible in the News app, but was taken down.
Methods
- hasFailed() : bool
- Check if the article processing has failed.
- isLive() : bool
- Check if the article is currently visible in the News app.
- isProcessing() : bool
- Check if the article is currently being processed.
Cases
PROCESSING
The article has been published and is processing.
LIVE
The article has been published, has finished processing, and is visible in the News app.
PROCESSING_UPDATE
A previous version of the article is visible in the News app, and an update is currently in processing.
TAKEN_DOWN
The article was previously visible in the News app, but was taken down.
FAILED_PROCESSING
The article failed during processing and isn't visible in the News app.
FAILED_PROCESSING_UPDATE
A previous version of the article is visible in the News app, but an update failed during processing.
DUPLICATE
The article is a duplicate of another article and isn't visible in the News app.
Methods
hasFailed()
Check if the article processing has failed.
public
hasFailed() : bool
Returns true for FAILED_PROCESSING and FAILED_PROCESSING_UPDATE states.
Return values
bool —True if the article failed to process.
isLive()
Check if the article is currently visible in the News app.
public
isLive() : bool
Returns true for LIVE and PROCESSING_UPDATE states, as both indicate that some version of the article is publicly accessible.
Return values
bool —True if the article is visible to users.
isProcessing()
Check if the article is currently being processed.
public
isProcessing() : bool
Returns true for PROCESSING and PROCESSING_UPDATE states.
Return values
bool —True if the article is in a processing state.