matejkriz / react-native-today-widget

iOS Today Widget in React Native
Other
415 stars 26 forks source link

Create Today widget with Cocoapods #30

Open Under-Warz opened 5 years ago

Under-Warz commented 5 years ago

Hi,

For those who have some issues to create a Today Widget and link it to use React Native in the widget, here is the missing parts.

  1. Follow up this wonderful Medium article => https://medium.com/@davidskaarup/add-ios-today-widget-to-your-react-native-app-ed9c9b601cc
  2. In step 4. Add New Run Script Phase, replace the script with the updated path for react 0.58
    export NODE_BINARY=node
    ../node_modules/react-native/scripts/react-native-xcode.sh
  3. Edit your Podfile to get something like this :
target 'MainApp' do
 ... pods with React...

  target 'TodayWidget' do
    inherit! :search_paths
  end
end

Tada!

stefanoTron commented 4 years ago

thanks for this! But I'm getting a compilation error: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RCTRootView", referenced from: objc-class-ref in TodayViewController.o "_OBJC_CLASS_$_RCTBundleURLProvider", referenced from: objc-class-ref in TodayViewController.o ld: symbol(s) not found for architecture x86_64

Did anyone encounter this as well?

magrinj commented 4 years ago

@Under-Warz Same problem as @littletower for me, do you have any solution ? I'm stocked with these errors, as react-native native now use auto-link and cocoapods workspace by default

MaxToyberman commented 4 years ago

any solution?

MaxToyberman commented 4 years ago

@magrinj @littletower @Under-Warz , it is finally working, you can follow this video. https://youtu.be/23R3HxnHk3A