MacOS Catalina, available now, is a major piece of the puzzle for year of Apple's grand realignment: killing iTunes, nuking legacy app support and making games matter again for Apple computers. The Notification Center resides along the far right side of your display. Normally the Notification Center is hidden, so as not to take up desktop real estate, but you can quickly access it using one of these techniques: The Notification Center includes a menu bar icon located at the far right corner of the menu bar. Clicking or tapping the icon will cause the Notification Center panel to slide out, or slide back to its hidden state. On your Mac, move the pointer over a notification, then do any of the following: Expand or collapse a stack of notifications: If an app’s notifications are grouped, multiple notifications are stacked. To expand the stack and see all of the notifications, click anywhere in the top notification. Searching for Spotify’s notification. Let us try doing the same with Apple Music now. On Catalina, the Music application is located in /System/Applications.Even though we don’t know the.
![]()
With a new macOS update comes new breaking changes. One particular breaking change on Catalina is how observing distributed notifications works.
But first, what are distributed notifications?
Many people will be familiar with the concept of regular notifications. You know, that alert that pops up somewhere on your screen that gives you some information about something.
Distributed notifications are similar to regular notifications (in fact, they send the same
NSNotification structure) but instead of showing them to the user they can be broadcasted to other processes that listen for that particular notification. More generally, distributed notifications are a form of interprocess communication.
What can we use distributed notifications for?
One very useful notification that iTunes issues is the
com.apple.iTunes.playerInfo notification. This notification is issued whenever the user changes the state of the current track including when they stop playing or select a new track. Associated with the notification is a bunch of useful fields about the change such as the track name, artist, and total track length.
By registering an observer to this notification I created an iTunes Discord Rich Presence client that automatically updates what song I am currently playing (somewhat similar to Spotify’s Rich Presence).
The main benefit of this compared to polling the iTunes player state with AppleScript is that it uses less processor time and is hence more energy efficient.
The problem with macOS Catalina
Catalina replaced the beloved iTunes application with Apple Music (which is incidentally a lot slower and laggier but that is a story for another time). Of course, that means the name of any iTunes related distributed notifications have changed.
The fix is simple. Just replace the old notification name with the new one. One of the parameters for registering the notification observer is:
notificationName
The name of the notification for which to register the observer; that is, only notifications with this name are delivered to the observer. When
nil , the notification center doesn’t use a notification’s name to decide whether to deliver it to the observer.
Perfect! All we have to do is leave the name as
nil and that will let us listen to all of the distributed notifications. Then we just have to find the one emitted by changing a track.
All right, let’s start it up and wait for all the data to pour in.
Nothing’s happening?
Here is a hint. The problem isn’t with my code. This method does not work on macOS Catalina. The behaviour of the
addObserver method has changed so that leaving the name asnil will do nothing if the process is not privileged. Incidentally, running the code under sudo does not seem to make it work either.
Finding the name of the notification
At first I considered two main options:
The former option was quickly ruled out when
dtruss (a system call tracer) failed to start due to System Integrity Protection (and I could not be bothered turning it off). The latter option seemed quite feasible but when I did the math:
Yeah, that is not going to work.
That is when I realised there was another option that finds a lot of use in reverse engineering: analysing the executable itself. Since the notification name is a string we can use the strings tool to find all the strings in the executable.
Spotify Notifications Mac Catalina Mac
To test out my idea I tried running
strings on Spotify first. The bulk of the actual executable is located inside of the application bundle at: Contents/MacOS/Spotify . We know that one of Spotify’s notification names iscom.spotify.client.PlaybackStateChanged so we can match that against the output from strings Spotify :
Great! Let us try doing the same with Apple Music now.
On Catalina the Music application is located in
/System/Applications . Even though we don’t know the exact name of the notification we can filter out a lot of the strings by matching against com.apple.Music . It seems that all of the notifications have to contain the application’s bundle identifier.
Samsung tv apps. One of those names looks suspiciously similar to an iTunes notification. In particular:
com.apple.Music.playerInfo . Let’s try it out!
Brilliant! We finally get some data printed out. It is a little bit different from the iTunes notification (for example, there is no
Display Line 0 field anymore) but fixing that is a comparatively easy task.
In summary
Ideally, Apple should update the documentation to reflect this change in behaviour but it seems that it is too niche to warrant a mention. I am just glad I got my Music Rich Presence working again.
Although I love and adore music, I tend to get distracted when one of my favorite music streaming apps Spotify automatically opens up on startup in Mac. Here, selecting the right playlist becomes more important than my office tasks. Does that happen to you as well? Then you need to stop Spotify from opening on Mac startup.
How to Stop Spotify From Opening Automatically on Mac Startup
Quite like the feature of upgrading to Spotify premium, the app does not keep the said setting handy. It was after some poking around that I found the setting. In doing so, I found a setting perfectly suited to my case.
As I mentioned, I love music and tend to get distracted when Spotify pops up. So, instead of preventing Spotify from opening on startup, I can choose it to start and minimize on my Dock. This way, the app remains always approachable, without distracting.
Step #1. Open the Spotify app on your Mac.
Step #2.Log in to the app (skip the step if already logged in).
Step #3. Select Spotify from the top menu (next to Apple logo on Mac) and click on Preferences.
How to download music on laptop from spotify. Step #4. Scroll down to the bottom of the page and select Show Advanced Settings.
Step #5. Now, scroll up to Startup and Window Behavior setting.
Step #6. From the drop down menu in front of Open Spotify automatically after you log into the computer, select
Spotify Notifications Mac Catalina Patcher
Spotify Notifications Mac Catalina Installer
In case, this method does not work for you, there’s another method you can try.
Change System Settings to Prevent Spotify from Opening on Mac Startup
So basically, your system keeps the log of apps that automatically open during the startup. This log might be pushing your Spotify app to open during every boot. All you need to do is remove Spotify from the list.
Step #1. Tap on Apple () icon and select System Preferences from the menu.
Step #2. Select Users & Groups.
Step #3. Here, switch to Login Items tab from the top bar.
Step #4. Select Spotify and click on Minus(-) from the bottom of the page.
You can also check the hide option; this will hide the application when you turn on your computer.
That’s all folks!!
In the world of music streaming, Spotify stands tall amongst its competitors. However, it is some small user-interface related issues that holds the app back. While no setting is difficult, finding and reaching that particular setting is a laborius process. For instance, you can only upgrade or delete your spotify account permanently via web.
While I wish Spotify takes heed of such issue and simplify these task.
Here are some more Spotify tutorials for you:-
Jignesh Padhiyar is the co-founder of iGeeksBlog.com who has a keen eye for news, rumors and all the unusual stuff that happens around Apple products. During his tight schedule, Jignesh finds some moments of respite to share side-splitting contents on social media.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |