Sametime on iPhone – APNS test application

Having upgraded a customers deployment of Sametime to 8.5.2.1 we found that notifications were not appearing on the devices when the device was in a “paused” state.

How this works is that User A (Notes client) sends an IM to User B (using iPhone application) and the IM is received instantly. The iPhone is registered with the APNS and is assigned a device token which has been sent that same device token to STProxy.

If the iPhone is locked the Sametime application is running in the background in a “paused” state. The application sends to STProxy the “pause” command and it then goes to the back ground. After 10 minutes the application goes into “APNS mode” before then IM’s will be received via a direct connection with STProxy.

User A sees User B’s Sametime status as “Away” and on sending an IM User A receives an announcement in his Notes client (configurable) that User B is on a mobile device and the message may be delayed. At this point STProxy knows the user is in a paused state and stores the IM in a database.

STProxy knows that User B is in a “paused” state so sends the device token to the APNS and requests that a push notification be sent to the device. APNS sends this push notification and the device displays a notification that there is an IM waiting to be read.

When User B views the notification it brings the application on the iPhone to the foreground and connects to STProxy and sends a command to it to retrieve messages.

STProxy then sends the queued IMs which were stored in the database to the device. The IMs are then removed from the database.

Looking at STProxy’s SystemOut.log and trace.log (if enabled) you can see output similar to:

[10/10/12 17:32:51:786 BST] 0000002a APNSService   W com.ibm.collaboration.realtime.stproxy.services.APNS.APNSService startAPNS CLFRX0079W: Unable to establish an SSL connection to the APNS service Connection timed out
[10/10/12 17:32:51:790 BST] 0000002a APNSService   W com.ibm.collaboration.realtime.stproxy.services.APNS.APNSService startAPNS CLFRX0080W: Unable to send message to the APNS: null ssl socket
[10/10/12 17:44:22:038 BST] 00002e89 APNSService   W com.ibm.collaboration.realtime.stproxy.services.APNS.APNSService monitorFeedbackService CLFRX0081W: Unable to establish an SSL connection to the APNS feedback service Connection timed out

This could be explained by Updated security certificate for Push Notifications (iOS) but I know that is not the case as I applied the patch during the upgrade.

I tried using telnet but couldn’t connect so asked the customer to check with networks whether the ports had actually been opened.

# telnet gateway.push.apple.com 2195
Trying 17.172.238.214…

# telnet feedback.push.apple.com 2196
Trying 17.172.238.216…

It turns out the ports have not been opened but IBM did send me a useful test application which you can use to test connection to APNS. You can download apnstest.jar and follow the instructions below.

Windows
——-
From a command prompt in the directory to which the above file was copied, run the following commands:
(Replace C:\IBM\WebSphere\AppServer with the path to the AppServer directory)
C:\IBM\WebSphere\AppServer\java\bin\java -jar apnstest.jar

(Replace <ST Proxy Cell> with the cell name which ST Proxy is deployed to. Replace <ST Proxy Node Name> with the name of the node which ST Proxy is deployed on)
C:\IBM\WebSphere\AppServer\java\bin\java -jar apnstest.jar “C:\IBM\WebSphere\AppServer\profiles\STPAppProfile\config\cells\<STProxy Cell Name>\nodes\<ST Proxy Node Name>\apns-prod.pkcs12”

Linux
—–
From a terminal in the directory to which the above file was copied, run the following commands:
(Replace /opt/IBM/WebSphere/AppServer with the path to the AppServer directory)
/opt/IBM/WebSphere/AppServer/java/bin/java -jar apnstest.jar

(Replace <ST Proxy Cell> with the cell name which ST Proxy is deployed to. Replace <ST Proxy Node Name> with the name of the node which ST Proxy is deployed on)
/opt/IBM/WebSphere/AppServer/java/bin/java -jar apnstest.jar “/opt/IBM/WebSphere/AppServer/profiles/STPAppProfile/config/cells/<ST Proxy Cell Name>/nodes/<ST Proxy Node Name>/apns-prod.pkcs12”

This should produce output similar to the following:

Testing using default key
About to attempt to connect to APNS
Initialized SSL Context
SSL Socket Created
Starting SSL Handshake
SSL Handshake Complete
Successfully Connected to APNS

Advertisements

IBMIM and Firefox 10

I posted IBM Installation Manager cannot find a supported browser a little while ago about trying to get the IBM Installation Manager (IBMIM) running with Firefox 10. Well today it tripped me up again but this time there was an additional line in <install_root>/launchpad/browser.sh which I have highlighted in blue.

This line will need to be removed as well as adding the line in red and voila.

supportedFirefoxVersion()
{
        case “$*” in
                *Firefox\ [1-9].*) return 0;;
                *Firefox/[1-9].*) return 0;;
#               *Firefox*) return 1;;
                *Firefox\ [1-9][0-9].*) return 0;;