NSUserNotification don't show application icon in notification [duplicate] - objective-c

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 default "your app doesn't have an icon" icon keeps showing up:
Here's what I've done so far
I have created an icns file that includes 512, 256, 128, 32 & 16px versions
dragged the icon into the "App Icon" section of the target's summary
I made to sure to check the box to copy the icon into the project
the plist's "Icon file" section references the correct icon name (minus the .icns) part
Any ideas? The icon doesn't show up when I run the app thru Xcode or when I export an archive either.
I also have extracted the Sparrow.icns file from Sparrow.app and tried using that one instead of the one I made. That didn't work either.

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

You can force the Notification Center to refresh all of the icons by deleting the Notification Center database file (~/Library/Application Support/NotificationCenter/SOME_UUID.db) and then killing the Notification Center process (e.g., from Activity Monitor).
Unfortunately this has the side effect of deleting your notification history, but this wasn't too much of an issue for me.

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.

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 .

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)

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...

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

If anyone still having this issue, and none of the methods above worked, here is how I solved it:
open Notifications from the System Preference (easiest is to open Alfred or spotlight and type Notifications)
find your application and remove it (press backspace/delete button)
NOTE: this may remove all notifications

I am using Xcode 11.5 and I had the same problem. In my case tough, it was sufficient to clean build output, close and reopen the project. Then do a fresh build and let it run again. The icon was there afterwards.
Side note: I've placed the app icon for every size in the assets.xcassets file, except 1024 x 1024 pixels. Don't know if this is relevant or not. Hope that helps.

Related

Change icon of application developed with react native

I want to change my default icon's app to another one and generate my standalone app (with expobuild:android)
But when I add another image(capture) in my assets folder and replace it in app.js,it gives me an error:
{
"expo": {
"icon": "./assets/capture.png",
}}
I tried many time with and without default icon (I have error just with new image) so i'm sure that error came from the change of icons.
Do you have any idea ;
if you are using a CRNA solution, there is an easy way you can do it. Just go into the /assets folder and just paste there your new icon, then rename it to icon.png, just make sure you already removed the default one. It also works with the splash screen.
But if you created your project with create-react-native-app, you need to do it separatly in Android studio for Android and Xcode for iOS. See more with this link wich helped me too.
https://aboutreact.com/react-native-change-app-icon/
Hope it's gonna help ... Regards
I used this this repo and cloned it, then run one line command to resize the png to all the different formats.
bash resize.sh my-cool-new-app-logo.png
Then drag the folder over and merge/replace icons.
quick insight

Migrate app to ios11 for Iphone X

I need to update my app and make it look good on the iphone X. I've seen a couple of answers on stackoverflow and on the internet regarding the new safe area option (Use Safe Area Layout Guides).
According to what I've read the app should adapt automatically using autolayout as well but what I've got is this:
If I start a new project it all works fine. The project is quite big, so starting all over again is not an option. What should I do?
Thanks
I just had the same problem, and in my case, the problem was that my app didn't have a Launch Screen.storyboard, it was using a image as launcher. So adding a new Launch Screen.storyboard and selecting that one fixed it, maybe the rest of the app takes some settings from that Launch Screen.storyboard

Can't change bundle ID in itunes connect?

my first app got rejected because it has the word Youtube in the bundle ID. I've since then changed the bundle ID in the plist.info and in the bundle identifier in Xcode. I also create a new app id under the identifier section in the member center of Apple's developer site but when i try to change it in the EDIT APP INFORMATION section in itunes connect, there is no drop down menu so i can't choose the new bundle ID i made without the word youtube in it. It is because my app is in status "Waiting for upload"? Here what i want to change "Bundle ID" in the picture below.
The menu to edit the bundle ID (if you have never submitted) is now under More > About this App
7/25/16 update: Now you can just edit the bundle id under the App Information if you have never published uploaded a build:
Per https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html, the Bundle ID "can’t be edited after the app is approved."
So, if you have app has previously been approved, then you can't change your Bundle ID. But, if your app has NEVER been approved, then you should be able to change your Bundle ID.
I think your issue is that your app is currently in the App Store review process. I would click on "Binary Details" and then click "Reject this Binary" at the top right. This will remove your app from the App Store review process (status will be "Developer Rejected")and you should now be able to edit your Bundle ID and then resubmit for review.
However, I am assuming your app has never been previously approved. If it has been approved before, I think you need to create an entirely new app.
Hope this helps!
I also have the same issue, and have been able to edit this field in past apps. I called Apple support and they said that the issue is; that once Game Centre is turned on for a BundleID it becomes non editable. We even tried turning Game Centre off but to no avail. They told me the options were to use change the BundleID back in Xcode to match the BundleID in iTunesConnect or to change the name of my game in iTunesConnect (to free up that name) and then create a new app/game in iTunesConnect with the newly freed up name and now proper BundleID.
It should be noted that if you change the name to free it up and create a new app/game, you will not be able to delete the old game/app from your iTunesConnect. It will just sit there in limbo.
They said that there is NO way to edit this field once it has been marked is not editable.
This doesn't answer the issue on how to change it but may make it so people stop spending hours trying to change their BundleID.
Cheers
My App hasn't been validated yet, that because on an error on the bundle id.
To edit the bundle id I went to App Information "Edit", and then I've changed (even created a new one)

How to re-allow my app to use the current location

I am using CLLocationManager to find the location.The first time that I run the app for mistake I didn't allow the app to use the current location.
So every time the delegate gets notified through the locationManager:didFailWithError selector.
I tried to make a clean build and to delete the project folder in derived data, but it still doesn't ask me to use the current location.
I would make possibile to re-select through that panel if I would use the location, how is that possibile?
You have to delete the application from the simulator or phone and then run another build onto the device.
I hope I understood you correctly, if I think that this is not a coding issue:
If you are on iOS6, you'll have to allow location services for the app at
Settings > Privacy > Location Services.
For more info, see Apple's documentation here: http://support.apple.com/kb/HT5467?viewlocale=en_US&locale=en_US

image doesn't show when I build the app

In Xcode, I am just trying to get an image to show up in my app. I tried taking an image I had previously used in the app and put that into a uiimageview and still, when I build, nothing shows up. I have tried deleting the image file from the app and putting it back in there, I have tried to clean the app and then build. Nothing I am doing works. I just want to be able to put an image in the view and have it show up!
Most propably you're just have a typo in the name of the image - in imageNamed: - it happens sometimes) And it's case-sensitive - so double check the name.
It's possible that the image is not added as a bundle resource. To do this, you should go to your target settings, and then to Build Phases and later check if this image appears in the Copy bundle resources section. If not, add it by pressing the + button at the end of the list.
I don't know why but in the latest Xcode if you add an image, delete it and then add a new one with the same name, this is not added to the Bundle resources.
Please check if your images are added to the target which you are trying to build.
Sometimes, it happens when you have two targets lets say one for DEVELOPMENT and one for TESTING and images are added only at one target.
Please re-check if that is the case.