/registerDevice API instead of SDK

Answered

Comments

3 comments

  • Avatar
    Gayview Mahat

    Hello! Could you possibly remove all the comments from the code and make sure the syntax is correct (i.e. the app code and push token should be in quotes)?

    And the most important question — why would you need to register devices from your server? What values do you use in push token field?

  • Avatar
    jatinpatel

    var options = { method: 'POST', url: 'https://cp.pushwoosh.com/json/1.3/registerDevice', json: true, body: { "application":"1234-5678", "push_token":"56edcd52bc03a686ee024ffa40779b9c5ae56cd6dbd883310f2cfcf6803427ee", "hwid": "BA634921-99CC-4BDC-90F0-E5179F2B60F5", "device_type":"1" } }; Please see - I have everything in quotes. The reason to this from the server is everything from the apps goes through our server. When app is first launched, app sends the deviceid, devicetoken to the server and continuously updates when necessary based on the business logic.

  • Avatar
    jatinpatel

    problem was that the payload needs to be inside "request" object...it's fixed now.

Please sign in to leave a comment.