Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending push-notifications from coldfusion?

DISCLAIMER: I have never used coldfusion before and am in a bit of a hurry to get a small code snippet implemented.

So, I have the app working and receiving notifications from a php script: device token is hardcoded into script, script has access to the needed certificate to encrypt the message using SSL, message is sent to apple servers and passed on to the device.

I need to do the same thing from coldfusion. That is what the production server is using.

Is there any way to do so from coldfusion, or will I have to use some other programming language to do so? I have read that coldfusion plays well with .net and with java. I would prefer .net, and I see they have the SSL stream class (http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx) available. Could any coldfusion experts write some simple sample code to let me know how I should go about it?

Thank you.

-EDIT: in reply to the comment below, this is exactly what I want to do: connect through TCP over TLS or SSL to a server (in this case the Apple Push Notification server, APNs) using a local certificate I have in .pem format (if the certificate needs to be installed on the server or needs to be in another format for coldfusion, I can do that as well), and send it a binary stream (my notification).

like image 707
Bassel Avatar asked Jan 30 '26 01:01

Bassel


1 Answers

The answer is yes, this can be done with ColdFusion. In fact, it can be done with pretty much any programming language that has the requisite cryptographic libraries to open a private key store and sign messages to the destination server (i.e., Apple's push servers).

Though ColdFusion does appear to have some native support for accessing and using a PKCS12 keystore, it seems to be far more common to let Java do the heavy lifting, and simply reference the Java library from within ColdFusion.

Here is a link demonstrating the simple use case of initiating a push notification from ColdFusion, using a Java library for the actual sending of the notification:

http://www.raymondcamden.com/index.cfm/2010/9/13/Guest-Post-Apple-Push-Notifications-From-ColdFusion-in-Ten-Minutes-or-Less

like image 137
agoldencom Avatar answered Jan 31 '26 16:01

agoldencom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!