Your audio contents are organized around 3 parts :
track
: tracks are the audio elements you play.
content
: we call content a group of tracks that are related to a same show or program. For example a podcast or audiobook is considered as a content.
section
: a section is a group of contents that you can create on the StayTuned CMS. You can create as many sections as you want to display in your app. A same content can be in different sections.
After calling one of these below methods you will retrieve contents
or sections
class MainActivity : AppCompatActivity() {private fun getSections() {STSections.getInstance()?.getSections(object: STHttpCallback<List<STSections>> {override fun onSuccess(sections: List<STSections>) {println(sections)}override fun onError(error: Throwable) {println(error)}})}private fun getContent() {val contentKey: String = "azeaze-311qsd-qsdaze"STContents.getInstance()?.getContent(contentKey, object: STHttpCallback<STContent> {override fun onSuccess(content: STContent) {println(sections)}override fun onError(error: Throwable) {println(error)}})}
SampleViewController.swiftimport UIKitimport StayTunedSDKclass SampleViewController: UIViewController {private func getSections() {STSections.shared?.getSections(completion: { result inswitch result {case .success(let sections):print(sections)case .failure(let error):print(error)}})}private func getContent() {let contentKey: String = "azeaze-311qsd-qsdaze"STContents.shared?.getContent(by: contentKey, completion: { result inswitch result {case .success(let contents):print(contents)case .failure(let error):print(error)}})}}
JSimport '@staytuned-io/sdk'// List sectionsconst sectionList = await staytunedSDK.STSections.getSections();// List contents (will retrieve light contents)const contentList = await staytunedSDK.STContents.getContents();// Get one content (get full content)const content = await staytunedSDK.STContents.getContent('one-content-key');
TSimport '@staytuned-io/sdk'import { STContentLight } from '@staytuned-io/sdk/dist/types/models/content-light'import { STContent } from '@staytuned-io/sdk/dist/types/models/content'import { STSection } from '@staytuned-io/sdk/dist/types/models/section'// List sectionsconst sectionList: Array<STSection> = await staytunedSDK.STSections.getSections();// List contents (will retrieve light contents)const contentList: Array<STContentLight> = await staytunedSDK.STContents.getContents();// Get one content (get full content)const content: STContent = await staytunedSDK.STContents.getContent('one-content-key');
import { STSection, STSections, STContentLight , STContent, STContents } from "@staytuned-io/cordova-typescript";// list all sectionsconst sections: STSection[] = await STSections.getInstance().getSections();// list all contentsconst contents: STContentLight [] = await STContents.getInstance().getContents();// get a complete content by its keyconst content: STContent = await STContents.getInstance().getContent(contents[0].key);