Previous: Adori iOS SDK: SDK Modules
All the steps in this page are mandatory for successful integration of the Adori iOS SDK.
โ
Steps
1.1 Import the dependencies
1 2 | import AdoriPlayerUI import AdoriAPIService |
1.2 Conform to AdoriPlayerDelegate
1 2 3 | class ViewController: UIViewController, AdoriPlayerDelegate { } |
1.3 Setup Adori Player SDK configuration
Call setupSDK with the brand color and a secondary color
1 2 3 4 5 6 | AdoriPlayer.shared.setupSDK( brandColor: "#808080", secondaryColor: "#FFFFFF", requiresPlayerView: *true*, parent: *self* ) |
Setup the conformance to the player delegate
1 | AdoriPlayer.shared.playerDelegate = self |
If you have a login setup, call the
setUserId
If this is not set and the user clicks on an interaction, for eg. a like button etc, the user will be shown a snack bar with a message to login, handle in the showLogin()
function when that happens
1 | AdoriPlayer.shared.setUserId(userId: "user_XYZ") |
When an episode is clicked, call the
playEpisode
with the below details
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | AdoriPlayer.shared.playEpisode( uid: "IRATvhWXzWyt3kT4", name: "The Candid Frame podcast: An interactive snippet", audioUrl: "https://static.adorilabs.com/audiotracks/v1/1117-IRATvhWXzWyt3kT4_adorified.mp3", imageUrl: "https://cdn.images.adorilabs.com/v1/5ea65178-e28e-4eeb-a0e0-8d8f6fcadc4f.jpeg", showName: "Adori Demos: Interactive Podcast Snippets", showImageThumbnailUrl: "https://cdn.images.adorilabs.com/v1/7b76e5b6-98c1-44a9-a02c-89da2f607893_th.jpeg", durationMillis: 119985, isLiked: *false*, isPlaylisted: *false*, startTime: 0, stopTime: -1, isBookmarkClip: *false*, parentVC: *self* ) |
Next Up: Adori iOS SDK: Sample App