React-native-modal-datetime-picker: Date Picker not working on real iOS device but work on simulator

Created on 7 Mar 2020  路  2Comments  路  Source: mmazzarolo/react-native-modal-datetime-picker

Environment

System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 24.95 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.16.1 - /usr/local/bin/node
    Yarn: 1.22.0 - /usr/local/bin/yarn
    npm: 6.13.4 - /usr/local/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
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6241897
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.4 => 0.61.4 
  npmGlobalPackages:
    react-native-cli: 2.0.1

Platforms

iOS

Versions

  • Android:9pie
  • iOS:13.2
  • react-native-modal-datetime-picker: 7.6.0
  • react-native:0.61.4
  • react:16.9.0

Description

Below is my code.

When I run on the simulator device it works perfectly. But when I publish to AppStore and download to real devices time picker is working except date picker is not working it locked.
It makes me hard to correct a problem.

Reproducible Demo

<DateTimePicker
    mode='date'
    minimumDate={new Date()}
    pickerTextEllipsisLen={15}
    isVisible={this.state.isDatePickerVisible}
    onConfirm={this._handleDatePicked}
    onCancel={this._hideDatePicker}
/>


bug

Most helpful comment

OK, I found the solution.
You're app is probably running in dark mode, which is not supported by React-Native for the pickers yet.
If you're not planning to support the iOS dark mode in your app, add the following to your info.plist:

<key>UIUserInterfaceStyle</key>
<string>Light</string>

You can read from the bottom of library readme.

All 2 comments

I am also have the same problem

OK, I found the solution.
You're app is probably running in dark mode, which is not supported by React-Native for the pickers yet.
If you're not planning to support the iOS dark mode in your app, add the following to your info.plist:

<key>UIUserInterfaceStyle</key>
<string>Light</string>

You can read from the bottom of library readme.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

taylorkline picture taylorkline  路  4Comments

DominicHan picture DominicHan  路  4Comments

mustafaskyer picture mustafaskyer  路  3Comments

gopikasireddy202 picture gopikasireddy202  路  3Comments

onusgit picture onusgit  路  7Comments