matejkriz / react-native-today-widget

iOS Today Widget in React Native
Other
421 stars 24 forks source link

Basic Example Displays "Unable to Load" every 1/4 times it's displayed #27

Open kyle-ssg opened 6 years ago

kyle-ssg commented 6 years ago

Description

Swiping between widgets and the desktop I find that every 1/4 times the widget displays "Unable to load"

Steps to reproduce

Wait on home screen 3-4 seconds and swipe to widget screen, repeat several times

System configuration

Please add result of react-native info command and react-native-today-widget version used


react-native-today-widget 1.0.0

Environment:
  OS: macOS High Sierra 10.13.4
  Node: 9.8.0
  Yarn: 1.3.2
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.4.1 Build version 9F2000
  Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.4 => 0.55.4

This is a real shame at the moment as when this does work it's awesome, seriously great work making this library!

Edit: I can only replicate this on an actual device, it always works on the simulator.

kyle-ssg commented 6 years ago

I think this is due to even the basic app using too much memory, I found this was fixed by doing a few things, I upgraded react native and removed any dev dependencies:

{
  "name": "Basic",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-native-today-widget": "^1.0.0"
  }
}

Next, I removed any libs that i didn't use from RNTodayWidgetExtension.xcodeproj Link Binary With Libraries Step: Screenshot here

kyle-ssg commented 6 years ago

It seems though that even adding really basic additions to the markup cause this issue to show, unfortunately, unless this can be fixed somehow it makes the lib pretty unusable.

jixiangyibao commented 5 years ago

maybe my answer in https://github.com/matejkriz/react-native-today-widget/issues/31 will help you to some extent.