Skip to content

Settings API - issue with watchKeys function callback #28213

@Simek

Description

@Simek

Description:

This issue was reported a while ago and become "stale": #21607

I was working on the updates and Snack example for the Settings API website page (refs.: facebook/react-native-website#1579) and I have stumble upon a problem. It seems like Settings.watchKeys function callback isn't fired properly.

I have studied the source code (https://github.com/facebook/react-native/blob/1151c096dab17e5d9a6ac05b61aacecd4305f3db/Libraries/Settings/Settings.ios.js) to confirm that I have done everything right, but there is still a possibility of an issue in my code since I was never earlier working with this API.

Nonetheless Settings.set and Settings.get method seems to work properly. After pressing one of the buttons and than changing example in the editor App preview will be refreshed and stored value will be updated correctly.

React Native version:

expo 36.0.0

Steps To Reproduce

  1. Setup Settings.watchKeys with a callback.
  2. Change key value using Settings.set.
  3. Callback isn't fired.

Expected Results

watchKeys function should fire callback on value change.

Snack, code example, screenshot, or link to a repository:

https://snack.expo.io/@simek/settings-api

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions