12-19-2012 02:50 AM
i'm a new developer in push notification. I already install Push SDK for WinXP and can run successfully. But I have some trouble:
Please advice and sorry for my bad english ![]()
12-19-2012 08:07 AM
For #1 do you actually subscribe from the client-side? Is your server-side accessible from the Internet anc can you check that it received the registration from the device?
For #2, is there any other info in the log?
12-19-2012 09:33 PM
For 1#: do you actually subscribe from the client-side?
I'm using source code PushAgent.java and PushMessageReader.java from here http://supportforums.blackberry.com/t5/BlackBerry-
Is your server-side accessible from the Internet anc can you check that it received the registration from the device?
You mean is I must have IP static (public)? I use laptop with dynamic ip and push server install in localhost, not real server.
for 2#: this is full log:
ERROR - [net.rim.pushsdk.debugportal.push.PushDataPushCont
net.rim.pushsdk.commons.PushSDKException: SocketTimeoutException caught sending message to PPG URL address: https://cpXXX.pushapi.eval.blackberry.com/mss/PD_p
at net.rim.pushsdk.pap.PapServiceImpl.sendToPpg(PapSe
at net.rim.pushsdk.pap.PapServiceImpl.pushToPpg(PapSe
at net.rim.pushsdk.pap.PapServiceImpl.push(PapService
at net.rim.pushsdk.push.PushServiceImpl.push(PushServ
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ
at sun.reflect.NativeMethodAccessorImpl.invoke(Native
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoi
at org.springframework.aop.framework.ReflectiveMethod
at org.springframework.aop.framework.ReflectiveMethod
at org.springframework.transaction.interceptor.Transa
at org.springframework.aop.framework.ReflectiveMethod
at org.springframework.aop.interceptor.ExposeInvocati
at org.springframework.aop.framework.ReflectiveMethod
at org.springframework.aop.framework.JdkDynamicAopPro
at $Proxy10.push(Unknown Source)
at net.rim.pushsdk.debugportal.push.PushDataPushContr
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ
at sun.reflect.NativeMethodAccessorImpl.invoke(Native
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.web.bind.annotation.support.Ha
at org.springframework.web.bind.annotation.support.Ha
at org.springframework.web.servlet.mvc.annotation.Ann
at org.springframework.web.servlet.mvc.annotation.Ann
at org.springframework.web.servlet.DispatcherServlet.
at org.springframework.web.servlet.DispatcherServlet.
at org.springframework.web.servlet.FrameworkServlet.p
at org.springframework.web.servlet.FrameworkServlet.d
at javax.servlet.http.HttpServlet.service(HttpServlet
at javax.servlet.http.HttpServlet.service(HttpServlet
at org.apache.catalina.core.ApplicationFilterChain.in
at org.apache.catalina.core.ApplicationFilterChain.do
at org.springframework.web.filter.CharacterEncodingFi
at org.springframework.web.filter.OncePerRequestFilte
at org.apache.catalina.core.ApplicationFilterChain.in
at org.apache.catalina.core.ApplicationFilterChain.do
at org.apache.catalina.core.StandardWrapperValve.invo
at org.apache.catalina.core.StandardContextValve.invo
at org.apache.catalina.authenticator.AuthenticatorBas
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke
at org.apache.catalina.valves.AccessLogValve.invoke(A
at org.apache.catalina.core.StandardEngineValve.invok
at org.apache.catalina.connector.CoyoteAdapter.servic
at org.apache.coyote.http11.Http11Processor.process(H
at org.apache.coyote.http11.Http11Protocol$Http11Conn
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(
at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.
at java.net.SocketInputStream.read(SocketInputStream.
at sun.security.ssl.InputRecord.readFully(InputRecord
at sun.security.ssl.InputRecord.read(InputRecord.java
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocke
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLS
at sun.security.ssl.AppInputStream.read(AppInputStrea
at java.io.BufferedInputStream.fill(BufferedInputStre
at java.io.BufferedInputStream.read1(BufferedInputStr
at java.io.BufferedInputStream.read(BufferedInputStre
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.jav
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream
at java.net.HttpURLConnection.getResponseCode(HttpURL
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getRespo
at net.rim.pushsdk.commons.http.HttpClientImpl.transm
at net.rim.pushsdk.pap.PapServiceImpl.sendToPpg(PapSe
... 49 more
12-20-2012 09:25 AM
Could you try pushing again today? There were some issues with sending Push Messages through the EVAL server yesterday which have since been resolved.
12-20-2012 09:33 PM
Could you try pushing again today? There were some issues with sending Push Messages through the EVAL server yesterday which have since been resolved.
Yes, today I can send push message to my client app and my client-app can receive . Thank you for you help.
Next question is:
Sorry if I ask many question
because I'm a newbie in Push Notification development.
Regards & Thanks
Budiman
12-21-2012 07:41 AM
1. Both samples included with the Push Service SDK will receive pushes even when the app is closed or minimized by the user
2. The code should be used where you process the push data. For furtehr help with this I would suggest porting to the Java board.
3. Ideally you should have the client-side application perform a registration to your server. The subscriber query you mention is really only to synchronize subscribers on a periodic basis, not meant to be a means to check who is subscribed for every push.
12-21-2012 08:41 AM
Budiman if you are using the Push Service SDK Debug Portal helper application, as Garett mentioned, you need to subscribe from your device side application to the Debug Portal helper application. The Debug Portal helper application saves subscriptions in its persistent store - it keeps a subscriber id(username) -> PIN mapping. If you do subscribe with the Debug Portal then you can use the Subscriber Management -> Query Status in PPG menu option to find out if the subscriber id(username) you specify is subscribed with the RIM push server.
12-21-2012 08:47 AM
Also if you are looking how to set the application icon the Push SDK comes with hand held sample applications that demonstrate how to do this. Look at:
push-sdk-install-dir\sample-push-enabled-app\sampl
private static void updateIndicator( int inc ) {
//#ifndef HANDHELD_VERSION_42
// update indicator if device software is 4.6 or greater
ApplicationIndicatorRegistry indicatorRegistry = ApplicationIndicatorRegistry.getInstance();
ApplicationIndicator indicator = indicatorRegistry.getApplicationIndicator();
boolean refresh;
if( indicator == null ) {
ApplicationIcon icon = new ApplicationIcon( EncodedImage.getEncodedImageResource( "app_icon_small.png" ) );
indicator = indicatorRegistry.register( icon, false, true );
refresh = true;
} else {
refresh = inc == 0;
}
int unreadCount = 0;
if( refresh ) {
PushMessage[] messages = PersistentStorage.getMessages();
for( int i = messages.length - 1; i >= 0; i-- ) {
if( messages[ i ].isUnread() ) {
unreadCount++;
}
}
} else {
unreadCount = indicator.getValue() + inc;
}
indicator.setValue( unreadCount );
if( unreadCount > 0 ) {
indicator.setVisible( true );
} else {
indicator.setVisible( false );
}
//#endif
}
01-01-2013 09:59 PM
Merry Christmas 2012 and Happy New Year 2013 all. Wish you all the best and dream come true in 2013. Sorry for late reply because i'm in holiday.
Thank you for you help
Thank you very much for your code. I will test it in my application.
01-06-2013 10:01 PM
Hi gbeukeboom,
After i install PUSH SDK in my server, when i hit https://my_ip_server:8443/sample-push-initiator
I got error:
ERROR: Was unable to add a push application for the Sample Push Initiator due to the following reason:
DataAccessException caught finding application by id: 3xxx-8l1xxxxxxxxxxxxxx
The logs should be consulted for a full stack trace.
but I can open https://localhost:8443/sample-push-initiator correctly.
Note: I'm install PUSH SDK in 2 different machine. For Development I install in virtual box and for production I install in server (Fedora) and server can access from public, but for development can't.
Please advice.