Post not yet marked as solved
This happened before iOS 14, but much less frequently. Since the release of iOS 14, many users have reported to me that songs they add to a playlist through my app take a long time to appear (and sometimes never appear). The web service responds 204 No Content as expected, - https://developer.apple.com/documentation/applemusicapi/libraryplaylistrequesttrack so I'm suspecting that there may be a bug in the backend that handles this service, or in the Music client apps that are not syncing the latest changes to playlists.
I managed to reproduce this here too. All I had to to was to call this endpoint a few times with different tracks and open the Music app to check it out. The tracks sometimes appear as expected. But sometimes they appear on my Mac and don't appear on my iPhone. Sometimes they appear on the iPhone, but not on the iPad. And I even saw one time they appearing on the client apps, but not in the web interface (music.apple.com).
My question is: do I need to do something different on my end after calling this endpoint, or this is a problem with the backend service and/or client applications?
Post not yet marked as solved
I'm testing the new UISwitch.Style to use a native checkbox when running a Catalyst app on macOS.
When the UISwitch is on a view by itself, the conversion from switch to checkbox works fine. But if the checkbox is inside the accessoryView of a UITableViewCell, the conversion doesn't work, neither the checkbox or the switch are rendered.
I created a small sample project to demonstrate what's happening: https://github.com/marcosatanaka/catalyst-switch-test
Is this a Catalyst bug or we should configure switches differently when they're inside table view cells?
Post not yet marked as solved
I'm using the new double column UISplitViewController and a UICollectionView with the new .sidebar appearance as the primary view controller.
To understand how this new API works, I created a sample project and hosted it on Github - https://github.com/marcosatanaka/sidebar-ios14, so you can download and run it to reproduce the problem I'm facing. It was based on the sample code from Implementing Modern Collection Views - https://developer.apple.com/documentation/uikit/views_and_controls/collection_views/implementing_modern_collection_views, specifically, on the OutlineViewController class of the project.
Everything is working fine, the primary and secondary views are shown and I can switch between the views on the sidebar by tapping on them. The problem happens when I open a second app with Split View and adjust the size of the second app by dragging the app divider, so my app stays on the Regular mode, and the second app on Compact mode.
This somehow breaks the layout of the sidebar (and no errors are printed out to the console). Here's a screenshot - https://github.com/marcosatanaka/sidebar-ios14/blob/master/Screenshots/1.jpeg that shows what happens.
If I restart the app, turn the iPad to portrait mode (which changes the layout to Compact), and then turn it to landscape (which changes the layout back to Regular), this is what happens - https://github.com/marcosatanaka/sidebar-ios14/blob/master/Screenshots/2.jpeg to the sidebar. And also, the following auto layout error is printed on the console:
Console - https://developer.apple.com/forums/content/attachment/e1949dd2-6943-40e4-8336-cea33aab26ba
I noticed that if I do not specify a .flexibleWidth for the autoresizingMask of the collection view, this problem stops. But then the style of the selected items on the sidebar no longer works as expected, as we can see on this screenshot - https://github.com/marcosatanaka/sidebar-ios14/blob/master/Screenshots/3.jpeg.
So, is this a bug with the new .sidebar appearance of the collection view, or did I do something wrong when configuring my views?
TL;DROn iOS 13 and Xcode 11, how can I configure an Intent to run in the background and just return the result, so it can be used as the input for other actions in the Shortcuts app?Details of what I'm trying to achieveMy app has a list of songs that I want to expose via Shortcuts (actually, metadata about the song, not the song itself). The idea is to give advanced users a way to integrate this database of music with other apps or actions they want. For example, one may find useful to get a list of upcoming music for the next month, and use it to create Calendar events for each song. Having access to this list on the Shortcuts app can enable them to do this.I have created an Intent called "List All Unread Music Releases" and defined its response as a list of objects that contains information about each song. The problem is, when I go to the Shortcuts app, create a new shortcut using this Intent, and run it, it opens my app instead of running in the background.Steps I've done to create and configure IntentsHere's a high level definition of what I did to configure Intents in the project. The next section will have the actual source code and screenshots.Created a new SiriKit Intent Definition File.Created a new Intent.
Defined it's Title, Description, Parameters, and disabled the "Intent is eligible for Siri Suggestions" checkbox.Defined the response property as an Array (because it's going to be a list of songs), and configured the Output to be this array property.Created a new Intents Extension, with the checkbox "Include UI Extension" disabled. The idea here is to process the user request in the background and return a list with the results - no UI required.In the Intents Extension target, defined the IntentsSupported array inside Info.plist with the name of the intent created in step 2.Made the IntentHandler class implement the protocol generated for the intent created in step 2.Code samples and screenshotsMy SiriKit Intent Definition File and the GetUnreadReleases Intent:https://i.stack.imgur.com/es0PD.pngThe GetUnreadReleases Intent response:https://i.stack.imgur.com/lLSCU.pngThe Intents Extension IntentHandler class:import Intents
class IntentHandler: INExtension, GetUnreadReleasesIntentHandling {
func handle(intent: GetUnreadReleasesIntent, completion: @escaping (GetUnreadReleasesIntentResponse) -> Void) {
let response = GetUnreadReleasesIntentResponse(code: .success, userActivity: nil)
let release1 = IntentRelease(identifier: "1", display: "***** 1")
release1.name = "Name test 1"
release1.artist = "Artist test 1"
response.releases = [release1]
completion(response)
}
func resolveMediaType(for intent: GetUnreadReleasesIntent, with completion: @escaping (IntentMediaTypeResolutionResult) -> Void) {
if intent.mediaType == .unknown {
completion(.needsValue())
} else {
completion(.success(with: intent.mediaType))
}
}
override func handler(for intent: INIntent) -> Any {
// This is the default implementation. If you want different objects to handle different intents,
// you can override this and return the handler you want for that particular intent.
return self
}
}The Intents Extension Info.plist file:https://i.stack.imgur.com/O84u4.pngConclusionSo, I would like this intent to run in the background, assemble the list of songs based on the user defined parameters, and return this list to be used as an input to other actions in the Shortcuts app.It looks like previous versions of the Intents editor (Xcode < 11 / iOS < 13.0) had a checkbox "Supports background execution" that did just that, but I can't find it anymore on Xcode 11.
Post not yet marked as solved
After updating to iOS 13, the following code doesn't work anymore. The completion handler doesn't get called:func requestAccess() {
SKCloudServiceController.requestAuthorization { status in
switch status {
case .authorized:
self.doAfterAuthorized()
case .denied, .restricted:
self.completion?([])
case .notDetermined:
self.completion?([])
@unknown default:
fatalError()
}
}
}I'm on iOS 13 beta 4. I don't know if this is something exclusive to beta 4 or if already happened to older betas.This issue may be related to https://forums.developer.apple.com/thread/119399
Post not yet marked as solved
Hi,Using MusicKit I'm able to get all artists in my library. But these artists come with an id related to my library, not the id of that artist in the Apple Music catalog.I need the artist's catalog id because after getting all artists from my library I want to get all albums from that artist in the Apple Music catalog. And the current endpoint for that only accepts the catalog id of an artist:https://api.music.apple.com/v1/catalog/us/artists/<artistId>So, is there a way to match my library artists id's with the Apple Music catalog artists id's?Related question: https://forums.developer.apple.com/thread/101328