Skip to content

API inconsistency #49

Description

@padupuy

Issue

Describe your issue here with as much detail possible.

When RNSettings.getSetting(RNSettings.LOCATION_SETTING) is called, the success callback is called with a string RNSettings.ENABLED or RNSettings.DISABLED.
But when the device listener is called DeviceEventEmitter.addListener(RNSettings.GPS_PROVIDER_EVENT, updatePhonePermissionState);, the success callback is called with an object

{
[RNSettings.LOCATION_SETTING]: RNSettings.ENABLED | RNSettings.DISABLED
}

I suggest to standardize the callback signature, so we could re use the same success callback.


Environment

Click To Expand

react-native info output:

System:
    OS: macOS 10.15.3
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 154.79 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 13.5.0 - ~/.nvm/versions/node/v13.5.0/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v13.5.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.60.0 => 0.60.0
  • Platform that you're experiencing the issue on:
    • iOS
    • Android

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions