none
[UWP][RS2:1703]Cannot register GattCharacteristicNotificationTrigger Background Task after Creators Update

    Question

  • This feature was working in the past. Switching to Creators Update SDK. Capabilities in manifest file as is works for the previous SDK. BackgroundTaskBuilder.Register() triggers this error. Message is as follows:

    Access is denied.

    Your App does not have permission to use the Gatt Service in the background. Make sure you have declared the DeviceCapability and Task Type 'bluetooth' in your manifest and that the application has been granted access to this device.

    Thursday, April 20, 2017 2:56 AM

All replies

  • @Tyress,

    Thanks for reporting. We are trying to investigate and will report it when we reproduced it by testing.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 21, 2017 2:14 PM
    Moderator
  • @Tyress

    In your app manifest, you will need to ensure you have both of the following capabilities declared:

          <Extensions>
            <Extension 
                Category="windows.backgroundTasks"
                EntryPoint="GattClientBackgroundTasks.CharacteristicChangeTask">
              <BackgroundTasks>
                <Task Type="bluetooth" />
              </BackgroundTasks>
            </Extension>
          </Extensions>
    

      <Capabilities>
        <DeviceCapability Name="bluetooth" />
      </Capabilities>
    


    This posting is provided AS IS with no warranties, and confers no rights.

    Monday, April 24, 2017 5:42 PM
  • @Tyress

    In your app manifest, you will need to ensure you have both of the following capabilities declared:

          <Extensions>
            <Extension 
                Category="windows.backgroundTasks"
                EntryPoint="GattClientBackgroundTasks.CharacteristicChangeTask">
              <BackgroundTasks>
                <Task Type="bluetooth" />
              </BackgroundTasks>
            </Extension>
          </Extensions>

      <Capabilities>
        <DeviceCapability Name="bluetooth" />
      </Capabilities>


    This posting is provided AS IS with no warranties, and confers no rights.

    In addition to the app manifest entries, it is also important that prior to registering your background trigger for a specific device, you call RequestAccessAsync from a UX thread on the GattDeviceService which contains the characteristic.


    This posting is provided AS IS with no warranties, and confers no rights.


    Monday, April 24, 2017 5:45 PM