MYBLMusicSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MYBLMusicSDK'
In Appdelegate SDK initilization process with token and call back delegate
import MYBLShadhinSDK
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//received music control from notification bar
application.beginReceivingRemoteControlEvents()
//initilize sdk with token
ShadhinBL.shared.initialize(with: "", delegate: self)
return true
}
Media control setup from AppDelegate
override func remoteControlReceived(with event: UIEvent?) {
if let event = event {
//register event
ShadhinBL.shared.eventRegister(with: event)
}
}
Get Music home controller you need to pass root navigation controller for navigate music conntroller and mini player always visible from any controller.
We provide that direct push to navigation controller
ShadhinBL.shared.gotoHome(with: self.tabBarController, navigationController: self.navigationController!)
There is other feature we implemented that can direct navigate to our controller
ShadhinBL.shared.openPatch(patchID: FeatureType.POPULAR_ARTIST.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)
ShadhinBL.shared.openPatch(patchID:FeatureType.LATEST_RELEASE.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)
ShadhinBL.shared.openPatch(patchID: FeatureType.POPULAR_VIDEO.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)
ShadhinBL.shared.openPatch(patchID: FeatureType.PODCAST.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)
ShadhinBL.shared.openPatch(patchID: FeatureType.AMAR_TUNE.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)
ShadhinBL.shared.openPatch(patchID: FeatureType.AMAR_TUNE_TOP_100.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)
ShadhinBL.shared.gotoRadio(nav: self.navigationController!,tabController: self.tabBarController)
ShadhinBL.shared.stopMusic()
ShadhinBL.shared.playMusic()
ShadhinBL.shared.pauseMusic()
ShadhinBL.shared.clearAllCache()
ShadhinBL.shared.openPatch(patchID: "MjM1OV9QREJD", navigationController: self.navigationController!, tabController: self.tabBarController)
Add App Transport Security to your info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
From your Project target Signing & Capabilities add Background Mood and select 'Audio,Airplay, and picture in picture','Background Processing'
MD Azizur Rahman, azizur.gakk@gmail.com
MYBLMusicSDK is available under the MIT license. See the LICENSE file for more info