Change OSX Notification Center icon at runtime - macos

Is there (now) a officially supported way to change the OSX Notification Center's Icon for NSUserNotifications while my App is running?
I searched the web, but the answers weren't really "recent", so I just wanted to double check.
I'd like to show the currently playing spotify track's Artwork next to it's title / name
What I tried until now is really ugly:
temporarily replacing the CFBundleIconFile of my app with a IconFamily generated .icns file (I know i shouldn't modify anthing inside the bundle, but I'm not aiming to get the app to the App Store)
restart Notification Center to "forget" it's eventually cached icons
NSRunningApplication* notificationCenter = [NSRunningApplication runningApplicationsWithBundleIdentifier:#"com.apple.notificationcenterui"];
[notificationCenter terminate];
(i know I REALLY SHOULDN'T do this)

If you are NOT going to submit your app to App Store, there's a private API in 10.9 that does what iTunes did:
NSUserNotification *notification = [NSUserNotification new];
[notification setValue:anImage forKey:#"_identityImage"];

Related

Missing icon in Mac App Store review screen

I have a Safari App Extension that uses SKStoreReviewController to request the Mac App Store rating screen:
The screen looks like it should have the app icon on the left side, but it doesn’t. I’ve tried setting ASSETCATALOG_COMPILER_APPICON_NAME in Xcode to a valid asset name, but no change. Is this meant to work? If so, how do I get the icon there?
Don't know if it's the same issue but looks like using SKStoreReviewController on iOS seems to trigger similar behaviour. Does this issue also occur in the released version?
SKStoreReviewController not showing app icon in development

Can't access iTunes Music store from OS X

So it used to work. Here's what I'm trying... now if I post the string in the browser it correctly opens to the right song in the browser. But alas the code opens the iTunes but fails to open the album or song.
I'm using Yosemite 10.10.4 and iTunes 12.2.1.16.
maciTunesStr = #"itunes.apple.com/us/album/allegro-from-prelude-fugue/id982291206?i=982291615";
[self showProductPageForID:maciTunesStr];
THANKS!!!
well the following worked, but halfway. It opens a browser window with the song highlighted. This isn't the same as opening the iTunes app itself, but about 60% as good. I would still appreciate a better answer but for now this will suffice.
This is the most modern link format I got from the iTunes link maker.
https://linkmaker.itunes.apple.com
musicDownloadLink = ["https://geo.itunes.apple.com/us/album/sonata-in-c-major/id982291206?i=982291616&mt=1&app=music" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:musicDownloadLink]];

How can I make a Rate-Button in iOS7?

I want to add a rate-button to my application. How can I do this?
- (IBAction)rateGame {
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:#"itms-apps://itunes.apple.com/app/idYOUR_APP_ID"]];
}
In the simulator, this doesn't work. (Can't test it on a real device right now)
Is this the correct way to do this or should I try something else?
Your code is correct for launching the App Store with the app page open; I use the same code in my shipping app. This is the best you can achieve on iOS 7. It doesn't work on the iOS Simulator because the simulator doesn't have the App Store or iTunes apps installed, so there's nothing to launch.
Try using iRate. Handle all network connection and other related issues. And easy to implement. Just drag and drop files to your AppDelegate. It automatically configures all the required terms(like app store id, etc) from the info.plist files, and gets all the required information from app store.
NOTE: iRate can be used without any configuration, just by dragging and adding the files to project. See this example.
#import "iRate.h"
#implementation AppDelegate
+ (void)initialize
{
//configure iRate
[iRate sharedInstance].previewMode = YES;// yes for testing
}

Main window doesn't run properly on Snow Leopard

My app developed in Xcode 4.5 on Mountain Lion runs flawlessly on Lion and ML.
My Snow Leopard tester reports that when the app starts, it is disabled. By that he means none of the controls are active and the red, yellow, green 'traffic light' is greyed out. If another app is opened that covers my app, when the covering app is moved, any control, or part of a control it covered is not there.
The menu bar is responsive, and my preferences panel works. The app can be shut down from the menu, I don't know if it can be shut from the keyboard.
Another app that uses the same serial code works fine.
I need help with putting together a plan to solve it. I don't know how to trace this.
Fundamentally, the problem is that you're expecting data to be in NSUserDefaults. On first launch, NSUserDefaults returns nil for the keys you access, and passing this nil result through later code causes exceptions to be thrown. The solution is to register defaults with NSUserDefaults upon application startup:
#implementation AppController
+ (void)initialize
{
NSDictionary *defaultValues = #{#"SomeKey" : #"DefaultValue"};
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
}
#end

iTunes Connect icon rendering

Upon submitting an OS X application to the Mac App Store via iTunes, I've noticed that viewing the application icon in iTunes Connect shows the icon with rounded corners and dropshadows. This is strange because when viewing application in the Mac App Store it's clear that the rounded corners are entirely optional.
Is there something I should have added to my Info.plist file in order to stop this from happening (similar to the UIPrerenderedIcon key in iOS products), or is this just an oddity of the iTunes Connect website? The icon renders correctly in Finder and via the Activity screen in Xcode.
Any help would be appreciated.
Turns out that the App Store renders icons like this by default. It has no impact on the App Store rendering on the customer facing site.

Resources