Ways to guess if C2DM is connected

后端 未结 8 1459
花落未央
花落未央 2021-02-02 15:13

I\'m trying to place a best guess estimate as to whether C2DM messages can be received.

I\'ve created an application that relies on pushing information to a phone while

8条回答
  •  盖世英雄少女心
    2021-02-02 15:31

    No that is impossible.As you device authenticated once and generate registration ID and send to third party server(As you already know).Now your work is over once the device has been registered.So Wait for message either you got or not(No guarantee of delivering message as C2DM used UDP Protocol ).

    Alternative Solution

    Although its impossible to check from Google side directly as i mentions above,But if you have any urgency to check connection from your phone then you can take approach like this

    Step 1): Make one Web service to check connection

    Step 2): Call this web service from application that will command to server to send push notification for checking purpose.

    Step 3): Now from server side,server will immediately send push notification for particular device(FROM which it get command)

    Step 4): Now if you got push notification that means you are still connected to C2DM.

    this will not take much time.But follow it only when checking connection is urgent and it is on user

提交回复
热议问题