Bundle ID issues when adding Push notifications - objective-c

my iPhone app has been approved and I am ready to add push notifications to it. I've been following a tutorial that is going step by step in doing the certificates etc etc
I've hit a road block though. I need to make a new app ID but it won't let me use the bundle ID I have used before. My understanding is that the bundle ID must be the same as before in order to update my app. I have no idea what to do and have spent a couple of very frustrating hours trying to figure it out. I have read somewhere about using a wildcard ID... not quite sure what this means.
Any feedback or help would be much appreciated.
Thanks

You don't need to create a new app ID. You only need to configure your existing one and enable Push Notifications. Go to the provisioning portal, and under "App IDs" press the Configure link for your existing ID:
You will then be able to enable Push Notifications for this app ID:

Once you create an app ID, you can use it for doing whatever you need. Even enabling Push Notifications later. And this is your case. You should simply go to Apple's Developer Center and edit you current App ID enabling Push Notifications. No need to create another one, it will be useless.

Related

Cannot come out from the play store internal beta testing

We have uploaded an update of our existing app (WASFAT) as internal testing build. We can access it successfully.
Now I want to leave from the internal testing and want to access the live build.
There is not leave button the playstore wasfat page. Please have a look at the attached image.
When we have released beta version, we had that leave button. But in the internal release, we don't have it.
How can I get out from this internal testing mode? How can I access the original live build? Also I don't want to remove my id from play console internal testing.
Thanks for any suggestions
As far as I know, you can opt-out of internal testing with the same link you used to enter in the internal testing program. Also, you need to remove your email from internal tester. However, It will take some time to be able to access live mode again
The simplest way I have found is to just switch to a different account within play store.
Open play store afresh
On top right, tap your account icon (or where ever it is located)
Click the drop down and tap "Add another account"
Later on it is just a matter of selecting an account, no password entry needed if done before.
The advantage of this is that you don't have to wait for Googles services to register that you have disabled a testing account. When you need to enable the testing account you will have to wait again. So this is pretty nifty for me.
I'm reliably able to restart my phone, and have changes to beta status reflected immediately.

Cocoa app, how to show the badge label when app isn't running?

I've noticed the Spark mail app manages to show a badge count even when the app isn't running. The app is a mac app store app so it must not be using any private APIs. Is there a way to do this? Currently I'm only able to do the following while the app is running:
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:[NSString stringWithFormat: #"%ld", 10]];
You need to make a Dock tile plugin. See the documentation for NSDockTilePlugIn for information on how to do this:
https://developer.apple.com/documentation/appkit/nsdocktileplugin
EDIT: Okay, if you want to do what Spark is doing, here it is:
Spark is using Apple Push Notifications to inform you of new e-mails that come in. For e-mail accounts other than Gmail or Outlook, this generally means they store your username and password on their server, which seems "OMG!" levels of creepy to me, but YMMV. When their server notices that you have a new e-mail, they forward the notification to you.
A description of what Spark is doing can be found here: https://blog.readdle.com/how-we-handle-your-account-information-in-spark-1b42f4acef73
If you want to implement push notifications yourself, this video shows generally how to do it, and this sample code may be helpful as well.

Is there a way to update SMLoginItemBookmarks data on launchd overrides.plist

I'm working on an OS X app that most users choose to "launch at login", the kind you'd find at the menu bar.
In order to launch it at login I'm using SMLoginItemSetEnabled to launch a LoginHelper app that will open the main app, as described in this tutorial.
The app is failing to start up at login for just a handful of our users.
I was unable to reproduce this or to track the cause but I found (on a user's machine) that:
Deleting /Root/_com.apple.SMLoginItemBookmarks/[myapp] and /Root/[myapp] on /var/db/launchd.db/com.apple.launchd.peruser.$UID/overrides.plist and then resetting the Launch at login on the app fixed the issue. Also, we diff'd the files and the Data on the bookmark had changed.
For reference, I found about the overrides.plist here.
Since the app has both a Mac App Store and a Direct download version, I'm suspecting multiple copies of the app setting themselves as Launch at login may be the reason for this to fail, maybe these "bookmarks" are trying to open another instance of the app, that may or may not be deleted.
Now the questions, provided that this app needs to remain sandboxed:
Is there a way of updating that Data on the overrides.plist bookmarks?
Is there any way of deleting one self's app from the overrides.plist to start clean?
Is this maybe a known issue?
Any other suggestions on why the bookmark seems to point nowhere or how to fix it will be appreciated.
Note: This is my first question on StackOverflow, please excuse me if I failed to follow some of the suggested etiquette.
I don't know a definitive solution to this, I wasn't even aware of the overrides.plist. It could be related to multiple copies. As far as I understand, adding login through SMLoginItemSetEnabled sets a metadata flag that this Bundle ID should be launched on start. Then Spotlight, on start, will go do a metadata search on the file system and see which Bundle IDs need to be launched. Then, I guess, it will initiate the launch using the bundle ID. In my own application, Trickster, which uses the same technique for launching, I see that if I enable launch-on-login through the app itself, it might pop-up this strange message which refers to a debug build. I'm not even sure why it says about the first time. Very strange.
So, to have them launched, you have to make sure that the relevant bundles are in locations where Spotlight indexes (that the user hasn't disable Spotlight for these locations). Usually users don't disable Spotlight, especially for /Applications/ but I'm just saying.
What I usually suggest when support comes my way (and how I have it set up for me because I have multiple copies), is I to disable launch from within the app and instead add the correct one (from /Applications) manually in Login Items in System Preferences.

How can i send a push notification?

i'm trying to add push notification to my app, but, so far, i could find only tutorial that seems to be old and outdated... Can someone explain me how can i make my app send a notification?
My app takes some content from an xml online and i want to send the notification when the xml contains a date of update more recent. Can i?
I found a simple and clear video about this here: http://www.youtube.com/watch?v=_3YlqWWnI6s.
It is simple and clear, and after that i followed http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12 and http://blog.serverdensity.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/. So i managed to send push notification. Needs some work but it's not do difficult as i thought.

Does an iOS app automatically check for new versions?

Do I need to implement functionality within my app to check the store for newer versions, or is this done for you automatically? If I do need to do this, how would I go about it?
Its done automatically by the app store. When the user enters to the App Store on his iPhone and theres a new version the "Updates" count will increase and notify the user.
Some like posting this stuff as Push notifications for the user, but many users don't appreciate it much :)
This is all handled by the App Store. You don't need this.