Post

Replies

Boosts

Views

Activity

Reply to Any way to check if song is in Library with MusicKit? ?relate=library not working for me
Hi Joe, Thanks for responding! I tripple checked and appleMusic is indeed the identifier of a Song object so not sure what's happening there. As in regards to your second request, here is how I'm currently checking in the MPMediaLibrary func checkInLocalLib(with id: String) {         let query = MPMediaQuery.songs()         let allSongs = query.items! as [MPMediaItem]         if allSongs.isEmpty == false {             let matchedSong = allSongs.filter { $0.playbackStoreID == id }             if matchedSong.isEmpty {                 currentSongInLibrary = false             } else {                 currentSongInLibrary = true             }         }     }
Topic: Media Technologies SubTopic: General Tags:
Dec ’21
Reply to Request content in a specific locale?
Hi Joe, Thank you for taking the time to respond. Bundle.main.preferredLocalizations = ["en"] Bundle.main.localizations = ["de", "es", "nl", "pt-PT", "en", "Base"] Bundle.main.developmentLocalization = Optional("en") MusicDataRequest.currentCountryCode = nl This is what I get back from the code snippet above. I used to support more languages but I've removed them. Looking at this response I noticed they were still considered to be active so I investigated it and noticed I still had some localized visuals. After removing them it seems to be fixed :) Maybe it's an idea that MusicKit looks at the Bundle.main.preferredLocalizations instead of the Bundle.main.localizations? Anyway, thank you so much for this pointer :)
Topic: Media Technologies SubTopic: General Tags:
May ’22
Reply to SwiftUI with RoomPlan ?
You can use a UIViewRepresentable together with a singleton, not sure if this is the best way to do so but it works for me :) here's a quick example: Model (here you setup your RoomCaptureView) final class Model : ObservableObject, RoomCaptureViewDelegate { static var shared = Model() @Published var roomCaptureView : RoomCaptureView var captureSessionConfig : RoomCaptureSession.Configuration init() { roomCaptureView = RoomCaptureView(frame: .zero) captureSessionConfig = RoomCaptureSession.Configuration() } func startSession() { roomCaptureView.captureSession.run(configuration: captureSessionConfig) } func stopSession() { roomCaptureView.captureSession.stop() } func captureView(shouldPresent roomDataForProcessing: CapturedRoomData, error: Error?) -> Bool { return true } // Here you will get the final post-processed results. func captureView(didPresent processedResult: CapturedRoom, error: Error?) { if let error = error { print("Error: \(error)") } } } UIViewRepresentable struct RoomCaptureRep: UIViewRepresentable { func makeUIView(context: Context) -> RoomCaptureView { return Model.shared.roomCaptureView } func updateUIView(_ uiView: RoomCaptureView, context: Context) { } } Usage struct CoolRoomPlanView : View { @StateObject var model = Model.shared var body : some View { ZStack { RoomCaptureRep() Button { model.startSession() } label: { Text( "Start") } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to Getting WeatherKit error WeatherDaemon.WDSJWTAuthenticatorService.Errors
Not sure if you're having any other targets that use the WeatherKit data, but did you make sure you've enabled WeatherKit in Capabilities in your project and the App Services tap in the developer portal for all targets? Because I was fighting this issue for a while and then realized I didn't enable it for my widget Bundle ID in the developer portal, haha
Topic: App & System Services SubTopic: General Tags:
Aug ’22
Reply to List of Genre IDs?
Fair enough! I ran it with let request = MusicCatalogResourceRequest<Genre>(matching: \.id, equalTo: MusicItemID(genreID)) and found some but feels like a lot are missing (compared to the ones I get from Song.genreNames)
Topic: Media Technologies SubTopic: General Tags:
Nov ’22
Reply to Any way to check if song is in Library with MusicKit? ?relate=library not working for me
Hi Joe, Thanks for responding! I tripple checked and appleMusic is indeed the identifier of a Song object so not sure what's happening there. As in regards to your second request, here is how I'm currently checking in the MPMediaLibrary func checkInLocalLib(with id: String) {         let query = MPMediaQuery.songs()         let allSongs = query.items! as [MPMediaItem]         if allSongs.isEmpty == false {             let matchedSong = allSongs.filter { $0.playbackStoreID == id }             if matchedSong.isEmpty {                 currentSongInLibrary = false             } else {                 currentSongInLibrary = true             }         }     }
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Any way to check if song is in Library with MusicKit? ?relate=library not working for me
Submitted feedback: FB9823513
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to MusicSubscriptionOffer can't be presented without Apple Music App
I also noticed if you have the button that will present the musicSubscriptionOffer use .toggle() instead of = true and you tap that button twice it will make your app crash 😅
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to How do I access lyrics in MusicKit or Apple Music Catalog
Aah I was afraid this would be the case, will submit feedback! Thanks for responding :)
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Microphone feedback noise and can I use the output to recognise?
See comments (also, how do I delete this comment? haha)
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to What's the easiest way to check when user has downloaded your app?
Thanks Rich for this clear and extensive answer 😊 However, I do agree with SuperWomble, this is quite a common situation to be in as a developer where you want to change business model so a simple API in StoreKit 2 would make a lot of sense. I’ll file a feedback item to request this
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to Request content in a specific locale?
Hi Joe, Thank you for taking the time to respond. Bundle.main.preferredLocalizations = ["en"] Bundle.main.localizations = ["de", "es", "nl", "pt-PT", "en", "Base"] Bundle.main.developmentLocalization = Optional("en") MusicDataRequest.currentCountryCode = nl This is what I get back from the code snippet above. I used to support more languages but I've removed them. Looking at this response I noticed they were still considered to be active so I investigated it and noticed I still had some localized visuals. After removing them it seems to be fixed :) Maybe it's an idea that MusicKit looks at the Bundle.main.preferredLocalizations instead of the Bundle.main.localizations? Anyway, thank you so much for this pointer :)
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to What's the easiest way to check when user has downloaded your app?
New API solves this! 😄 https://developer.apple.com/documentation/storekit/apptransaction?changes=latest_minor
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to SwiftUI with RoomPlan ?
You can use a UIViewRepresentable together with a singleton, not sure if this is the best way to do so but it works for me :) here's a quick example: Model (here you setup your RoomCaptureView) final class Model : ObservableObject, RoomCaptureViewDelegate { static var shared = Model() @Published var roomCaptureView : RoomCaptureView var captureSessionConfig : RoomCaptureSession.Configuration init() { roomCaptureView = RoomCaptureView(frame: .zero) captureSessionConfig = RoomCaptureSession.Configuration() } func startSession() { roomCaptureView.captureSession.run(configuration: captureSessionConfig) } func stopSession() { roomCaptureView.captureSession.stop() } func captureView(shouldPresent roomDataForProcessing: CapturedRoomData, error: Error?) -> Bool { return true } // Here you will get the final post-processed results. func captureView(didPresent processedResult: CapturedRoom, error: Error?) { if let error = error { print("Error: \(error)") } } } UIViewRepresentable struct RoomCaptureRep: UIViewRepresentable { func makeUIView(context: Context) -> RoomCaptureView { return Model.shared.roomCaptureView } func updateUIView(_ uiView: RoomCaptureView, context: Context) { } } Usage struct CoolRoomPlanView : View { @StateObject var model = Model.shared var body : some View { ZStack { RoomCaptureRep() Button { model.startSession() } label: { Text( "Start") } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Audio crashes when connected to AirPods
It seem to have removed the ShazamKit crashes but I am getting this error now:
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Is it possible to get a certainty of the match ShazamKit gives?
I did :) I couldn't find ShazamKit as a topic in the Feedback app so it's here: FB10660773
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Changing the images and tint of the icons provided by NavigationSplitView
The problem is that I need the tint colour of those icons to be dynamic (they match the Artwork), and also my AccentColor is currently green and being ignored :(
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Getting WeatherKit error WeatherDaemon.WDSJWTAuthenticatorService.Errors
Not sure if you're having any other targets that use the WeatherKit data, but did you make sure you've enabled WeatherKit in Capabilities in your project and the App Services tap in the developer portal for all targets? Because I was fighting this issue for a while and then realized I didn't enable it for my widget Bundle ID in the developer portal, haha
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to iCloud error: Sync Error: The operation couldn't be completed. CKErrorDomain error 2.
Did you find any solutions for this by any chance?
Replies
Boosts
Views
Activity
Sep ’22
Reply to List of Genre IDs?
Fair enough! I ran it with let request = MusicCatalogResourceRequest<Genre>(matching: \.id, equalTo: MusicItemID(genreID)) and found some but feels like a lot are missing (compared to the ones I get from Song.genreNames)
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’22