I was able to run the Push Notifications for my local worklight server. However now I want to configure it for my remote Liberty server.
From all the documentation available I know I need to copy the apns-certificate-sandbox.p12 certificate to my server.
But what location should the certificate be in? Also do we need to specify the location of the certificate and the pushSender password in config.xml?
The apns-certificate-sandbox.p12 file is part of the .wlapp file that you deploy via Worklight Console.
The pushSender value is entered in application-descriptor.xml
On build time, these files and values are stored and the .wlapp file and the .war file.
These are artifacts that you deploy in your remote application server.
There is nothing else you need to modify or configure other than deploy them.
Related question: IBM Worklight - What should I deploy after changing or adding iOS push certificate?
Related
I have the certificate from the Apple Push Notification Services. My App developer has not idea on how to install that on the server and neither do I. My server information
Apache Version 2.2.34
PHP Version 5.6.30
MySQL Version 5.6.41-84.1
You need to put it in the same path as your php script that contains the code to trigger the push for example in terms of local Mamp
hdocs
scrip.php ----------=> access would be $pushCertAndKeyPemFile = 'certificate.pem';
certificate.pem
For php code example look here Using PHP to send iOS Push Notifications via APNs
My iOS app is deployed to Heroku using Parse SDK. Why is the cloud code stored on my local computer and not in the server side (cloud code such as index.js & main.js)?
What is the relationship between my computer and the Heroku server?
The code on your computer is a copy of what is stored in the cloud. It is there solely for you to edit.
When you do the command parse deploy, you push your changes to the server. This overwrites the copy hosted on the server with the code on your machine.
The copy that is hosted in the server is the code that your app communicates with.
I'm looking at the MobileFirst Platform 7.1 push notification setup instructions, and am trying to debug an issue with an MFP server where it seems to be connected to the wrong Apple backend server (sandbox where it should be production).
To clarify: how does the MFP server know if it is in "sandbox" or "production" mode? Is it purely based on which of the two .p12 files (apns-certificate-sandbox.p12 and apns-certificate-production.p12) exist in the .wlapp file? What happens if both of them are present?
I believe it is based on the name of the certificate. It either ends with "sandbox" or "production".
I'm currently working on push notification workflow developed by another developer of my company.
I have a question about the sandbox for push notification.
I have generated a .pem for my production environment.
I have tested id with openssl as describe in this tutorial.
When i make the test to gateway.sandbox.push.apple.com url, the connection is ok even though i don't use the developement key and cert files (i use the prod file).
If i build and send push message to gateway.sandbox.push.apple.com with my prod pem file, the message will be send to the prod devices or dev devices ?
There's no such thing as a production device or a development device. There are devices with either a production build or a development build of your application.
You can only send a push to a development build of your app using the development environment, and likewise you can only send a push to a production build of your app using the production environment.
Production and dev builds are signed using different profiles, and this results in the push token that your app obtains being different, if you try to send a push using the sandbox environment but using a production push token then it will be rejected, and similarly attempting to use the production environment with a dev push token.
You need to set your gateway proper, use the proper PEM whether Dev PEM or Dist PEM. Xcode needs Dev profile and certificate to run and test with Dev PEM
I'm trying to get my server to deliver push notifications via Apple's Push Notification service. (APNs)
My setup is as follows:
Cordova HTML/JS app
API in Rails on VPS via https
Houston gem for Push Notifications
I've created a certificate for development on my mac. When I run my server locally it successfully sends the notification to my iPhone.
I'm now trying to get it working on my server but without luck. I've generated a CSR locally, uploaded it in Apple's iOS App ID's editor and downloaded the CER. I then exported the CER to p12 with Keychain Access and converted that to a PEM file with the following command:
openssl pkcs12 -in apn_production.p12 -out apn_production.pem -nodes -clcerts
Houston needs this PEM file to send push notifications, I've done the same for development and it worked, but it needs to send from a server now, which could be the problem, I don't get any errors though. The notifications just don't arrive, which could be a production/development mistake I'm making.
I also tried creating a CSR file on my server and upload that via the iOS App ID's editor, but when I download the CER and open it in Keychain Access I'm not able to export it to P12, only to CER, PEM and P7B. Also there isn't a private key in this file, which there is within my locally created development certificate. Also when I export it to PEM and use it with Houston on my server it throws an error that the certificate is invalid.
Another thing I tried was upload the CSR generated by my VPS on the Apple Push Certificates Portal. This throws an error mentioning the certificate is invalid.
There's a couple things I'm not sure of:
1. Am I in development or production mode?
The app is not yet in the app-store, but it is in beta mode to download via TestFlight and push notification need to be send from my server. Is this a production environment or development or do I need to define this manually somewhere before building the App?
2. Is it possible to use a locally generated CSR for a PEM to be used on my server?
Am I right that I need a server generated CSR to start with when I finally need a PEM to send push notifications with from my server?
3. What do do now, how should I debug?
The PEM generated from my locally generated CSR is now uploaded to my server and Houston doesn't throw errors whatsoever. The push notifications don't arrive though, so, what should I do, can I trace these push notifications somewhere? Is there some APN logfile which I can read?
1) You need to use production certificates for sending push notifications via test flight.
2) You do not need a server generated CSR. You only need a valid ".pem" for sending push notification.
3) You need to remove sanbox (sandbox mode) from push notification url in push sending script. Also check if port 2195 of your server is open for communication or not because APNS communicates via this port.