Skip to content

Cannot disable notifications by passing nil to EnableNotifications as documented #366

@Ranveer0508

Description

@Ranveer0508

According to the documentation, it is implied that passing a nil callback to EnableNotifications() should disable notifications for a given characteristic.

However, in practice, doing so results in a runtime error:

must provide a callback for EnableNotifications

This makes it unclear how to properly disable or stop active notifications, especially for cleanup after a reading session is complete.

Expected Behavior:

Calling char.EnableNotifications(nil) should disable notifications, as implied in the documentation.

Actual Behavior:

Calling EnableNotifications(nil) results in an error.

Question:

What is the correct way to stop notifications for a characteristic once you're done?


Please advise if this is a missing feature, a documentation error, or if there's a workaround we should use in the meantime.

I have attached a screenshot of the source code that is responsible for this below

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions