Reusing a wildcard appId to enable push notifications - iphone

I have recently taken over an iPhone project and I have never used objective-c before.
I have to get the application to use push notifications, but the first appId is already live and uses a wildcard (so no push notifications).
I created another appId with an identifier and got push notifications to work.
However my workplace would like me to get notifications to work for the wildcard app (since we already have lots of customers using that app).
So how can I make the wildcard app update and use a unique identifier without creating a new appId (even with the same bundleId).
I am very new to all of this, so a step by step process is greatly appreciated (ELI5).
For reference I used keychain to get the private .p12 file and I use that on a windows server that runs a console app that generates the push notifications (sent to Apples apns server).
EDIT: I have done the following steps, can someone tell me what im missing?
1) Create new bundleId (using the same AppId).
2) Configure that AppId to use push notifications.
3) Create the CSR in keychain.
4) upload that to the portal and create a production cert.
5) Download that cert and export the private key.
6) Create a provisioning profile using the same bundleId as 1 (e.g. au.com.website).
7) Download that provisioning profile, put it in x-code and on my iPhone device.
8) In the build settings of x-code use the bundle Id and use the provisioning profile I created in step 6.
9) Archive the app, deploy by ad hoc, save the file to the desktop.
10) put that file in TestFlight, download the app from testFlight on my iPhone.
11) put the private key on my windows server and send the push notifications (they send w.o errors).
I don't get push notifications (the iPhone is set to revive them).
Once again this is working with another appId someone else made, so I know the code works.

Do not confuse the app identifier and the bundle identifier. The bundle identifier is something like: com.company.appname and is defined by an app's info.plist
The app identifier has an additional prefix (usually the team prefix) and can be containing wild cards. The app identifier is used to match bundle identifiers to provisioning profiles. A profile is only valid for that app that matches (excluding the prefix)
Now what you want is to keep the bundle identifier the same, because if you change that it becomes a new app. But you can change the provisioning profile and app identifier with every update.
I was in a similar situation a while ago when I had published an app with wildcard app id and I added an IAP to it.
You just create a new (non-wildcard) app id that matches the bundle id.
You enable the Apple services (IAP, GC, APNS) you require on the app id.
You create new provisioning profiles to suit your needs (App Store, Ad Hoc, Development)
You can then submit an update for your app with the new profile but unchanged bundle id.

As far as I know, what you ask is not possible.
https://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/DevPortalGuide/CreatingandConfiguringAppIDs/CreatingandConfiguringAppIDs.html#//apple_ref/doc/uid/TP40011159-CH18-SW1
Here is an older question, that may have an answer...
Updating live App ID for Push notifications

For Push Notification an appId is must.
For a step by step process Use the two part tutorial of raywenderlich. Hope this will help you.

Related

Push Notifications on existing app. Trouble with certificates

I'm working on a large app. In the middle of development we decided to add push notifications. I created a new App ID in the Apple Developer Site.
The App ID is: 8NG823UBLP.com.mobiikk.ServicioDeAdministracionTributaria
Push is enabled for Production and Development.
Certificates were downloaded for both and the .p12 created too.
.p12 files are on the server and everything looks good on server side but the app is not receiving push notifications.
The app is granted push notifications and they are set to ON in settings.
The bundle ID was changed to com.mobiikk.ServicioDeAdministracionTributaria in the info.plist
The team has been looking for an answer for this without any luck. Help will be very much appreciated.
If you switch on notifications for existing app, you'll have to recreate the provisioning profile (better clear old profiles from Xcode organizer and then refresh them or shut down xcode and replace them via iphone configuration utility - be sure to get rid of older provisioning profiles)(you can still keep the same old appID, just refresh that AdHoc/Enterprise/AppStore profile - it contains note about being APNS-enabled)
Otherwise your serverside may look great, but app will never get successful notification of registering your device and could not pass token to your server side ,
but you would get failure notifications warning you about wrong entitlements and missing APNS profile in device console log
As you did not state what are you doing in the app side it's hard to tell where is your problem exactly.
Just in case someone has the same problem. The only way around this was to create a brand new project. I copied every file in the old one to the new one. Gave it a new Bundle ID, created a new provisioning profile, new App ID, and downloaded new certificates. So in summary, there was no easy way to transfer an existing project to one that accepted push notifications.

Validating my application using VALIDATE in xcode - Beginner

I need to use the validate functionality in xcode. I need to check if i have not done anything illegal while programming.
I know that i have to login to my iTunes connect account and add a new app. (I did this step)
Next i have to fill in the Language preferred, App name, SKU number and bundle ID
1.) what should i enter for SKU number ?
2.) I only want to submit the app for validation (and not submit the app to appstore). So what is the process i should follow after entering the above details (note:I only need to validate and not submit)
3.) What should i select in Bundle ID dropdown. is it the appname -* or the appname - com.me.app ?
if i select appname - * it will prompt the Bundle ID Suffix what should i add there /
4.) I have given a false application name to its App Name column (since i am not going to submit this to app store), So will i be able to add an App again giving the same Bundle Id and SKU number ?
1) The SKU is a unique number that you come up with that will help you to identify the app. It can be anything that you desire, for example 001 or 0001.
2) Follow the remaining steps in iTunes Connect, until you get to "Ready to upload binary". (and then hit that button) Feel free to use placeholder (ie, temporary) screenshots and files for the app icon. Just ensure they're of the correct resolution to keep Apple happy for now.
Once the app has changed to the "waiting for upload" state, then when you build an archive of the app in Xcode and then go to validate, then login with your info, and it will validate your app binary file.
3) You need to pick the appname - com.me.app option.
4) You can add more apps again, but the app name, SKU and bundle ID will be different if it is a different app. If you want to reuse the app name that you've made, purely to test the validation of the app, then be sure to setup your app in Xcode using the same provisioning profiles, bundle ID and app name again.
Hope this helps!

How to test iOS push notification?

I hired an objective-c programmer to develop my iphone app, he wrote the code, and now I want to test the push notification service, but he wouldn't send me the p12 file, he said he cant send me the p12 key, because it contains his private key.
1) So can I create the p12 file myself, if so how can I do this? doesn't it need to be attached to the app? I need the app's id?
2) Can I just add him as a developer under my apple' developer account so he can set up everything?
The key used with APNS does not need to be the same key used for signing apps. It should not be the key used for signing apps, since it will end up installed on a virtual server on third-party hardware in a fourth-party data center. You might even want to use different development and production keys, if more people will have access to the development server (e.g. developers might run it on their own computers as necessary for debugging).
You can create the keypair, send him the CSR, get him to create the cert and send that to you, and use the cert on your server.
You'll need to set the app up under your own account at some point anyway (assuming you're not going to pay him to support it indefinitely) so you might as well do it now. Depending on how much you trust him, you can add him as a developer or just do it all yourself.
I'm pretty sure you can also give accounts restricted permissions - just enough to upload a CSR, create an "iPhone Development" cert, and download provisioning profiles. You can do the rest (add UDIDs, set up app IDs, and configure provisioning profiles), right?
You can create your own .p12 file and your app is not dependent on push notification certificate.
.P12 is used to authenticate and communicate between correct device and APNS server.
Check this tutorial
Once done you can test using by your own server if you have access or use the below tool to test
Pushtry.com

Adding push notification functionality to an existing app

Hey,
Is it possible to add push notification functionality to an already existing app?
Will it be possible if I have to change the appID?
I am asking this because I am about ready to submit my app, and currently don't require push notifications. In the provisioning portal I have already created default appID, with a wildcard Bundle Identifier.
I will however need the push notification service in the future - And for that I will need to use a non-wildcard Bundle Identifier. Will it be possible to easily change in the future? I prefer not to go through the push notification service certification right now.
You can not change the bundle id of your app (inside the info.plist and iTunesConnect). So choose your bundle id now currectly for later usage.
You can sign you app with other certificates (without wildcard) on an update.

Push notifications work for Ad Hoc, but not when downloaded from the Apple store

My app just got approved for the apple store. I downloaded it an installed it on my iPhone - but it looks like push notifications are broken!
I was successfully testing push notifications in production using an adHoc provisioning profile. I had no problems. The only thing I did differently when I submitted to apple was using an app store distribution profile.
The application never asks me (or anyone else who has downloaded it) if I want to receive push notifications. Consequently, the phone never talks to my server to send the push token (because application:didRegisterForRemoteNotificationsWithDeviceToken: is presumably never called). Also the application does not appear in the settings app under the notification settings.
What could I be doing wrong??
EDIT: While the app was awaiting approval, I was having some trouble generating my production push certificate. Could this be relevant?
Problem generating APN SSL certificate after submitting to apple store
Be sure you've created your production App ID and have enable push notifications upon it. Then create the provisioning profile for that app. Download and open the file with a text editor to MUST make sure that the profile contains this key and value:
aps-environment
production
If not, then make sure you really have enabled the app ID for production push before you generated your provisioning profile.
After you make your build, you can check the final build to verify it has the aps-environment entitlement (you're looking for the aps-environment code signing entitlement under "Internal requirements):
codesign -dvvvv --entitlements - MyCoolApp.app
Did you use the same Application ID for both the ad-hoc and the distribution mobileprovision files? It needs to be a complete identifier, rather than just partial.