Post

Replies

Boosts

Views

Activity

How to make navigation bar color clear per view?
Hi there, I would like to make the navigation bar clear in my view. Currently I am using the init() method to achieve this: UINavigationBar.appearance().setBackgroundImage(UIImage(), for: UIBarMetrics.default) UINavigationBar.appearance().shadowImage = UIImage() UINavigationBar.appearance().isTranslucent = true UINavigationBar.appearance().tintColor = .clear UINavigationBar.appearance().backgroundColor = .clear But this makes the navigation bar clear app-wide. How can I make the navigation bar clear for specific view and ensure that view navigating to other views/popping modal they are returned to the default values? P.S I tried using the onAppear method and that doesn't do anything.
0
0
539
Sep ’21
Artwork of Track is not displayed correctly when used within Button in iOS 16.1 & 16.2
Hi Apple Engineers, I am reporting a issue that has surfaced in iOS 16.1 and iOS 16.2 beta, where when you have a long list of Tracks that are in the label of a Buttons, they are are displayed correctly. They appear intermittently, after you scroll they disappear (placeholder is shown) and it required a state change to display the final artwork correctly Here is code: let tracks = [Track] //With Issue List(tracks) { track in Button { //ACTION BLOCL } label: { if let artwork = track.artwork { ArtworkImage(artwork: artwork, width: 50, height: 50) } else { PlaceholderView() } } } //Without Issue List(tracks) { track in if let artwork = track.artwork { ArtworkImage(artwork: artwork, width: 50, height: 50) } else { PlaceholderView() } } Same code works correctly on iOS 15 and also when ArtworkImage is not used inside a button. Here is the related ticket: FB11840336
0
0
960
Dec ’22
Group Activity stopped working with iOS 15 Beta 2
Hey everyone, I had a sample app I was working on with the first beta which had SharePlay/Group Activity working fine. Beta 2 seems to have broken it. It doesn't trigger any activity. I even tried deleting and reinstalling the app, but that doesn't seem to fix the issue either. Console error print:  Dropping activity as there is no active conversation Any ideas how to fix this issue?
1
0
1.4k
Jun ’21
How to make a playlist public/create a public playlist?
Hey everyone, I am creating playlist via the MusicKit API and by default it creates the playlist in the users library and the isPublic attribute is set to false. Is there a way to make the playlist public at the time of creation? (Only way to change isPublic = true at this time seems to be through the Music app right now)
1
0
2.4k
Apr ’22
How to show AirPlay menu for SystemMusicPlayer in SwiftUI
Hi all, I am trying to understand how to show the AirPlay menu in SwiftUI. My goal is to show the AirPlay menu, the same one displayed in the music app, but programmatically from a SwiftUI Button. I was able to display the AirPlay menu using UIViewRepresentable and MPVolumeView, but that does not show the currently active AirPlay speakers (no checkmarks). So how can I: Show the AirPlay button from a custom SwiftUI button? Show the same AirPlay menu as the one in the Music app, with preselected active speaker?
1
0
2.2k
Nov ’21
How to get recommendations based on multiple tracks?
Hello, I am trying to get recommendations based on the identifier of multiple tracks. But I am unable to get any results Here is the code I have used to try to get recommendations based on one album let dataRequest = MusicDataRequest(urlRequest: URLRequest(url: URL(string: "https://api.music.apple.com/v1/me/recommendations/1571344275")!)) let dataResponse = try await dataRequest.response() For this I am getting the response: Failed to perform MusicDataRequest.Context(   url: https://api.music.apple.com/v1/me/recommendations/1571344275,   currentRetryCounts: [.other: 1] ) with MusicDataRequest.Error(   status: 404,   code: 40400,   title: "Resource Not Found",   detailText: "Resource with requested id was not found", I have tried used the identifier of songs/albums, to no success. What am I doing wrong?
1
0
1.9k
Dec ’21
PlayParameters in iOS 16 breaks backwards compatibility with iOS 15
Hi Apple Engineers, I noticed in iOS 16, PlayParameters which part of every Track that has been added/downloaded to the library, now includes two new properties isLibrary & musicKit_persistentID . Unfortunately, these create backward compatibility error when trying to decode the Track object on iOS 15. I make collaborative playlist app, which stores the Track added by User A which now includes the unique identifier for the locally downloaded file, when attempted to be played by User B won't play any music due to mismatching identifiers (even when everyone is on iOS 16). This essentially breaks the entire functionality of my app due to these new properties. Steps: Store a Track (which has been added to library) as a JSON object from iOS 16 Decode the JSON on iOS 15 Expected Results: New PlayParameters variables should be optional, to support backwards compatibility with iOS 15 and to support collaborative uses cases. Actual Results: New PlayParameters automatically include two new values that cause decoding errors. I request that at least for an option to ignore the new properties in the PlayParameters in iOS 16. Here is my feedback: FB11362589
1
0
1.7k
Aug ’22
Setting ShuffleMode for ApplicationMusicPlayer no longer works in iOS 16.1 & 16.2
Hi Apple Engineers, I am reporting an issue in iOS 16.1 and iOS 16.2 beta 3 where setting the shuffleMode for ApplicationMusicPlayer is no longer working Here is the code: let player = ApplicationMusicPlayer.shared let tracks = [Tracks] player.queue = ApplicationMusicPlayer.Queue(for: tracks) player.state.shuffleMode = .songs Task.init { try await player.play() } I tested the same code on iOS 15 and it works as expected. Here is the related ticket: FB11840279
1
0
767
Dec ’22
How to fetch next batch of albums for an Artist?
Hello, I am fetching and displaying the .fullalbums for an Artist through the MusicKit api. The JSON response returned has a hasNextBatch: true value, but I am unsure how to fetch and display the next batch. Is this something that can be intelligently retrieved though some MusicKit functionality or does one have to perform another data request to fetch the next batch?
2
0
1.2k
Aug ’21
Notification does not show as communication notification
Hi all, I am trying to implement the communication notification for me app. But the avatar does not show and there is virtually no difference from a normal notification. I also added the Communication Notification capability, and in my Notification Service Extension's Info.plist, added this: NSExtension → NSExtensionAttributes (dictionary) → IntentsSupported (array) → INSendMessageIntent (string) What am I doing wrong? Here is my code: class NotificationService: UNNotificationServiceExtension {     var contentHandler: ((UNNotificationContent) -> Void)?     var bestAttemptContent: UNMutableNotificationContent?     override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {                  var personNameComponents = PersonNameComponents()         personNameComponents.nickname = "Sender Name"         let avatar = INImage(named: "Cover")         let senderPerson = INPerson(personHandle: INPersonHandle(value: "1233211234", type: .unknown), nameComponents: personNameComponents, displayName: "Sender Name", image: avatar, contactIdentifier: nil, customIdentifier: nil, isMe: false, suggestionType: .none)         let mePerson = INPerson( personHandle: INPersonHandle(value: "1233211232", type: .unknown), nameComponents: nil, displayName: nil, image: nil, contactIdentifier: nil, customIdentifier: nil, isMe: true, suggestionType: .none)         let incomingMessagingIntent = INSendMessageIntent(recipients: [mePerson], outgoingMessageType: .outgoingMessageText, content: "Test DUde", speakableGroupName: nil, conversationIdentifier: "uid", serviceName: "caset", sender: senderPerson, attachments: [])         incomingMessagingIntent.setImage(avatar, forParameterNamed: \.sender)         let interaction = INInteraction(intent: incomingMessagingIntent, response: nil)         interaction.direction = .incoming         do {             let newContent = try request.content.updating(from: incomingMessagingIntent)             contentHandler(newContent)         } catch {             print(error)         }     }     override func serviceExtensionTimeWillExpire() {         // Called just before the extension will be terminated by the system.         // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.         if let contentHandler = contentHandler, let bestAttemptContent =  bestAttemptContent {             contentHandler(bestAttemptContent)         }     } }
2
0
1.6k
Oct ’21
How to show group name in the subtitle of the Communication Notification?
Hi all, I am trying to display the name of the group in the subtitle of the communication notification, like this: Here is my code:     override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {         self.contentHandler = contentHandler         var personNameComponents = PersonNameComponents()         personNameComponents.nickname = "Test Person"         let avatar = INImage(url: URL(string: "https:imageURL")!)         let senderPerson = INPerson(personHandle: INPersonHandle(value: "1233211234", type: .unknown), nameComponents: personNameComponents, displayName: "Test Person", image: avatar, contactIdentifier: nil, customIdentifier: nil, isMe: false, suggestionType: .none)         let mePerson = INPerson( personHandle: INPersonHandle(value: "1233211232", type: .unknown), nameComponents: nil, displayName: nil, image: nil, contactIdentifier: nil, customIdentifier: nil, isMe: true, suggestionType: .none)         let incomingMessagingIntent = INSendMessageIntent(recipients: [mePerson], outgoingMessageType: .unknown, content: "Test", speakableGroupName: INSpeakableString(spokenPhrase: "Test Group"), conversationIdentifier: "Test Group", serviceName: "Test", sender: senderPerson, attachments: nil)         incomingMessagingIntent.setImage(avatar, forParameterNamed: \.sender)         let interaction = INInteraction(intent: incomingMessagingIntent, response: nil)         interaction.direction = .incoming         do {             let newContent = try request.content.updating(from: incomingMessagingIntent) as! UNMutableNotificationContent             contentHandler(newContent)         } catch {             print(error)         }     } I also have tried: Setting the subtitle of the UNMutableNotificationContent Including the subtitle field in the aps remote notification payload When I display the notification as a normal notification the subtitle is displayed as usual. What am I doing incorrectly?
2
0
2.1k
Oct ’21