Skip to content

shadhin-music/MYBLMusicSDK-iOS

Repository files navigation

MYBLMusicSDK

Version License Platforms Languages Code-Size

Installation

MYBLMusicSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MYBLMusicSDK'

SDK Initilization

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

POPULAR ARTIST

 ShadhinBL.shared.openPatch(patchID: FeatureType.POPULAR_ARTIST.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)

LATEST RELEASE

 ShadhinBL.shared.openPatch(patchID:FeatureType.LATEST_RELEASE.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)

POPULAR VIDEO

 ShadhinBL.shared.openPatch(patchID: FeatureType.POPULAR_VIDEO.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)

PODCAST

 ShadhinBL.shared.openPatch(patchID: FeatureType.PODCAST.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)

AMAR TUNE

ShadhinBL.shared.openPatch(patchID: FeatureType.AMAR_TUNE.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)

AMAR TUNE TOP 100

 ShadhinBL.shared.openPatch(patchID: FeatureType.AMAR_TUNE_TOP_100.rawValue, navigationController: self.navigationController!,tabController: self.tabBarController)

Goto Radio

ShadhinBL.shared.gotoRadio(nav: self.navigationController!,tabController: self.tabBarController)

Stop Music

ShadhinBL.shared.stopMusic()

Play Music

ShadhinBL.shared.playMusic()

Pause Music

ShadhinBL.shared.pauseMusic()

Clear All Cache

ShadhinBL.shared.clearAllCache()

Open RC Code

ShadhinBL.shared.openPatch(patchID: "MjM1OV9QREJD", navigationController: self.navigationController!, tabController: self.tabBarController)

PERMISSION

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'

Author

MD Azizur Rahman, azizur.gakk@gmail.com

Company

Gakk Media

License

MYBLMusicSDK is available under the MIT license. See the LICENSE file for more info