How to do APN as sever side in IOS with php server - ios

i have some doubt based on APN as server side.i had used third part tool as server side as parse but i dint know how to do as own server,could any one clarify?
Thanks advance

An excellent tutorial for the same -> https://www.raywenderlich.com/123862/push-notifications-tutorial
Uses PHP & Swift.
How does the backend work --> (Already explained in the tutorial)
You have to create the PushNotification certificate from developer portal, when you create that you also have a private key attached.
They together form the PEM, which marks authorisation.
Post that, you simply call the apple push servers to send a notification.
This is different for development and distribution though.

Related

Twilio programmable voice: Do I need to rekey Mobile Push Credentials when changing from sandbox to live?

As usual this twilio thingy is always painful, sometimes it works sometime it doesn't.
My app is on test flight, I've unchecked "Use this credential for sending to a sandbox APN".
In past it did work now it doesn't work.
My question is do I need to enter Certificate and Private Key again when switching from sandbox to Live mode or just unchecking "Use this credential for sending to a sandbox APN" will be sufficient.
I've done some searching but as usual no one knows exact answer. At some place they say to renter cert and key and at some place it's said just uncheck the tick box.
What's correct way to fix this annoying issue?
Twilio developer evangelist here.
From what I understand about push notification certificates they can either be generated for and used with the APNS sandbox or for production.
Therefore, if you had previously generated these credentials for the sandbox then they won't work with a deployed application. (This answer says that apps in Testflight need to use the production push environment.)
You should create a new set of credentials using a new production certificate and key. You can then use those credentials for your production application. That way you retain the sandbox credentials so that you can continue to test on your development version of the app.
Side note: I'm sorry you've found Twilio to be a bit painful. Let me know if this helps.

How can I develop/debug the Office 365 Rest Api Notifications NotificationURL?

After testing and research it seems the NotificationURL parameter requires a fully valid SSL certificate or the subscribe call fails.
I am wondering if there is a way I have not found or a clever workaround to use the Office 365 Notifications with a self-signed SSL certificate installed on the NotificationURL during development?
Thanks!
Steve
I won't mark this as answered yet in case there is a better way, but here is my work around for the issue.
I created a small webapi project that takes a base64 encoded url as a parameter, ie: https://site.azurewebsites.com/Notify/aHR0cDovL3NvbWVob3N0OjEyMzQ1L05vdGlmeQ==
It proxies the request to that encoded URL and plays back the response.
I hosted this "proxy" as a free azure website making use of the SSL provided and can now subscribe to notifications via my proxy.
It works well enough and means I can work from anywhere.
I'll see if better ideas come along, but if not will accept this as the answer as it seems to work for my development purposes.
Steve
I've used Ngrok. The free version is sufficient to debug WebHooks

Embed API credentials in iOS code

I have to call payment gateway API from iOS code. Problem is it needs merchant credentials and I feel insecure embedding the merchant credentials in code. If someone somehow reverse engineer the code and get the credentials then the client is dead. Any advice?
I found this post Does Apple modify iOS application executables on apps submitted to the App Store? which says that app binaries are encrypted by Apple be default. Does it mean I can safely embed the credentials in code?
NO! Instead of adding the credentials to iOS app you should think about setting up a server which handles the interaction with the API, you are talking about, and let the app only interact with your server. So you can store the API key on your server and can limit whats possible by the user on server side (which will be much harder to abuse).

Is it possible to create multiple SSL certificates for providers that send APNs to the same Application?

I realize there was a question about allowing multiple servers to send Push Notifications to the same application using the same SSL Certificate, but my question is different.
Suppose that the developer of a single iOS application would like to allow multiple providers to send Push Notifications to his application, but wants to control which providers have the authority to send APNs to his App (and to be able to revoke that privilege from any one of them).
If all the providers have the same certificate, in order to block one of them from sending APNs, he has to block them all (by revoking the Push SSL Certificate, and getting a new one).
Is it possible to get from Apple multiple Push SSL Certificates for the same Application?
That would make it possible to assign a unique certificate for each provider, which would allow to block a single provider without blocking the rest.
On the Apple Provisioning Portal there doesn't seem to be a possibility to create more than one Push SSL Certificate for the same Application and the same environment (Development/Production), but I wanted to be sure whether it can't be done.
Since no one answered my question, I'll answer it myself.
The answer to that question used to be no but it seems that Apple made some changes in the provisioning portal (which is now called Certificates, Identifiers & Profiles), and now it's possible to define multiple certificates for the same application and the same environment.
Actually you can create only 2 apple push certificates for one App ID and no more.
Apple developer center does not allow me to create more then two and same experience has my friend.
I don´t see how your task can be solved now. In my opinion Apple does not want to support such products. Maybe you can do more with Enterprise Developer account but I don´t have one. So maybe anyone else can tell us if it allows to create more push certificates for on iOS application.

Generating a private key & certificate request on an iOS device

NOTE: This question is NOT related to the keys and certificates used for iOS development/provisioning.
I would like to use TLS client certificates for authentication of iOS devices running my app. In order to achieve this securely, it would be ideal if the device generated its private key itself and requested a certificate from our in-house CA.
I can't find an API in the docs for doing this, but I can see that iOS supports TLS client certificate authentication, so it seems logical that it would be possible. Can anyone point me in the right direction?
Actually there is objective-c wrapper of Open SSL available. Which can be some help to you. https://github.com/aidansteele/SSCrypto.
You can also use mycrypto( https://bitbucket.org/snej/mycrypto/wiki/Home ) a high level objective-c wrapper for many cryptographic tasks.

Resources