Skip to content

Commit

Permalink
Fix crashing issue on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinlesceller committed Apr 1, 2022
1 parent 105350f commit 73b095c
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions MacMediaKeyForwarder/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -368,26 +368,6 @@ - ( void ) applicationDidFinishLaunching : ( NSNotification*) theNotification
if ( eventPort != NULL )
{

// Check if permission is granted to send AppleEvents to the running app target, and prompt if not set
if ( @available(macOS 10.14, *) )
{

iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:[self iTunesBundleIdentifier]];
SpotifyApplication *spotify = [SBApplication applicationWithBundleIdentifier:@"com.spotify.client"];

if ( spotify != nil )
{
NSAppleEventDescriptor *targetAppEventDescriptor = [NSAppleEventDescriptor descriptorWithBundleIdentifier:@"com.spotify.client"];
AEDeterminePermissionToAutomateTarget([targetAppEventDescriptor aeDesc], typeWildCard, typeWildCard, true);
}

if ( iTunes != nil )
{
NSAppleEventDescriptor *targetAppEventDescriptor = [NSAppleEventDescriptor descriptorWithBundleIdentifier:[self iTunesBundleIdentifier]];
AEDeterminePermissionToAutomateTarget([targetAppEventDescriptor aeDesc], typeWildCard, typeWildCard, true);
}
}

eventPortSource = CFMachPortCreateRunLoopSource( kCFAllocatorSystemDefault, eventPort, 0 );

[self startEventSession];
Expand Down

0 comments on commit 73b095c

Please sign in to comment.