1

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

4

1 回答 1

0

请确认您是否能够使用安装目录中的 JDE 示例通过 BES/MDS 成功进行 PAP 推送

服务端应用程序:C:\Eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\server\httppushdemo

客户端应用程序:C:\Eclipse\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.33\components\samples\com\rim\samples\device\httppushdemo

如果您使用可靠推送,请确保将此端口添加到您的 BES 配置中。 http://docs.blackberry.com/en/admin/deliverables/14334/Specify_device_ports_for_reliable_push_requests_490067_11.jsp

谢谢,

古尔泰伊

于 2012-07-31T19:53:59.107 回答