Apple Push Notifications - two app id's and one server key - certificate

I am trying to deploy two applications that use apple push notifications. Both the applications talk to the same server application. Let us assume one is a a free version of the app and the other is a paid version - two different app IDs on the AppStore .
I would like build a single PEM key on the server that can be used to talk to the two different App IDs. I have been successfully able to use two separate PEM keys and have it talk to the apps separately but don't want to do this as its more of maintenance issue.
I am sure people have done this? Any ideas how I could combine the two private keys in the back end but have it talk to two App IDs?

Afraid that is not possible.
Apple use the certificate to identify app(notification receiver).
You have to use two certificates, make two connections.

Related

Remote Wipe out an iOS Application

I have developed an iPad application and I have distributed that application to my clients. Now my clients ask what will happen if their iPad lost or stolen. My iPad application has very sensitive data. So they need to wipe out remotely if iPad is stolen or lost.
I found two solutions.
One is configure 'Find My iPad' in each iPad with same apple account.
Second one is configuring MDM server with push notifications.
If I'm going to configure MDM server I need to contact third party vendor who supports push notifications service of apple or I need to buy Lion Server and configure profile Manager.
Can some one tell me what is the best solution to implement and pros and cons of these two options.
Push notifications won't help you here - they only will pop up a message to the user, you cannot influence the app from them.
Possible solutions:
Protect your app with username / password: Each user should choose a username and password, store those in the keychain and check on app start. Of course you should also encrypt all data with the password when storing it to the device.
Like said above, implement a server request which gets the unique id of the installed app (of course you'd have to create one first on first app startup), returns whether the app is reported as stolen and then either do nothing or delete all data. I'd be careful about deleting though in case there was an error somewhere in your implementation and you wipe out a 'normal' application's data. Also in this case I'd encrypt any sensitive data that is stored to the device. This solution also won't work when the app is offline, of course.
Just make a web service and get response from server, and after getting response , run your application otherwise kill.
if(stolen)
exit(0);
else
run

How to distribute two apps in one certificate in iOS?

I have a question that is how to distribute two apps in one production certificates ? But first app is using apple push message services but seconds app is not? Otherwise both two application is using push message services ?
I feeling embarrassing what should i do ?
Thanks in advance !
You can't do it. Each push notification certificate is tied to a single application. The Apple probisioning portal makes that very clear, when in order to create the certificate you first have to define a unique application id.

Sending iOS push notifications from my Machine?

I would like to add iOS push notification to my FREE iOS App
The push notification will be mainly advertising my other iOS applications. so I am expecting 1 or 2 push notifications every month
I checked service like urban airship, but I think it is expensive considering I have more than 1.5 Million active users.
So, what I am thinking of is collecting the devices token at Google App Engine ( java ), then whenever I want to send push notifications I export those tokens then send them from my Machine.
Is this is the right approach? what do you think?
Is there any framework that I could use instead of building things from scratch?
Many thanks
This approach looks ok to me. Having an app on Google App Engine to whom each of the iOS device is sending their device token. Later at any time utilizing a web page or web service running on Google App Engine APP you can push custom notification to all respective device tokens. Just keep in mind to filter the list of device tokens with obsoleted ones (in case somebody uninstall your app).
You may check http://code.google.com/p/javapns/ for APNS communication. I tried it couple of times and it worked really well.
You should also give http://www.scringo.com a try.
Among other things this framework does, it also gives you a free push notifications service to send push messages to all your users or some of them (based on your custom criteria).

iPhone push notification urbanairship, phonegap, c#

I want to create an application which will be notified by server for new events. (lets say I have a shop and I need to inform all my iPhone users for my sales or something like this) Users who will download my application and run it and then put it in background wil have to be notified by this. Im quite new to iOS and Objective-C but if im not wrong this could be done via apple push notifications. Ive been reading about this and found out there are some providers that let you send this notifications. My question is, are there ways to create your own notification "center" in lets say c# and send notifications to iPhone-s by yourself, also if this could not be done are there any free providers?
and another thing. In objective-c app you have to subscribe your app to listen to that kind of events. Could you create app in phonegap or some other technologies so it will work with notifications? could you lets say embeed your app in objective-c (like web app in objective-c)
For sure you can do your own C# program that will push APNs to your clients (in fact I did that myself in many apps). What you have to understand is that the architecture of APN has 2 critical facts:
APNs are best effort, so no guarantee that they will reach every time.
APNs can not hold a lot of information with them when they reach your client (they have a limited number of bits, refer to the Apple documentation).
Due to these facts you might need to have your own server application (also could be in C#) that will handle sending the real information to the clients and will make sure that the data reached your client as well. Needless to say, this server application should sit and run on a real server. Maybe due to this fact some developers start looking for a third party solution, but personally I prefer not to use a third party and I do everything myself.
Other than having your own server application, your iPhone app will need to have some sort of database (probably SQLite3) to store the received news and display them later on.
EDIT: Answer of your questions in the comments below:
For the first question "why iPhone app must have sql db". In fact it is not a must, as I said in my answer above, it is probable or a possibility. To know if you will need a database or not this depends on the nature of your app itself. For example you might be pushing text and images to your clients and in that case you can not fit such data in the payload of the APN. Another possibility, you might want not to lose the sent notification even if the user discarded the APN message, you might want to show it again when he opens the app later on... So the nature of the app decides whether you will need a server or not.
For the second question "you said you dont need to send notification via third party", let me clarify something in my answer. As an Apple developer I don't consider Apple servers as third party. Put differently, the real APN will only be sent via Apple servers and we can not change this fact (nor do we want to change it too). So at the end of the day the real APN will be sent to Apple servers and Apple servers will work on delivering it to the actual client. What I consider a third party is someone that has his own server, you send the message you want to him, and then he sends it to Apple servers. In that case there is someone between you and the Appl APN servers and this is what I called a third party, and this third party can be avoided as your C# code can directly connect to the Apple APN servers and ask it to send the message to the client. I hope I clarified my point.
Yes, you can use APNS with the phonegap application: Receiving push notification on PhoneGap for iOS
Regarding the server, there is another option for you besides doing everything from scratch. You can use the third-party server via API, seems that pushwoosh (http://pushwoosh.com) guys offer this option (and they provide phonegap integration as well)

How to create a server for APNs for iphone

I'm creating an iPhone app that produce Pushnotifications. When I went through the documents and tutorials, I can see that we need a server support to provide the push notification. So, what are the requirements or what all are the important things that I should keep in mind when I create the server.
Thanks
If you are implementing it on your own, take a look at how to make my server support APNs? You can use php-apns if you want readymade server.