none
Windows 10 Push Notification not working using OMADM RRS feed

  • Question

  • Hello,

    I am trying to implement Push Notification for Windows 10 desktop and mobile(build 10.0.14393 v 1607). I got the PackageName, Package SID and Client Secret by following the steps mentioned in - https://msdn.microsoft.com/en-us/library/windows/hardware/mt692524(v=vs.85).aspx - Push notification support for device management.

    The steps that I follow for receiving push notification are as follows:

    1. Register the device for push notification using the DM Client CSP

    <Add> <CmdID>@commandId</CmdID><Item><Target><LocURI>./Vendor/MSFT/DMClient/Provider/MY_MDM/Push/PFN</LocURI></Target><Meta><Format xmlns=\"syncml:metinf\">chr</Format></Meta><Data>@PFN</Data></Item></Add>


    2. Get the Channel Uri using the GET command

    <Get><CmdID>@commandId</CmdID><Item><Target><LocURI>./Vendor/MSFT/DMClient/Provider/MY_MDM/Push/ChannelURI</LocURI></Target>  </Item></Get>


    3.Get the access token

    REQUEST_HEADER
    POST: https://login.live.com/accesstoken.srf
    Content-Type: application/x-www-form-urlencoded 
    Content-Length: 209
    Host: login.live.com
    REQUEST_BODY
    grant_type=client_credentials&client_id=ms-app%3a%2f%2fPACKAGE_SID&client_secret=CLIENT_SECRET&scope=notify.windows.com

    This returns the ACCESS_TOKEN  in the json response

    4. Use this access token for PUSH NOTIFICATION
    REQUEST_HEADER
    POST CHANNEL_URI
    Content-Type: application/octet-stream
    X-WNS-Type: wns/raw
    Authorization: Bearer ACCESS_TOKEN

    Host: cloud.notify.windows.com
    Content-Length: 5

    REQUEST_BODY
    Hello

    The response after I send notification is 
    [HTTP/1.1 200 OK], Strict-Transport-Security=[max-age=31536000; includeSubDomains], X-WNS-DEBUG-TRACE=[HK2SCH130020149], X-WNS-STATUS=[received], X-WNS-MSG-ID=[344C0A761619A9C5], X-WNS-NOTIFICATIONSTATUS=[received], Content-Length=[0]

    Still the device does not get any sync notification. Can you please tell me what am I doing wrong?

    Regards









    Tuesday, October 18, 2016 6:49 AM

All replies

  • Hi,

    Can someone who has worked with Push Notifications guide me to solve this issue?

    Thanks

    Monday, November 7, 2016 6:39 AM
  • Hi Thanu,

    Following are the steps that worked for me when I was working on a management component for Win10.

    PART 1 : Create a dummy app and link it to Windows Dev Center

    • Visit Windows Dev Centre and sign-in using a developer account.
    • Resister an app with the Dashboard by reserving an application name .(Make sure you never delete this App, or your push notification credentials will be invalidated)

    • Obtain the identity values of your app by selecting "Services" -> "Push notifications" -> "Live Service Site" as shown below. A few important configuration values need to be copied from the new tab that opens up viz - [ApplicationId, Application Secret, Package SID, Application Identity]. After that click "Save" and go back to the previous tab.

    • Go to the "Apps" section on the Windows Dev Centre page and the app will be seen there. Click on the app and navigate to "App management" -> "App identity". From here we need an important configuration value, the PFN (Package Family Name).

    PART 2 : Send raw WNS notification from the server

    • Using the DMClient CSP, from the server send a SyncML to the Win10 device, to set the PFN.

    <SyncBody>
          <Replace>
             <CmdID>5</CmdID>
             <Item>
                <Target>
                   <LocURI>./Vendor/MSFT/DMClient/Provider/MDMServer/Push/PFN</LocURI>
                </Target>
                <Data>{PFN}</Data>
                <Meta>
                   <Format xmlns="syncml:metinf">chr</Format>
                </Meta>
            </Item>
         </Replace>
        <Final />
     </SyncBody>
    • The device will respond with 200 OK. On receiving the PFN from the server, the inbuilt "work access" client will force the device to register a persistent connection with the WNS cloud and a device specific "ChannelURI" will be provided for the same.
    • Using the DMClient CSP, the server needs to query the Channel URI from the device.

    <SyncBody>
          <Get>
             <CmdID>5</CmdID>
             <Item>
                <Target>
                   <LocURI>./Vendor/MSFT/DMClient/Provider/MDMServer/Push/ChannelURI</LocURI>
                </Target>
             </Item>
             <Item>
                <Target>
                   <LocURI>./Vendor/MSFT/DMClient/Provider/MDMServer/Push/Status</LocURI>
                </Target>
            </Item>
         </Get>
        <Final />
    </SyncBody>
    • Once server has the device specific Channel URI, it can send a WNS notification. Additional information needed for sending a raw notification are: "PackageId" and "Client secret" which were available in Part1. (Implementation details for this step are developer specific and have been avoided here, but check the below links)

    Reference Links:

    1. https://msdn.microsoft.com/en-us/library/windows/hardware/dn904951(v=vs.85).aspx
    2. https://msdn.microsoft.com/en-us/library/windows/apps/hh465407.aspx
    3. https://blogs.msdn.microsoft.com/wsdevsol/2014/08/21/windows-phone-8-1-mdm-push-functionality/
    4. https://social.msdn.microsoft.com/Forums/en-US/b2a891ff-7f3c-4828-b842-a8ce6bf69727/mdm-server-push-in-windows-phone-81?forum=developingmdmsolutions&prof=required

    Hope this helps :)

    - Dhruvesh

    • Proposed as answer by DhruveshRathore Wednesday, November 23, 2016 6:02 AM
    Tuesday, November 22, 2016 6:45 PM
  • Hello Dhruvesh,

    Thanks for the reply. I have already done the steps mentioned by you and I get 200Ok when I send a push notification but the phone/laptop/tablet does not sync with my MDM server. 

    Can you suggest any method using which I can check why the notification is not received by the device?

    Regards

    Tuesday, November 29, 2016 9:32 AM
  • Hey thanu shunmugampillai,

    Did you find out the reason why it was not working for you?

    I am also facing the similar issue right now.

    Thanks

    Tuesday, August 14, 2018 12:45 PM