Skip to content

AwesomeAndrewMK/react-native-watch-connectivity

 
 

Repository files navigation

React Native Watch Connectivity

Communicate with your Apple Watch apps over the React Native bridge.

Note: This library does not allow you to write your Apple Watch apps in React Native but rather allows your RN iOS app to communicate with a watch app written in Obj-C/Swift.

Documentation

http://mtford.co.uk/react-native-watch-connectivity/

Demo

The featured screenshot is from the example app. To run the example:

git clone https://github.com/mtford90/react-native-watch-connectivity.git
cd react-native-watch-connectivity/example
yarn install
cd ios
pod install
cd ..
yarn ios # Run app
open ios/RNWatchExample.xcworkspace # Run watch app from Xcode

Install

npm install react-native-watch-connectivity --save
# or
yarn add react-native-watch-connectivity

Link

Note: this library now supports autolinking for RN 0.60+.

For RN <0.60 link via:

react-native link

Or else add the xcodeproj or .h/.m files directly to your project via XCode

Manual Linking

Or you can link the library manually by adding node_modules/react-native-watch-connectivity/ios/RNWatch.xcodeproj to your project and ensuring that libRNWatch.a is present in the Link Binary With Libraries build phase.

Alternatively, if you're using CocoaPods, you can add the following to your Podfile:

pod 'RNWatch', :path => '../node_modules/react-native-watch-connectivity'

and run pod install.

About

Enable communication between iWatch app and react native

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 60.6%
  • Objective-C 21.0%
  • Swift 11.9%
  • Ruby 4.6%
  • JavaScript 1.8%
  • C 0.1%