i tried to send a push to browser " a browser message " to my device connected to mds via bes.
when i send my request (and request headers ...) the response is a http 202 and the pap response is 1001 which is accepted.
when i check the device, nothing happen, the push is not delivered. help me
here is my class:
public class PushSender {
IdGenerator idGenerator= new IdGeneratorImpl();
String destination ="7874";//for bes => port , for bis :app id
List<String> addresses = new ArrayList<String>();
//String mds="http://win-uhgr7vs88uz.assabb.com:8080/";
public void initPushSender() {
addresses.add("bestest@assa-associates.com");
PushMessageControl pushMessageControl=new PushMessageControl(false,idGenerator,"Marhaba push",addresses);
Content papContent =new TextContent("message a envoyer");
ContentType contentType=new ContentType("TEXT_PLAIN"); //TEXT_PLAIN//TEXT_HTML
papContent.setContentType(contentType);
papContent.setHeader("X-Wap-Application-Id", "/");
papContent.setHeader("X-Rim-Push-Type", "browser-message");
papContent.setHeader("X-Rim-Push-Title", "push title");
papContent.setHeader("X-Rim-Push-Dest-Port", "7874");
PushSDKPropertiesImpl properties=new PushSDKPropertiesImpl();
HttpClient client= new HttpClientImpl();
((HttpClientImpl) client).setPushSDKProperties(properties);
PapService papService=new PapServiceImpl();
papService.setHttpClient(client);
papService.setPushSDKProperties(properties);
try {
PushResponse response =papService.push(null,null,destination,pushMessageControl, papContent);
System.out.println("code Response: "+response.getCode());
System.out.println(response);
} catch (PushSDKException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (BadMessageException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnauthorizedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String []args){
PushSender pu=new PushSender();
pu.initPushSender();
}
}
even when i try to send rim push , response is 1001 but push not delivered.
when i use a sample c# app, the push is delivered