I have an application built in hybrid framework. It is totally built with usning REST APIs from salesforce. I can't use SDK here. Please suggest how to write a trigger or webservice to initiate push notification for iOS devices.
How to call ssl end point of apple: ssl://gateway.sandbox.push.apple.com:2195
How to include apple .pem certificate while in HTTP request from salesforce to APNS.
EDITED: I have converted my .p12 certificate to jks and uploaded on salesforce and used in http request. Have a look on code below:
Http http = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint('https://gateway.sandbox.push.apple.com:2195'); req.setMethod('GET'); req.setClientCertificateName('distributioncertificate'); //req.setCompressed(false); HttpResponse res = http.send(req); System.debug(res.getBody());
But when I run this code it gives an error
Please suggest how I can connect with APNS endpoint without any error.