swan-io / react-native-browser

An easy-to-use in-app browser module for React Native, powered by Chrome Custom Tabs / SFSafariViewController.
MIT License
135 stars 11 forks source link

Nullable NSNumber should be explictly nonnull to be compatible with Android #4

Closed huextrat closed 7 months ago

huextrat commented 7 months ago

Before submitting a new issue

Bug summary

Since 0.2.0 we are forced to provide barTintColor & controlTintColor otherwise RN display an error : Simulator Screenshot - iPhone 15 Pro - 2024-04-18 at 10 55 55

Library version

0.2.0

Environment info

System:
  OS: macOS 14.4.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 138.52 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: /var/folders/xb/bns2zty1799942jnf2sx7tvr0000gn/T/yarn--1713431360981-0.3248882371003259/node
  Yarn:
    version: 1.22.19
    path: /var/folders/xb/bns2zty1799942jnf2sx7tvr0000gn/T/yarn--1713431360981-0.3248882371003259/yarn
  npm:
    version: 10.1.0
    path: ~/.nvm/versions/node/v20.9.0/bin/npm
  Watchman:
    version: 2023.09.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/hugo/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "23"
      - "26"
      - "28"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
    System Images:
      - android-23 | ARM 64 v8a
      - android-24 | ARM 64 v8a
      - android-27 | ARM 64 v8a
      - android-28 | Google APIs ARM 64 v8a
      - android-28 | Google ARM64-V8a Play ARM 64 v8a
      - android-28 | Google Play Intel x86 Atom
      - android-28 | Google Play Intel x86_64 Atom
      - android-31 | Google Play ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2023.2 AI-232.10227.8.2321.11479570
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.0.0
    path: /Users/hugo/.rvm/rubies/ruby-3.0.0/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.0-rc.8
    wanted: 0.74.0-rc.8
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

  1. openBrowser without barTintColor or controlTintColor

Reproducible sample code

openBrowser("https://swan.io", {
      onOpen: () => {},
      onClose: (url) => {},
    }).catch((error) => {
      console.error(error);
    });
zoontek commented 7 months ago

Instead of relying on -1, I forwarded a whole object to the native side: https://github.com/swan-io/react-native-browser/pull/6. It's IMHO cleaner.

Tested on Android / iOS, new and old arch.

huextrat commented 7 months ago

Perfect thanks @zoontek