# Nonstop Swift SDK

## Complete Content

Complete Content allows the client app to query for information regarding the current stream, as well as record a Complete Content task internally.

Generally this is used to integrate Nonstop information into End Card scenarios for Episodes and Movies.

`completeContent` should be called when the client app needs to present information on completing a piece of content to the logged in user:

* Reaches the end card of a movie
* Reaches the end card of an episode
* Reaches the end card of a VPPO clip
* Reaches the end card of a ShowMS clip
* Note: there are no end cards on Live so no `completeContent` should be called

Parameters:

* **contentId** - Pass the Partner API Id

Syntax:

```swift
Nonstop.sharedInstance.completeContent(contentId: "VDKA4220171").subscribe { event in
    switch event {
    case .success (let report):
        // Report contains details of the users activity
    case .error (let error):

    }
}.disposed(by: disposables)
```

### Report object

The report object contains the following properties:

* ```contentTitle: String?``` - The title of the Content the points were earned on - for Movies the Movie title for Shows the name of the Show
* ```contentId: String?``` - The ID of the Content the points were earned on
* ```episodeTitle: String?``` - If the content was an Episode, the title of the Episode
* ```episodeNumber: Int?``` - If the content was an Episode, the title of the Episode
* ```seasonNumber: Int?``` - If the content was an Episode, the title of the Episode
* ```logoImageUrl: String?``` - The logo for the content, if available
* ```backgroundImageUrl: String?``` - The background image for the content, if available
* ```previousPoints: Int?``` - The points the user had when they started this Watch & Earn stream
* ```previousPointsDisplay: String``` - The points the user had when they started this Watch & Earn stream, correctly formatted for display to the user
* ```newPoints: Int?``` - The points the user has now
* ```newPointsDisplay: String``` - The points the user has now, correctly formatted for display to the user
* ```pointsEarned: Int?``` - The points the user earned for this stream
* ```pointsEarnedDisplay: String``` - The points the user earned for this stream, correctly formatted for display to the user
* ```minutesWatched: Int?``` - The number of minutes the user watched
* ```minutesWatchedDisplay: String``` - The number of minutes the user watched, correctly formatted for display to the user
* ```animation: LOTAnimationView?``` - The animation to integrate into your UI

If `pointsEarned` equals 0 then the client app should not present anything Nonstop related to the user.
