Posts

Post not yet marked as solved
0 Replies
306 Views
basically i'm having two modes for my application first one play application music and second one play music of application as well as other application.....when i switch between them some times it is confuse and not able to play correct musicdo { if sound > 1 { //1st mode play with app sound if !FromStart { print("sound > 1", self.audioEngine.isRunning) self.audioEngine.stop() self.audioEngine.reset() try AVAudioSession.sharedInstance().setActive(false) try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) try AVAudioSession.sharedInstance().setActive(true) // sleep(1) //try self.audioEngine.start() do { // 3 try self.audioEngine.start() } catch let error { print("error sound > 1",error.localizedDescription) } if !FromStart { self.PlayNewButtonSound() } } } else if sound > 0 { //2nd mode play with other app sound if !FromStart { self.audioEngine.stop() } //print("sound > 0", self.audioEngine.isRunning) try AVAudioSession.sharedInstance().setActive(false) try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with: [.mixWithOthers]) try AVAudioSession.sharedInstance().setActive(true) //try self.audioEngine.start() do { // 3 try self.audioEngine.start() } catch let error { print("error > 0",error.localizedDescription) } self.skHomesound?.run(SKAction.stop()) if !FromStart { self.PlayNewButtonSound() } } } catch { print("Problem with enable sound error = \(error.localizedDescription)") }
Posted Last updated
.
Post not yet marked as solved
0 Replies
629 Views
Error Domain=GKServerErrorDomain Code=5053 "status = 5053, Leaderboard does not exist, but i'm having that leaderboard and that leaderboard working perfectly on testflight build but when i execute from xcode it show leaderboard does not exist@objc func GetTop25TimeFromLeaderboard() { if self.gcEnabled == false { NotificationCenter.default.post(Notification.init(name: Notification.Name(rawValue: "setDataforLeaderBoard"), object: nil, userInfo: ["Success":false])) self.authenticateLocalPlayer() } let request = GKLeaderboard() request.identifier = Constants.TIME_LEADERBOARD_ID request.playerScope = .global request.timeScope = .allTime request.range = NSMakeRange(1, 25) request.loadScores { (scores, err) in if(err != nil) { print("error occur fetch") print(err as Any) NotificationCenter.default.post(Notification.init(name: Notification.Name(rawValue: "setDataforLeaderBoard"), object: nil, userInfo: ["Success":false])) return } }}
Posted Last updated
.