I am trying to play songs on iOS 14 using Apple Music API. I have the developer's token, and I have asked for the permission for accessing the user's apple music.
However, when I call requestusertoken api, - https://developer.apple.com/documentation/storekit/skcloudservicecontroller/2909079-requestusertoken its closure never gets called, so obviously I don't receive anything from the request - not even an error. It's driving me crazy!!
Here is my code. What am I doing wrong?
func getUserToken() -> String {
var userToken = String()
let lock = DispatchSemaphore(value: 0)
SKCloudServiceController().requestUserToken(forDeveloperToken: developerToken) { (receivedToken, error) in
		guard error == nil else { return }
		if let token = receivedToken {
				userToken = token
				lock.signal()
		}
}
lock.wait()
return userToken
}
Post
Replies
Boosts
Views
Activity
Hi, I recently got new airpods pro .
It works fine on my iPhone 8 (iOS 14)
but when I use it on my macbook air (macOS 11) the sound quality gets really really poor after several minutes.
Is this a known macOS big sur bug?
Or is something wrong with my new Airpods Pro?
Hi, I'm looking for a way to send a post request to my server whenever my iOS app gets an update from core motion activity manager about user's current activity type.
I want this to happen when the app is in both the foreground and the background mode.
Because my app also involves playing music player, I was hoping to be able to make the post request mentioned above while the music is playing in background mode.
Could you please help me out and suggest ways I could make this work?
I updated by macbook air to Big Sur.
Whenever I have my xcode simulator running or turned on, my macbook speaker sound breaks up.
If I turn off my simulator, the sound comes out fine.
Is this a known bug?
I can't seem to add constraints on stack views.
Only the bottom constraint option is turned on and all other constraint options(top, right, left) are not selectable.
Also I can't seem to align my stack view horizontally or vertically at center to the root view.
Is there a special way to apply constraints to a stack view?
Or is this a bug in xcode 12?
Using this recently played resources API - https://developer.apple.com/documentation/applemusicapi/get_recently_played_resources , I get up to 10 resources that were recently played.
However I want as many recently played resources as I can, so I tried using the limit=(int) query parameter, as described in the official document.
However, it's not working.
Using the limit=(int) query parameter for 10 (or below) songs is working :
https://api.music.apple.com/v1/me/recent/played?limit=10
but anything above 10 is not:
https://api.music.apple.com/v1/me/recent/played?limit=15
or
https://api.music.apple.com/v1/me/recent/played?limit=20
How can I get more than 10 resources?
application(didReceiveRemoteNotification: fetchCompletionHandler:) is not called in background upon silent push.
The method is called only after the user manually opens the app.
Anyone know how to resolve this?
I'm currently on iOS 15.1.1