OSX Notification Center Icon

后端 未结 9 696
渐次进展
渐次进展 2020-12-03 01:42

I\'m using OSX\'s Notification Center APIs for the first time and can\'t seem to figure out how to make my app\'s icon to show up in the Notification badge.

The defa

相关标签:
9条回答
  • 2020-12-03 01:46

    There's actually an ongoing debate on Apple's developer forums (link, link for people with access) about this. As far as I know, there's currently no real solution, but you can try the following:

    • Change your app's bundle ID and try it again. If you change it, clean your app, and change back, some people have reported success with seeing their icon show up.
    • Log in as another user. The caching Notification Center uses may be per-user, so you might be able to get the properly-iconned notifications as a different person.
    0 讨论(0)
  • 2020-12-03 01:49

    The folder location has been moved for OSX 10.10+.

    Following command takes to you to its new location:

    $ cd `getconf DARWIN_USER_DIR`/com.apple.notificationcenter/db               
    

    and then

    $ open .
    
    0 讨论(0)
  • 2020-12-03 01:51

    Easiest way that I managed to get the icon to show up is change the Bundle Identifier in your project. This works on OSX 10.10.5 and XCode 7.2

    (Once notification center picks up the change, you can change it back to your original bundle identifier if you already have a provisioning profile associated with it)

    0 讨论(0)
  • 2020-12-03 01:58

    I have solved the issue by archiving my app and adding a copy to my applications folder. When the app is in Application folder, the icon is always visible even you run the app from XCode...

    0 讨论(0)
  • 2020-12-03 01:58

    I tried all of the above suggestions but the only thing that worked for me on 10.14 was to delete DerivedData:

    rm -rf ~/Library/Developer/Xcode/DerivedData

    0 讨论(0)
  • 2020-12-03 02:00

    I was able to fix this issue by incrementing the Build number in the General section for the build Target.

    0 讨论(0)
提交回复
热议问题