├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── README.md ├── WatchManager.js ├── android ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ ├── react.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── watchdemo │ │ │ └── MainActivity.java │ │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios ├── Counter Extension │ ├── Assets.xcassets │ │ └── README__ignoredByTemplate__ │ ├── ExtensionDelegate.swift │ ├── Info.plist │ ├── InterfaceController.swift │ ├── NotificationController.swift │ └── PushNotificationPayload.apns ├── Counter │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ └── Interface.storyboard │ └── Info.plist ├── WatchDemo.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── WatchDemo.xcscheme ├── WatchDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── WatchManager.h │ ├── WatchManager.m │ └── main.m └── WatchDemoTests │ ├── Info.plist │ └── WatchDemoTests.m └── package.json /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ugh 11 | .*/node_modules/babel.* 12 | .*/node_modules/babylon.* 13 | .*/node_modules/invariant.* 14 | 15 | # Ignore react and fbjs where there are overlaps, but don't ignore 16 | # anything that react-native relies on 17 | .*/node_modules/fbjs-haste/.*/__tests__/.* 18 | .*/node_modules/fbjs-haste/__forks__/Map.js 19 | .*/node_modules/fbjs-haste/__forks__/Promise.js 20 | .*/node_modules/fbjs-haste/__forks__/fetch.js 21 | .*/node_modules/fbjs-haste/core/ExecutionEnvironment.js 22 | .*/node_modules/fbjs-haste/core/isEmpty.js 23 | .*/node_modules/fbjs-haste/crypto/crc32.js 24 | .*/node_modules/fbjs-haste/stubs/ErrorUtils.js 25 | .*/node_modules/react-haste/React.js 26 | .*/node_modules/react-haste/renderers/dom/ReactDOM.js 27 | .*/node_modules/react-haste/renderers/shared/event/eventPlugins/ResponderEventPlugin.js 28 | 29 | # Ignore commoner tests 30 | .*/node_modules/commoner/test/.* 31 | 32 | # See https://github.com/facebook/flow/issues/442 33 | .*/react-tools/node_modules/commoner/lib/reader.js 34 | 35 | # Ignore jest 36 | .*/node_modules/jest-cli/.* 37 | 38 | # Ignore Website 39 | .*/website/.* 40 | 41 | [include] 42 | 43 | [libs] 44 | node_modules/react-native/Libraries/react-native/react-native-interface.js 45 | 46 | [options] 47 | module.system=haste 48 | 49 | munge_underscores=true 50 | 51 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 52 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub' 53 | 54 | suppress_type=$FlowIssue 55 | suppress_type=$FlowFixMe 56 | suppress_type=$FixMe 57 | 58 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 59 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+ 60 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 61 | 62 | [version] 63 | 0.19.0 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | .idea 28 | .gradle 29 | local.properties 30 | 31 | # node.js 32 | # 33 | node_modules/ 34 | npm-debug.log 35 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-watch 2 | react-native-watch includes a demo iOS app with React Native bindings to communicate with iOS WatchKit apps. 3 | 4 | [![Demo](http://img.youtube.com/vi/F2xRSyX8i0o/0.jpg)](http://www.youtube.com/watch?v=F2xRSyX8i0o) 5 | 6 | ** Note: This demo does not use RN views for the UI since WKInterface components are not yet supported. But fear not, using Interface Builder to build out a Watch app UI is not too difficult to learn :) ** 7 | 8 | ## Goal 9 | This repo aims to eventually become an npm module with iOS and Android libraries to provide a simple and cross platform API for watch messaging. 10 | 11 | ## Getting Started 12 | 13 | The demo project should just required a build and run in XCode. However, if you would like to integrate the bindings in your application, you can follow these steps: 14 | 15 | 1. Copy these files into your project where you see fit: 16 | These files contain the Objective C RCT module declaration for RN: 17 | `WatchManager.m` 18 | `WatchManager.h`. 19 | This is the wrapper for native module: 20 | `WatchManager.js` 21 | 2. Create a watch app (plenty of tutorials out there) or use an existing. In your Exension’s default InterfaceController.swift, you’ll have to import WatchConnectivity and implement the WCSessionDelegate. You can add the didReceiveMessage handler like below. (You can also find an example of sending messages in InterfaceController.swift). 22 | ``` 23 | import WatchConnectivity 24 | 25 | class InterfaceController: WKInterfaceController, WCSessionDelegate { 26 | 27 | ... 28 | 29 | func session(session: WCSession, didReceiveMessage message: [String : AnyObject], replyHandler: ([String : AnyObject]) -> Void) { 30 | let message = message as NSDictionary; 31 | let value = message.valueForKey("value") as! Int; 32 | 33 | print("received value" + String(value)) 34 | } 35 | ``` 36 | 3. You can import `WatchManager.js` and use these methods to setup the WCSession and start sending/receiving data: 37 | ``` 38 | let WatchManager = require('./WatchManager.js'); 39 | 40 | // initialize the session 41 | WatchManager.activate(); 42 | 43 | // send JSON (this turns into an NSDictionary) 44 | WatchManager.sendMessage({some:'data'}); 45 | 46 | // subscribe to incoming message events 47 | var listener = WatchManager.addMessageListener(msg => { 48 | console.log(msg); 49 | }); 50 | 51 | // unsubscribe 52 | WatchManager.removeMessageListener(listener); // alternatively: listener.remove(); 53 | ``` 54 | 55 | ## Known Issues 56 | - This module doesn't currently provide additional events/messages for WCSession state. 57 | 58 | -------------------------------------------------------------------------------- /WatchManager.js: -------------------------------------------------------------------------------- 1 | var React = require('react-native'); 2 | var { 3 | NativeAppEventEmitter, 4 | NativeModules 5 | } = require('react-native'); 6 | 7 | var WatchManager = NativeModules.WatchManager; 8 | 9 | module.exports = { 10 | 11 | activate: () => { 12 | WatchManager.activate(); 13 | }, 14 | 15 | addMessageListener: (callback, context: null) => { 16 | return NativeAppEventEmitter.addListener('onWatchMessage', (message) => { 17 | callback.call(context, message); 18 | }); 19 | }, 20 | 21 | removeMessageListener: subscription => { 22 | subscription.remove(); 23 | }, 24 | 25 | sendMessage: msg => { 26 | WatchManager.sendMessage(msg); 27 | } 28 | }; -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | /** 4 | * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets. 5 | * These basically call `react-native bundle` with the correct arguments during the Android build 6 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 7 | * bundle directly from the development server. Below you can see all the possible configurations 8 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 9 | * `apply from: "react.gradle"` line. 10 | * 11 | * project.ext.react = [ 12 | * // the name of the generated asset file containing your JS bundle 13 | * bundleAssetName: "index.android.bundle", 14 | * 15 | * // the entry file for bundle generation 16 | * entryFile: "index.android.js", 17 | * 18 | * // whether to bundle JS and assets in debug mode 19 | * bundleInDebug: false, 20 | * 21 | * // whether to bundle JS and assets in release mode 22 | * bundleInRelease: true, 23 | * 24 | * // the root of your project, i.e. where "package.json" lives 25 | * root: "../../", 26 | * 27 | * // where to put the JS bundle asset in debug mode 28 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 29 | * 30 | * // where to put the JS bundle asset in release mode 31 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 32 | * 33 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 34 | * // require('./image.png')), in debug mode 35 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 36 | * 37 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 38 | * // require('./image.png')), in release mode 39 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 40 | * 41 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 42 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 43 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 44 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 45 | * // for example, you might want to remove it from here. 46 | * inputExcludes: ["android/**", "ios/**"] 47 | * ] 48 | */ 49 | 50 | apply from: "react.gradle" 51 | 52 | android { 53 | compileSdkVersion 23 54 | buildToolsVersion "23.0.1" 55 | 56 | defaultConfig { 57 | applicationId "com.watchdemo" 58 | minSdkVersion 16 59 | targetSdkVersion 22 60 | versionCode 1 61 | versionName "1.0" 62 | ndk { 63 | abiFilters "armeabi-v7a", "x86" 64 | } 65 | } 66 | buildTypes { 67 | release { 68 | minifyEnabled false // Set this to true to enable Proguard 69 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 70 | } 71 | } 72 | } 73 | 74 | dependencies { 75 | compile fileTree(dir: "libs", include: ["*.jar"]) 76 | compile "com.android.support:appcompat-v7:23.0.1" 77 | compile "com.facebook.react:react-native:0.17.+" 78 | } 79 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | 30 | # Do not strip any method/class that is annotated with @DoNotStrip 31 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 32 | -keepclassmembers class * { 33 | @com.facebook.proguard.annotations.DoNotStrip *; 34 | } 35 | 36 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 37 | void set*(***); 38 | *** get*(); 39 | } 40 | 41 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 42 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 43 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 44 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactProp ; } 45 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup ; } 46 | 47 | # okhttp 48 | 49 | -keepattributes Signature 50 | -keepattributes *Annotation* 51 | -keep class com.squareup.okhttp.** { *; } 52 | -keep interface com.squareup.okhttp.** { *; } 53 | -dontwarn com.squareup.okhttp.** 54 | 55 | # okio 56 | 57 | -keep class sun.misc.Unsafe { *; } 58 | -dontwarn java.nio.file.* 59 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 60 | -dontwarn okio.** 61 | -------------------------------------------------------------------------------- /android/app/react.gradle: -------------------------------------------------------------------------------- 1 | import org.apache.tools.ant.taskdefs.condition.Os 2 | 3 | def config = project.hasProperty("react") ? project.react : []; 4 | 5 | def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" 6 | def entryFile = config.entryFile ?: "index.android.js" 7 | 8 | // because elvis operator 9 | def elvisFile(thing) { 10 | return thing ? file(thing) : null; 11 | } 12 | 13 | def reactRoot = elvisFile(config.root) ?: file("../../") 14 | def jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?: 15 | file("$buildDir/intermediates/assets/debug") 16 | def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?: 17 | file("$buildDir/intermediates/assets/release") 18 | def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?: 19 | file("$buildDir/intermediates/res/merged/debug") 20 | def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?: 21 | file("$buildDir/intermediates/res/merged/release") 22 | def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] 23 | 24 | def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName") 25 | def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName") 26 | 27 | task bundleDebugJsAndAssets(type: Exec) { 28 | // create dirs if they are not there (e.g. the "clean" task just ran) 29 | doFirst { 30 | jsBundleDirDebug.mkdirs() 31 | resourcesDirDebug.mkdirs() 32 | } 33 | 34 | // set up inputs and outputs so gradle can cache the result 35 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 36 | outputs.dir jsBundleDirDebug 37 | outputs.dir resourcesDirDebug 38 | 39 | // set up the call to the react-native cli 40 | workingDir reactRoot 41 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 42 | commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", 43 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug 44 | } else { 45 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", 46 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug 47 | } 48 | 49 | enabled config.bundleInDebug ?: false 50 | } 51 | 52 | task bundleReleaseJsAndAssets(type: Exec) { 53 | // create dirs if they are not there (e.g. the "clean" task just ran) 54 | doFirst { 55 | jsBundleDirRelease.mkdirs() 56 | resourcesDirRelease.mkdirs() 57 | } 58 | 59 | // set up inputs and outputs so gradle can cache the result 60 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 61 | outputs.dir jsBundleDirRelease 62 | outputs.dir resourcesDirRelease 63 | 64 | // set up the call to the react-native cli 65 | workingDir reactRoot 66 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 67 | commandLine "cmd","/c", "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", 68 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease 69 | } else { 70 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", 71 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease 72 | } 73 | 74 | enabled config.bundleInRelease ?: true 75 | } 76 | 77 | gradle.projectsEvaluated { 78 | // hook bundleDebugJsAndAssets into the android build process 79 | bundleDebugJsAndAssets.dependsOn mergeDebugResources 80 | bundleDebugJsAndAssets.dependsOn mergeDebugAssets 81 | processDebugResources.dependsOn bundleDebugJsAndAssets 82 | 83 | // hook bundleReleaseJsAndAssets into the android build process 84 | bundleReleaseJsAndAssets.dependsOn mergeReleaseResources 85 | bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets 86 | processReleaseResources.dependsOn bundleReleaseJsAndAssets 87 | } 88 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/watchdemo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.watchdemo; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.KeyEvent; 6 | 7 | import com.facebook.react.LifecycleState; 8 | import com.facebook.react.ReactInstanceManager; 9 | import com.facebook.react.ReactRootView; 10 | import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; 11 | import com.facebook.react.shell.MainReactPackage; 12 | import com.facebook.soloader.SoLoader; 13 | 14 | public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { 15 | 16 | private ReactInstanceManager mReactInstanceManager; 17 | private ReactRootView mReactRootView; 18 | 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | mReactRootView = new ReactRootView(this); 23 | 24 | mReactInstanceManager = ReactInstanceManager.builder() 25 | .setApplication(getApplication()) 26 | .setBundleAssetName("index.android.bundle") 27 | .setJSMainModuleName("index.android") 28 | .addPackage(new MainReactPackage()) 29 | .setUseDeveloperSupport(BuildConfig.DEBUG) 30 | .setInitialLifecycleState(LifecycleState.RESUMED) 31 | .build(); 32 | 33 | mReactRootView.startReactApplication(mReactInstanceManager, "WatchDemo", null); 34 | 35 | setContentView(mReactRootView); 36 | } 37 | 38 | @Override 39 | public boolean onKeyUp(int keyCode, KeyEvent event) { 40 | if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) { 41 | mReactInstanceManager.showDevOptionsDialog(); 42 | return true; 43 | } 44 | return super.onKeyUp(keyCode, event); 45 | } 46 | 47 | @Override 48 | public void onBackPressed() { 49 | if (mReactInstanceManager != null) { 50 | mReactInstanceManager.onBackPressed(); 51 | } else { 52 | super.onBackPressed(); 53 | } 54 | } 55 | 56 | @Override 57 | public void invokeDefaultOnBackPressed() { 58 | super.onBackPressed(); 59 | } 60 | 61 | @Override 62 | protected void onPause() { 63 | super.onPause(); 64 | 65 | if (mReactInstanceManager != null) { 66 | mReactInstanceManager.onPause(); 67 | } 68 | } 69 | 70 | @Override 71 | protected void onResume() { 72 | super.onResume(); 73 | 74 | if (mReactInstanceManager != null) { 75 | mReactInstanceManager.onResume(this, this); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/conorbuck/react-native-watch/406a82110843267c63f281a57184a5ea576c3186/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/conorbuck/react-native-watch/406a82110843267c63f281a57184a5ea576c3186/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/conorbuck/react-native-watch/406a82110843267c63f281a57184a5ea576c3186/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/conorbuck/react-native-watch/406a82110843267c63f281a57184a5ea576c3186/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | WatchDemo 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/conorbuck/react-native-watch/406a82110843267c63f281a57184a5ea576c3186/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'WatchDemo' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | 7 | var React = require('react-native'); 8 | var { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View, 13 | } = React; 14 | 15 | var WatchDemo = React.createClass({ 16 | render: function() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.android.js 24 | 25 | 26 | Shake or press menu button for dev menu 27 | 28 | 29 | ); 30 | } 31 | }); 32 | 33 | var styles = StyleSheet.create({ 34 | container: { 35 | flex: 1, 36 | justifyContent: 'center', 37 | alignItems: 'center', 38 | backgroundColor: '#F5FCFF', 39 | }, 40 | welcome: { 41 | fontSize: 20, 42 | textAlign: 'center', 43 | margin: 10, 44 | }, 45 | instructions: { 46 | textAlign: 'center', 47 | color: '#333333', 48 | marginBottom: 5, 49 | }, 50 | }); 51 | 52 | AppRegistry.registerComponent('WatchDemo', () => WatchDemo); 53 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | 7 | var React = require('react-native'); 8 | var { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View, 13 | } = React; 14 | 15 | let WatchManager = require('./WatchManager.js'); 16 | 17 | class WatchDemo extends React.Component { 18 | 19 | constructor(props) { 20 | super(props) 21 | 22 | this.state = { 23 | value: 0 24 | } 25 | } 26 | 27 | componentDidMount() { 28 | // Setup the Watch Manager 29 | WatchManager.activate(); 30 | WatchManager.addMessageListener(msg => { 31 | let value = this.state.value + 1; 32 | 33 | // update watch 34 | WatchManager.sendMessage({ 35 | value 36 | }); 37 | 38 | // update our view 39 | this.setState({ 40 | value 41 | }) 42 | }); 43 | } 44 | 45 | render() { 46 | return ( 47 | 48 | Value:{this.state.value} 49 | 50 | ); 51 | } 52 | }; 53 | 54 | var styles = StyleSheet.create({ 55 | container: { 56 | flex: 1, 57 | justifyContent: 'center', 58 | alignItems: 'center', 59 | backgroundColor: '#F5FCFF', 60 | }, 61 | welcome: { 62 | fontSize: 20, 63 | textAlign: 'center', 64 | margin: 10, 65 | }, 66 | instructions: { 67 | textAlign: 'center', 68 | color: '#333333', 69 | marginBottom: 5, 70 | }, 71 | }); 72 | 73 | AppRegistry.registerComponent('WatchDemo', () => WatchDemo); 74 | -------------------------------------------------------------------------------- /ios/Counter Extension/Assets.xcassets/README__ignoredByTemplate__: -------------------------------------------------------------------------------- 1 | Did you know that git does not support storing empty directories? 2 | -------------------------------------------------------------------------------- /ios/Counter Extension/ExtensionDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionDelegate.swift 3 | // Counter Extension 4 | // 5 | // Created by cbuckley on 12/29/15. 6 | // Copyright © 2015 Facebook. All rights reserved. 7 | // 8 | 9 | import WatchKit 10 | 11 | class ExtensionDelegate: NSObject, WKExtensionDelegate { 12 | 13 | func applicationDidFinishLaunching() { 14 | // Perform any final initialization of your application. 15 | } 16 | 17 | func applicationDidBecomeActive() { 18 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 19 | } 20 | 21 | func applicationWillResignActive() { 22 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 23 | // Use this method to pause ongoing tasks, disable timers, etc. 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /ios/Counter Extension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Counter Extension 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSExtension 26 | 27 | NSExtensionAttributes 28 | 29 | WKAppBundleIdentifier 30 | org.reactjs.native.example.WatchDemo.watchkitapp 31 | 32 | NSExtensionPointIdentifier 33 | com.apple.watchkit 34 | 35 | RemoteInterfacePrincipalClass 36 | $(PRODUCT_MODULE_NAME).InterfaceController 37 | WKExtensionDelegateClassName 38 | $(PRODUCT_MODULE_NAME).ExtensionDelegate 39 | 40 | 41 | -------------------------------------------------------------------------------- /ios/Counter Extension/InterfaceController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceController.swift 3 | // Counter Extension 4 | // 5 | // Created by cbuckley on 12/29/15. 6 | // Copyright © 2015 Facebook. All rights reserved. 7 | // 8 | 9 | import WatchKit 10 | import Foundation 11 | import WatchConnectivity 12 | 13 | class InterfaceController: WKInterfaceController, WCSessionDelegate { 14 | 15 | private let session : WCSession? = WCSession.isSupported() ? WCSession.defaultSession() : nil 16 | 17 | override init() { 18 | super.init() 19 | 20 | session?.delegate = self 21 | session?.activateSession() 22 | } 23 | 24 | @IBOutlet var counterLabel: WKInterfaceLabel! 25 | @IBAction func counterAdd(sender: AnyObject) { 26 | print("Counter pressed") 27 | 28 | let messageData = [ 29 | "some key": "some value" 30 | ] 31 | 32 | if let session = session where session.reachable { 33 | session.sendMessage(messageData, 34 | replyHandler: { replyData in 35 | }, errorHandler: { error in 36 | print(error) 37 | }) 38 | } 39 | } 40 | 41 | func session(session: WCSession, didReceiveMessage message: [String : AnyObject], replyHandler: ([String : AnyObject]) -> Void) { 42 | let message = message as NSDictionary; 43 | let value = message.valueForKey("value") as! Int; 44 | 45 | print("received value" + String(value)) 46 | 47 | self.counterLabel.setText(String(value)) 48 | } 49 | 50 | override func awakeWithContext(context: AnyObject?) { 51 | super.awakeWithContext(context) 52 | 53 | // Configure interface objects here. 54 | } 55 | 56 | override func willActivate() { 57 | // This method is called when watch view controller is about to be visible to user 58 | super.willActivate() 59 | } 60 | 61 | override func didDeactivate() { 62 | // This method is called when watch view controller is no longer visible 63 | super.didDeactivate() 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /ios/Counter Extension/NotificationController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationController.swift 3 | // Counter Extension 4 | // 5 | // Created by cbuckley on 12/29/15. 6 | // Copyright © 2015 Facebook. All rights reserved. 7 | // 8 | 9 | import WatchKit 10 | import Foundation 11 | 12 | 13 | class NotificationController: WKUserNotificationInterfaceController { 14 | 15 | override init() { 16 | // Initialize variables here. 17 | super.init() 18 | 19 | // Configure interface objects here. 20 | } 21 | 22 | override func willActivate() { 23 | // This method is called when watch view controller is about to be visible to user 24 | super.willActivate() 25 | } 26 | 27 | override func didDeactivate() { 28 | // This method is called when watch view controller is no longer visible 29 | super.didDeactivate() 30 | } 31 | 32 | /* 33 | override func didReceiveLocalNotification(localNotification: UILocalNotification, withCompletion completionHandler: ((WKUserNotificationInterfaceType) -> Void)) { 34 | // This method is called when a local notification needs to be presented. 35 | // Implement it if you use a dynamic notification interface. 36 | // Populate your dynamic notification interface as quickly as possible. 37 | // 38 | // After populating your dynamic notification interface call the completion block. 39 | completionHandler(.Custom) 40 | } 41 | */ 42 | 43 | /* 44 | override func didReceiveRemoteNotification(remoteNotification: [NSObject : AnyObject], withCompletion completionHandler: ((WKUserNotificationInterfaceType) -> Void)) { 45 | // This method is called when a remote notification needs to be presented. 46 | // Implement it if you use a dynamic notification interface. 47 | // Populate your dynamic notification interface as quickly as possible. 48 | // 49 | // After populating your dynamic notification interface call the completion block. 50 | completionHandler(.Custom) 51 | } 52 | */ 53 | } 54 | -------------------------------------------------------------------------------- /ios/Counter Extension/PushNotificationPayload.apns: -------------------------------------------------------------------------------- 1 | { 2 | "aps": { 3 | "alert": { 4 | "body": "Test message", 5 | "title": "Optional title" 6 | }, 7 | "category": "myCategory" 8 | }, 9 | 10 | "WatchKit Simulator Actions": [ 11 | { 12 | "title": "First Button", 13 | "identifier": "firstButtonAction" 14 | } 15 | ], 16 | 17 | "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." 18 | } 19 | -------------------------------------------------------------------------------- /ios/Counter/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "24x24", 5 | "idiom" : "watch", 6 | "scale" : "2x", 7 | "role" : "notificationCenter", 8 | "subtype" : "38mm" 9 | }, 10 | { 11 | "size" : "27.5x27.5", 12 | "idiom" : "watch", 13 | "scale" : "2x", 14 | "role" : "notificationCenter", 15 | "subtype" : "42mm" 16 | }, 17 | { 18 | "size" : "29x29", 19 | "idiom" : "watch", 20 | "role" : "companionSettings", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "size" : "29x29", 25 | "idiom" : "watch", 26 | "role" : "companionSettings", 27 | "scale" : "3x" 28 | }, 29 | { 30 | "size" : "40x40", 31 | "idiom" : "watch", 32 | "scale" : "2x", 33 | "role" : "appLauncher", 34 | "subtype" : "38mm" 35 | }, 36 | { 37 | "size" : "86x86", 38 | "idiom" : "watch", 39 | "scale" : "2x", 40 | "role" : "quickLook", 41 | "subtype" : "38mm" 42 | }, 43 | { 44 | "size" : "98x98", 45 | "idiom" : "watch", 46 | "scale" : "2x", 47 | "role" : "quickLook", 48 | "subtype" : "42mm" 49 | } 50 | ], 51 | "info" : { 52 | "version" : 1, 53 | "author" : "xcode" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ios/Counter/Base.lproj/Interface.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/Counter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | WatchDemo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | UISupportedInterfaceOrientations 26 | 27 | UIInterfaceOrientationPortrait 28 | UIInterfaceOrientationPortraitUpsideDown 29 | 30 | WKCompanionAppBundleIdentifier 31 | org.reactjs.native.example.WatchDemo 32 | WKWatchKitApp 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ios/WatchDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* WatchDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* WatchDemoTests.m */; }; 16 | 048BC6531C32FDC2009B0553 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 048BC6511C32FDC2009B0553 /* Interface.storyboard */; }; 17 | 048BC6551C32FDC2009B0553 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 048BC6541C32FDC2009B0553 /* Assets.xcassets */; }; 18 | 048BC65C1C32FDC2009B0553 /* Counter Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 048BC65B1C32FDC2009B0553 /* Counter Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 19 | 048BC6631C32FDC2009B0553 /* InterfaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048BC6621C32FDC2009B0553 /* InterfaceController.swift */; }; 20 | 048BC6651C32FDC2009B0553 /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048BC6641C32FDC2009B0553 /* ExtensionDelegate.swift */; }; 21 | 048BC6671C32FDC2009B0553 /* NotificationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048BC6661C32FDC2009B0553 /* NotificationController.swift */; }; 22 | 048BC6691C32FDC2009B0553 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 048BC6681C32FDC2009B0553 /* Assets.xcassets */; }; 23 | 048BC66D1C32FDC2009B0553 /* Counter.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 048BC64F1C32FDC2009B0553 /* Counter.app */; }; 24 | 048BC6821C33021B009B0553 /* WatchManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 048BC6811C33021B009B0553 /* WatchManager.m */; }; 25 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 26 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 27 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 28 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 29 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 30 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 31 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 32 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 33 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTActionSheet; 43 | }; 44 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 49 | remoteInfo = RCTGeolocation; 50 | }; 51 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 56 | remoteInfo = RCTImage; 57 | }; 58 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 63 | remoteInfo = RCTNetwork; 64 | }; 65 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 68 | proxyType = 2; 69 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 70 | remoteInfo = RCTVibration; 71 | }; 72 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 75 | proxyType = 1; 76 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 77 | remoteInfo = WatchDemo; 78 | }; 79 | 048BC65D1C32FDC2009B0553 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 82 | proxyType = 1; 83 | remoteGlobalIDString = 048BC65A1C32FDC2009B0553; 84 | remoteInfo = "Counter Extension"; 85 | }; 86 | 048BC66B1C32FDC2009B0553 /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 89 | proxyType = 1; 90 | remoteGlobalIDString = 048BC64E1C32FDC2009B0553; 91 | remoteInfo = Counter; 92 | }; 93 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 98 | remoteInfo = RCTSettings; 99 | }; 100 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 105 | remoteInfo = RCTWebSocket; 106 | }; 107 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 108 | isa = PBXContainerItemProxy; 109 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 110 | proxyType = 2; 111 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 112 | remoteInfo = React; 113 | }; 114 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 115 | isa = PBXContainerItemProxy; 116 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 117 | proxyType = 2; 118 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 119 | remoteInfo = RCTLinking; 120 | }; 121 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 122 | isa = PBXContainerItemProxy; 123 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 124 | proxyType = 2; 125 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 126 | remoteInfo = RCTText; 127 | }; 128 | /* End PBXContainerItemProxy section */ 129 | 130 | /* Begin PBXCopyFilesBuildPhase section */ 131 | 048BC67D1C32FDC2009B0553 /* Embed App Extensions */ = { 132 | isa = PBXCopyFilesBuildPhase; 133 | buildActionMask = 2147483647; 134 | dstPath = ""; 135 | dstSubfolderSpec = 13; 136 | files = ( 137 | 048BC65C1C32FDC2009B0553 /* Counter Extension.appex in Embed App Extensions */, 138 | ); 139 | name = "Embed App Extensions"; 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | 048BC67F1C32FDC2009B0553 /* Embed Watch Content */ = { 143 | isa = PBXCopyFilesBuildPhase; 144 | buildActionMask = 2147483647; 145 | dstPath = "$(CONTENTS_FOLDER_PATH)/Watch"; 146 | dstSubfolderSpec = 16; 147 | files = ( 148 | 048BC66D1C32FDC2009B0553 /* Counter.app in Embed Watch Content */, 149 | ); 150 | name = "Embed Watch Content"; 151 | runOnlyForDeploymentPostprocessing = 0; 152 | }; 153 | /* End PBXCopyFilesBuildPhase section */ 154 | 155 | /* Begin PBXFileReference section */ 156 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 157 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 158 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 159 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 160 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 161 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 162 | 00E356EE1AD99517003FC87E /* WatchDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WatchDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 163 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 164 | 00E356F21AD99517003FC87E /* WatchDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WatchDemoTests.m; sourceTree = ""; }; 165 | 048BC64F1C32FDC2009B0553 /* Counter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Counter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 166 | 048BC6521C32FDC2009B0553 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = ""; }; 167 | 048BC6541C32FDC2009B0553 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 168 | 048BC6561C32FDC2009B0553 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 169 | 048BC65B1C32FDC2009B0553 /* Counter Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Counter Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 170 | 048BC6611C32FDC2009B0553 /* PushNotificationPayload.apns */ = {isa = PBXFileReference; lastKnownFileType = text; path = PushNotificationPayload.apns; sourceTree = ""; }; 171 | 048BC6621C32FDC2009B0553 /* InterfaceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterfaceController.swift; sourceTree = ""; }; 172 | 048BC6641C32FDC2009B0553 /* ExtensionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = ""; }; 173 | 048BC6661C32FDC2009B0553 /* NotificationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationController.swift; sourceTree = ""; }; 174 | 048BC6681C32FDC2009B0553 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 175 | 048BC66A1C32FDC2009B0553 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 176 | 048BC6801C33021B009B0553 /* WatchManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WatchManager.h; path = WatchDemo/WatchManager.h; sourceTree = ""; }; 177 | 048BC6811C33021B009B0553 /* WatchManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WatchManager.m; path = WatchDemo/WatchManager.m; sourceTree = ""; }; 178 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 179 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 180 | 13B07F961A680F5B00A75B9A /* WatchDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WatchDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 181 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = WatchDemo/AppDelegate.h; sourceTree = ""; }; 182 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = WatchDemo/AppDelegate.m; sourceTree = ""; }; 183 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 184 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = WatchDemo/Images.xcassets; sourceTree = ""; }; 185 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = WatchDemo/Info.plist; sourceTree = ""; }; 186 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = WatchDemo/main.m; sourceTree = ""; }; 187 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 188 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 189 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 190 | /* End PBXFileReference section */ 191 | 192 | /* Begin PBXFrameworksBuildPhase section */ 193 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 194 | isa = PBXFrameworksBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | 048BC6581C32FDC2009B0553 /* Frameworks */ = { 201 | isa = PBXFrameworksBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 208 | isa = PBXFrameworksBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 212 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 213 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 214 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 215 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 216 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 217 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 218 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 219 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 220 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXFrameworksBuildPhase section */ 225 | 226 | /* Begin PBXGroup section */ 227 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 228 | isa = PBXGroup; 229 | children = ( 230 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 231 | ); 232 | name = Products; 233 | sourceTree = ""; 234 | }; 235 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 236 | isa = PBXGroup; 237 | children = ( 238 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 239 | ); 240 | name = Products; 241 | sourceTree = ""; 242 | }; 243 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 244 | isa = PBXGroup; 245 | children = ( 246 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 247 | ); 248 | name = Products; 249 | sourceTree = ""; 250 | }; 251 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 252 | isa = PBXGroup; 253 | children = ( 254 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 255 | ); 256 | name = Products; 257 | sourceTree = ""; 258 | }; 259 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 260 | isa = PBXGroup; 261 | children = ( 262 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 263 | ); 264 | name = Products; 265 | sourceTree = ""; 266 | }; 267 | 00E356EF1AD99517003FC87E /* WatchDemoTests */ = { 268 | isa = PBXGroup; 269 | children = ( 270 | 00E356F21AD99517003FC87E /* WatchDemoTests.m */, 271 | 00E356F01AD99517003FC87E /* Supporting Files */, 272 | ); 273 | path = WatchDemoTests; 274 | sourceTree = ""; 275 | }; 276 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 277 | isa = PBXGroup; 278 | children = ( 279 | 00E356F11AD99517003FC87E /* Info.plist */, 280 | ); 281 | name = "Supporting Files"; 282 | sourceTree = ""; 283 | }; 284 | 048BC6501C32FDC2009B0553 /* Counter */ = { 285 | isa = PBXGroup; 286 | children = ( 287 | 048BC6511C32FDC2009B0553 /* Interface.storyboard */, 288 | 048BC6541C32FDC2009B0553 /* Assets.xcassets */, 289 | 048BC6561C32FDC2009B0553 /* Info.plist */, 290 | ); 291 | path = Counter; 292 | sourceTree = ""; 293 | }; 294 | 048BC65F1C32FDC2009B0553 /* Counter Extension */ = { 295 | isa = PBXGroup; 296 | children = ( 297 | 048BC6621C32FDC2009B0553 /* InterfaceController.swift */, 298 | 048BC6641C32FDC2009B0553 /* ExtensionDelegate.swift */, 299 | 048BC6661C32FDC2009B0553 /* NotificationController.swift */, 300 | 048BC6681C32FDC2009B0553 /* Assets.xcassets */, 301 | 048BC66A1C32FDC2009B0553 /* Info.plist */, 302 | 048BC6601C32FDC2009B0553 /* Supporting Files */, 303 | ); 304 | path = "Counter Extension"; 305 | sourceTree = ""; 306 | }; 307 | 048BC6601C32FDC2009B0553 /* Supporting Files */ = { 308 | isa = PBXGroup; 309 | children = ( 310 | 048BC6611C32FDC2009B0553 /* PushNotificationPayload.apns */, 311 | ); 312 | name = "Supporting Files"; 313 | sourceTree = ""; 314 | }; 315 | 139105B71AF99BAD00B5F7CC /* Products */ = { 316 | isa = PBXGroup; 317 | children = ( 318 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 319 | ); 320 | name = Products; 321 | sourceTree = ""; 322 | }; 323 | 139FDEE71B06529A00C62182 /* Products */ = { 324 | isa = PBXGroup; 325 | children = ( 326 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 327 | ); 328 | name = Products; 329 | sourceTree = ""; 330 | }; 331 | 13B07FAE1A68108700A75B9A /* WatchDemo */ = { 332 | isa = PBXGroup; 333 | children = ( 334 | 048BC6801C33021B009B0553 /* WatchManager.h */, 335 | 048BC6811C33021B009B0553 /* WatchManager.m */, 336 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 337 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 338 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 339 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 340 | 13B07FB61A68108700A75B9A /* Info.plist */, 341 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 342 | 13B07FB71A68108700A75B9A /* main.m */, 343 | ); 344 | name = WatchDemo; 345 | sourceTree = ""; 346 | }; 347 | 146834001AC3E56700842450 /* Products */ = { 348 | isa = PBXGroup; 349 | children = ( 350 | 146834041AC3E56700842450 /* libReact.a */, 351 | ); 352 | name = Products; 353 | sourceTree = ""; 354 | }; 355 | 78C398B11ACF4ADC00677621 /* Products */ = { 356 | isa = PBXGroup; 357 | children = ( 358 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 359 | ); 360 | name = Products; 361 | sourceTree = ""; 362 | }; 363 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 364 | isa = PBXGroup; 365 | children = ( 366 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 367 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 368 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 369 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 370 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 371 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 372 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 373 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 374 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 375 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 376 | ); 377 | name = Libraries; 378 | sourceTree = ""; 379 | }; 380 | 832341B11AAA6A8300B99B32 /* Products */ = { 381 | isa = PBXGroup; 382 | children = ( 383 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 384 | ); 385 | name = Products; 386 | sourceTree = ""; 387 | }; 388 | 83CBB9F61A601CBA00E9B192 = { 389 | isa = PBXGroup; 390 | children = ( 391 | 13B07FAE1A68108700A75B9A /* WatchDemo */, 392 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 393 | 00E356EF1AD99517003FC87E /* WatchDemoTests */, 394 | 048BC6501C32FDC2009B0553 /* Counter */, 395 | 048BC65F1C32FDC2009B0553 /* Counter Extension */, 396 | 83CBBA001A601CBA00E9B192 /* Products */, 397 | ); 398 | indentWidth = 2; 399 | sourceTree = ""; 400 | tabWidth = 2; 401 | }; 402 | 83CBBA001A601CBA00E9B192 /* Products */ = { 403 | isa = PBXGroup; 404 | children = ( 405 | 13B07F961A680F5B00A75B9A /* WatchDemo.app */, 406 | 00E356EE1AD99517003FC87E /* WatchDemoTests.xctest */, 407 | 048BC64F1C32FDC2009B0553 /* Counter.app */, 408 | 048BC65B1C32FDC2009B0553 /* Counter Extension.appex */, 409 | ); 410 | name = Products; 411 | sourceTree = ""; 412 | }; 413 | /* End PBXGroup section */ 414 | 415 | /* Begin PBXNativeTarget section */ 416 | 00E356ED1AD99517003FC87E /* WatchDemoTests */ = { 417 | isa = PBXNativeTarget; 418 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "WatchDemoTests" */; 419 | buildPhases = ( 420 | 00E356EA1AD99517003FC87E /* Sources */, 421 | 00E356EB1AD99517003FC87E /* Frameworks */, 422 | 00E356EC1AD99517003FC87E /* Resources */, 423 | ); 424 | buildRules = ( 425 | ); 426 | dependencies = ( 427 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 428 | ); 429 | name = WatchDemoTests; 430 | productName = WatchDemoTests; 431 | productReference = 00E356EE1AD99517003FC87E /* WatchDemoTests.xctest */; 432 | productType = "com.apple.product-type.bundle.unit-test"; 433 | }; 434 | 048BC64E1C32FDC2009B0553 /* Counter */ = { 435 | isa = PBXNativeTarget; 436 | buildConfigurationList = 048BC67E1C32FDC2009B0553 /* Build configuration list for PBXNativeTarget "Counter" */; 437 | buildPhases = ( 438 | 048BC64D1C32FDC2009B0553 /* Resources */, 439 | 048BC67D1C32FDC2009B0553 /* Embed App Extensions */, 440 | ); 441 | buildRules = ( 442 | ); 443 | dependencies = ( 444 | 048BC65E1C32FDC2009B0553 /* PBXTargetDependency */, 445 | ); 446 | name = Counter; 447 | productName = Counter; 448 | productReference = 048BC64F1C32FDC2009B0553 /* Counter.app */; 449 | productType = "com.apple.product-type.application.watchapp2"; 450 | }; 451 | 048BC65A1C32FDC2009B0553 /* Counter Extension */ = { 452 | isa = PBXNativeTarget; 453 | buildConfigurationList = 048BC67C1C32FDC2009B0553 /* Build configuration list for PBXNativeTarget "Counter Extension" */; 454 | buildPhases = ( 455 | 048BC6571C32FDC2009B0553 /* Sources */, 456 | 048BC6581C32FDC2009B0553 /* Frameworks */, 457 | 048BC6591C32FDC2009B0553 /* Resources */, 458 | ); 459 | buildRules = ( 460 | ); 461 | dependencies = ( 462 | ); 463 | name = "Counter Extension"; 464 | productName = "Counter Extension"; 465 | productReference = 048BC65B1C32FDC2009B0553 /* Counter Extension.appex */; 466 | productType = "com.apple.product-type.watchkit2-extension"; 467 | }; 468 | 13B07F861A680F5B00A75B9A /* WatchDemo */ = { 469 | isa = PBXNativeTarget; 470 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "WatchDemo" */; 471 | buildPhases = ( 472 | 13B07F871A680F5B00A75B9A /* Sources */, 473 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 474 | 13B07F8E1A680F5B00A75B9A /* Resources */, 475 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 476 | 048BC67F1C32FDC2009B0553 /* Embed Watch Content */, 477 | ); 478 | buildRules = ( 479 | ); 480 | dependencies = ( 481 | 048BC66C1C32FDC2009B0553 /* PBXTargetDependency */, 482 | ); 483 | name = WatchDemo; 484 | productName = "Hello World"; 485 | productReference = 13B07F961A680F5B00A75B9A /* WatchDemo.app */; 486 | productType = "com.apple.product-type.application"; 487 | }; 488 | /* End PBXNativeTarget section */ 489 | 490 | /* Begin PBXProject section */ 491 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 492 | isa = PBXProject; 493 | attributes = { 494 | LastSwiftUpdateCheck = 0720; 495 | LastUpgradeCheck = 0610; 496 | ORGANIZATIONNAME = Facebook; 497 | TargetAttributes = { 498 | 00E356ED1AD99517003FC87E = { 499 | CreatedOnToolsVersion = 6.2; 500 | TestTargetID = 13B07F861A680F5B00A75B9A; 501 | }; 502 | 048BC64E1C32FDC2009B0553 = { 503 | CreatedOnToolsVersion = 7.2; 504 | }; 505 | 048BC65A1C32FDC2009B0553 = { 506 | CreatedOnToolsVersion = 7.2; 507 | DevelopmentTeam = K9T9T2FTX4; 508 | }; 509 | }; 510 | }; 511 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "WatchDemo" */; 512 | compatibilityVersion = "Xcode 3.2"; 513 | developmentRegion = English; 514 | hasScannedForEncodings = 0; 515 | knownRegions = ( 516 | en, 517 | Base, 518 | ); 519 | mainGroup = 83CBB9F61A601CBA00E9B192; 520 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 521 | projectDirPath = ""; 522 | projectReferences = ( 523 | { 524 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 525 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 526 | }, 527 | { 528 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 529 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 530 | }, 531 | { 532 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 533 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 534 | }, 535 | { 536 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 537 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 538 | }, 539 | { 540 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 541 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 542 | }, 543 | { 544 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 545 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 546 | }, 547 | { 548 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 549 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 550 | }, 551 | { 552 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 553 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 554 | }, 555 | { 556 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 557 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 558 | }, 559 | { 560 | ProductGroup = 146834001AC3E56700842450 /* Products */; 561 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 562 | }, 563 | ); 564 | projectRoot = ""; 565 | targets = ( 566 | 13B07F861A680F5B00A75B9A /* WatchDemo */, 567 | 00E356ED1AD99517003FC87E /* WatchDemoTests */, 568 | 048BC64E1C32FDC2009B0553 /* Counter */, 569 | 048BC65A1C32FDC2009B0553 /* Counter Extension */, 570 | ); 571 | }; 572 | /* End PBXProject section */ 573 | 574 | /* Begin PBXReferenceProxy section */ 575 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 576 | isa = PBXReferenceProxy; 577 | fileType = archive.ar; 578 | path = libRCTActionSheet.a; 579 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 580 | sourceTree = BUILT_PRODUCTS_DIR; 581 | }; 582 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 583 | isa = PBXReferenceProxy; 584 | fileType = archive.ar; 585 | path = libRCTGeolocation.a; 586 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 587 | sourceTree = BUILT_PRODUCTS_DIR; 588 | }; 589 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 590 | isa = PBXReferenceProxy; 591 | fileType = archive.ar; 592 | path = libRCTImage.a; 593 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 594 | sourceTree = BUILT_PRODUCTS_DIR; 595 | }; 596 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 597 | isa = PBXReferenceProxy; 598 | fileType = archive.ar; 599 | path = libRCTNetwork.a; 600 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 601 | sourceTree = BUILT_PRODUCTS_DIR; 602 | }; 603 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 604 | isa = PBXReferenceProxy; 605 | fileType = archive.ar; 606 | path = libRCTVibration.a; 607 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 608 | sourceTree = BUILT_PRODUCTS_DIR; 609 | }; 610 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 611 | isa = PBXReferenceProxy; 612 | fileType = archive.ar; 613 | path = libRCTSettings.a; 614 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 615 | sourceTree = BUILT_PRODUCTS_DIR; 616 | }; 617 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 618 | isa = PBXReferenceProxy; 619 | fileType = archive.ar; 620 | path = libRCTWebSocket.a; 621 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 622 | sourceTree = BUILT_PRODUCTS_DIR; 623 | }; 624 | 146834041AC3E56700842450 /* libReact.a */ = { 625 | isa = PBXReferenceProxy; 626 | fileType = archive.ar; 627 | path = libReact.a; 628 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 629 | sourceTree = BUILT_PRODUCTS_DIR; 630 | }; 631 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 632 | isa = PBXReferenceProxy; 633 | fileType = archive.ar; 634 | path = libRCTLinking.a; 635 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 636 | sourceTree = BUILT_PRODUCTS_DIR; 637 | }; 638 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 639 | isa = PBXReferenceProxy; 640 | fileType = archive.ar; 641 | path = libRCTText.a; 642 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 643 | sourceTree = BUILT_PRODUCTS_DIR; 644 | }; 645 | /* End PBXReferenceProxy section */ 646 | 647 | /* Begin PBXResourcesBuildPhase section */ 648 | 00E356EC1AD99517003FC87E /* Resources */ = { 649 | isa = PBXResourcesBuildPhase; 650 | buildActionMask = 2147483647; 651 | files = ( 652 | ); 653 | runOnlyForDeploymentPostprocessing = 0; 654 | }; 655 | 048BC64D1C32FDC2009B0553 /* Resources */ = { 656 | isa = PBXResourcesBuildPhase; 657 | buildActionMask = 2147483647; 658 | files = ( 659 | 048BC6551C32FDC2009B0553 /* Assets.xcassets in Resources */, 660 | 048BC6531C32FDC2009B0553 /* Interface.storyboard in Resources */, 661 | ); 662 | runOnlyForDeploymentPostprocessing = 0; 663 | }; 664 | 048BC6591C32FDC2009B0553 /* Resources */ = { 665 | isa = PBXResourcesBuildPhase; 666 | buildActionMask = 2147483647; 667 | files = ( 668 | 048BC6691C32FDC2009B0553 /* Assets.xcassets in Resources */, 669 | ); 670 | runOnlyForDeploymentPostprocessing = 0; 671 | }; 672 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 673 | isa = PBXResourcesBuildPhase; 674 | buildActionMask = 2147483647; 675 | files = ( 676 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 677 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 678 | ); 679 | runOnlyForDeploymentPostprocessing = 0; 680 | }; 681 | /* End PBXResourcesBuildPhase section */ 682 | 683 | /* Begin PBXShellScriptBuildPhase section */ 684 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 685 | isa = PBXShellScriptBuildPhase; 686 | buildActionMask = 2147483647; 687 | files = ( 688 | ); 689 | inputPaths = ( 690 | ); 691 | name = "Bundle React Native code and images"; 692 | outputPaths = ( 693 | ); 694 | runOnlyForDeploymentPostprocessing = 0; 695 | shellPath = /bin/sh; 696 | shellScript = "../node_modules/react-native/packager/react-native-xcode.sh"; 697 | }; 698 | /* End PBXShellScriptBuildPhase section */ 699 | 700 | /* Begin PBXSourcesBuildPhase section */ 701 | 00E356EA1AD99517003FC87E /* Sources */ = { 702 | isa = PBXSourcesBuildPhase; 703 | buildActionMask = 2147483647; 704 | files = ( 705 | 00E356F31AD99517003FC87E /* WatchDemoTests.m in Sources */, 706 | ); 707 | runOnlyForDeploymentPostprocessing = 0; 708 | }; 709 | 048BC6571C32FDC2009B0553 /* Sources */ = { 710 | isa = PBXSourcesBuildPhase; 711 | buildActionMask = 2147483647; 712 | files = ( 713 | 048BC6671C32FDC2009B0553 /* NotificationController.swift in Sources */, 714 | 048BC6651C32FDC2009B0553 /* ExtensionDelegate.swift in Sources */, 715 | 048BC6631C32FDC2009B0553 /* InterfaceController.swift in Sources */, 716 | ); 717 | runOnlyForDeploymentPostprocessing = 0; 718 | }; 719 | 13B07F871A680F5B00A75B9A /* Sources */ = { 720 | isa = PBXSourcesBuildPhase; 721 | buildActionMask = 2147483647; 722 | files = ( 723 | 048BC6821C33021B009B0553 /* WatchManager.m in Sources */, 724 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 725 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 726 | ); 727 | runOnlyForDeploymentPostprocessing = 0; 728 | }; 729 | /* End PBXSourcesBuildPhase section */ 730 | 731 | /* Begin PBXTargetDependency section */ 732 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 733 | isa = PBXTargetDependency; 734 | target = 13B07F861A680F5B00A75B9A /* WatchDemo */; 735 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 736 | }; 737 | 048BC65E1C32FDC2009B0553 /* PBXTargetDependency */ = { 738 | isa = PBXTargetDependency; 739 | target = 048BC65A1C32FDC2009B0553 /* Counter Extension */; 740 | targetProxy = 048BC65D1C32FDC2009B0553 /* PBXContainerItemProxy */; 741 | }; 742 | 048BC66C1C32FDC2009B0553 /* PBXTargetDependency */ = { 743 | isa = PBXTargetDependency; 744 | target = 048BC64E1C32FDC2009B0553 /* Counter */; 745 | targetProxy = 048BC66B1C32FDC2009B0553 /* PBXContainerItemProxy */; 746 | }; 747 | /* End PBXTargetDependency section */ 748 | 749 | /* Begin PBXVariantGroup section */ 750 | 048BC6511C32FDC2009B0553 /* Interface.storyboard */ = { 751 | isa = PBXVariantGroup; 752 | children = ( 753 | 048BC6521C32FDC2009B0553 /* Base */, 754 | ); 755 | name = Interface.storyboard; 756 | sourceTree = ""; 757 | }; 758 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 759 | isa = PBXVariantGroup; 760 | children = ( 761 | 13B07FB21A68108700A75B9A /* Base */, 762 | ); 763 | name = LaunchScreen.xib; 764 | path = WatchDemo; 765 | sourceTree = ""; 766 | }; 767 | /* End PBXVariantGroup section */ 768 | 769 | /* Begin XCBuildConfiguration section */ 770 | 00E356F61AD99517003FC87E /* Debug */ = { 771 | isa = XCBuildConfiguration; 772 | buildSettings = { 773 | BUNDLE_LOADER = "$(TEST_HOST)"; 774 | FRAMEWORK_SEARCH_PATHS = ( 775 | "$(SDKROOT)/Developer/Library/Frameworks", 776 | "$(inherited)", 777 | ); 778 | GCC_PREPROCESSOR_DEFINITIONS = ( 779 | "DEBUG=1", 780 | "$(inherited)", 781 | ); 782 | INFOPLIST_FILE = WatchDemoTests/Info.plist; 783 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 784 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 785 | PRODUCT_NAME = "$(TARGET_NAME)"; 786 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WatchDemo.app/WatchDemo"; 787 | }; 788 | name = Debug; 789 | }; 790 | 00E356F71AD99517003FC87E /* Release */ = { 791 | isa = XCBuildConfiguration; 792 | buildSettings = { 793 | BUNDLE_LOADER = "$(TEST_HOST)"; 794 | COPY_PHASE_STRIP = NO; 795 | FRAMEWORK_SEARCH_PATHS = ( 796 | "$(SDKROOT)/Developer/Library/Frameworks", 797 | "$(inherited)", 798 | ); 799 | INFOPLIST_FILE = WatchDemoTests/Info.plist; 800 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 801 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 802 | PRODUCT_NAME = "$(TARGET_NAME)"; 803 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WatchDemo.app/WatchDemo"; 804 | }; 805 | name = Release; 806 | }; 807 | 048BC66E1C32FDC2009B0553 /* Debug */ = { 808 | isa = XCBuildConfiguration; 809 | buildSettings = { 810 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 811 | DEBUG_INFORMATION_FORMAT = dwarf; 812 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 813 | ENABLE_TESTABILITY = YES; 814 | GCC_NO_COMMON_BLOCKS = YES; 815 | IBSC_MODULE = Counter_Extension; 816 | INFOPLIST_FILE = Counter/Info.plist; 817 | PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.WatchDemo.watchkitapp; 818 | PRODUCT_NAME = "$(TARGET_NAME)"; 819 | SDKROOT = watchos; 820 | SKIP_INSTALL = YES; 821 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 822 | TARGETED_DEVICE_FAMILY = 4; 823 | WATCHOS_DEPLOYMENT_TARGET = 2.1; 824 | }; 825 | name = Debug; 826 | }; 827 | 048BC66F1C32FDC2009B0553 /* Release */ = { 828 | isa = XCBuildConfiguration; 829 | buildSettings = { 830 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 831 | COPY_PHASE_STRIP = NO; 832 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 833 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; 834 | GCC_NO_COMMON_BLOCKS = YES; 835 | IBSC_MODULE = Counter_Extension; 836 | INFOPLIST_FILE = Counter/Info.plist; 837 | PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.WatchDemo.watchkitapp; 838 | PRODUCT_NAME = "$(TARGET_NAME)"; 839 | SDKROOT = watchos; 840 | SKIP_INSTALL = YES; 841 | TARGETED_DEVICE_FAMILY = 4; 842 | WATCHOS_DEPLOYMENT_TARGET = 2.1; 843 | }; 844 | name = Release; 845 | }; 846 | 048BC6701C32FDC2009B0553 /* Debug */ = { 847 | isa = XCBuildConfiguration; 848 | buildSettings = { 849 | DEBUG_INFORMATION_FORMAT = dwarf; 850 | ENABLE_TESTABILITY = YES; 851 | GCC_NO_COMMON_BLOCKS = YES; 852 | INFOPLIST_FILE = "Counter Extension/Info.plist"; 853 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; 854 | PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.WatchDemo.watchkitapp.watchkitextension; 855 | PRODUCT_NAME = "${TARGET_NAME}"; 856 | SDKROOT = watchos; 857 | SKIP_INSTALL = YES; 858 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 859 | TARGETED_DEVICE_FAMILY = 4; 860 | WATCHOS_DEPLOYMENT_TARGET = 2.1; 861 | }; 862 | name = Debug; 863 | }; 864 | 048BC6711C32FDC2009B0553 /* Release */ = { 865 | isa = XCBuildConfiguration; 866 | buildSettings = { 867 | COPY_PHASE_STRIP = NO; 868 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 869 | GCC_NO_COMMON_BLOCKS = YES; 870 | INFOPLIST_FILE = "Counter Extension/Info.plist"; 871 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; 872 | PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.WatchDemo.watchkitapp.watchkitextension; 873 | PRODUCT_NAME = "${TARGET_NAME}"; 874 | SDKROOT = watchos; 875 | SKIP_INSTALL = YES; 876 | TARGETED_DEVICE_FAMILY = 4; 877 | WATCHOS_DEPLOYMENT_TARGET = 2.1; 878 | }; 879 | name = Release; 880 | }; 881 | 13B07F941A680F5B00A75B9A /* Debug */ = { 882 | isa = XCBuildConfiguration; 883 | buildSettings = { 884 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 885 | DEAD_CODE_STRIPPING = NO; 886 | HEADER_SEARCH_PATHS = ( 887 | "$(inherited)", 888 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 889 | "$(SRCROOT)/../node_modules/react-native/React/**", 890 | ); 891 | INFOPLIST_FILE = WatchDemo/Info.plist; 892 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 893 | OTHER_LDFLAGS = "-ObjC"; 894 | PRODUCT_NAME = WatchDemo; 895 | }; 896 | name = Debug; 897 | }; 898 | 13B07F951A680F5B00A75B9A /* Release */ = { 899 | isa = XCBuildConfiguration; 900 | buildSettings = { 901 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 902 | HEADER_SEARCH_PATHS = ( 903 | "$(inherited)", 904 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 905 | "$(SRCROOT)/../node_modules/react-native/React/**", 906 | ); 907 | INFOPLIST_FILE = WatchDemo/Info.plist; 908 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 909 | OTHER_LDFLAGS = "-ObjC"; 910 | PRODUCT_NAME = WatchDemo; 911 | }; 912 | name = Release; 913 | }; 914 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 915 | isa = XCBuildConfiguration; 916 | buildSettings = { 917 | ALWAYS_SEARCH_USER_PATHS = NO; 918 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 919 | CLANG_CXX_LIBRARY = "libc++"; 920 | CLANG_ENABLE_MODULES = YES; 921 | CLANG_ENABLE_OBJC_ARC = YES; 922 | CLANG_WARN_BOOL_CONVERSION = YES; 923 | CLANG_WARN_CONSTANT_CONVERSION = YES; 924 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 925 | CLANG_WARN_EMPTY_BODY = YES; 926 | CLANG_WARN_ENUM_CONVERSION = YES; 927 | CLANG_WARN_INT_CONVERSION = YES; 928 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 929 | CLANG_WARN_UNREACHABLE_CODE = YES; 930 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 931 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 932 | COPY_PHASE_STRIP = NO; 933 | ENABLE_STRICT_OBJC_MSGSEND = YES; 934 | GCC_C_LANGUAGE_STANDARD = gnu99; 935 | GCC_DYNAMIC_NO_PIC = NO; 936 | GCC_OPTIMIZATION_LEVEL = 0; 937 | GCC_PREPROCESSOR_DEFINITIONS = ( 938 | "DEBUG=1", 939 | "$(inherited)", 940 | ); 941 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 942 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 943 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 944 | GCC_WARN_UNDECLARED_SELECTOR = YES; 945 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 946 | GCC_WARN_UNUSED_FUNCTION = YES; 947 | GCC_WARN_UNUSED_VARIABLE = YES; 948 | HEADER_SEARCH_PATHS = ( 949 | "$(inherited)", 950 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 951 | "$(SRCROOT)/../node_modules/react-native/React/**", 952 | ); 953 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 954 | MTL_ENABLE_DEBUG_INFO = YES; 955 | ONLY_ACTIVE_ARCH = YES; 956 | SDKROOT = iphoneos; 957 | }; 958 | name = Debug; 959 | }; 960 | 83CBBA211A601CBA00E9B192 /* Release */ = { 961 | isa = XCBuildConfiguration; 962 | buildSettings = { 963 | ALWAYS_SEARCH_USER_PATHS = NO; 964 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 965 | CLANG_CXX_LIBRARY = "libc++"; 966 | CLANG_ENABLE_MODULES = YES; 967 | CLANG_ENABLE_OBJC_ARC = YES; 968 | CLANG_WARN_BOOL_CONVERSION = YES; 969 | CLANG_WARN_CONSTANT_CONVERSION = YES; 970 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 971 | CLANG_WARN_EMPTY_BODY = YES; 972 | CLANG_WARN_ENUM_CONVERSION = YES; 973 | CLANG_WARN_INT_CONVERSION = YES; 974 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 975 | CLANG_WARN_UNREACHABLE_CODE = YES; 976 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 977 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 978 | COPY_PHASE_STRIP = YES; 979 | ENABLE_NS_ASSERTIONS = NO; 980 | ENABLE_STRICT_OBJC_MSGSEND = YES; 981 | GCC_C_LANGUAGE_STANDARD = gnu99; 982 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 983 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 984 | GCC_WARN_UNDECLARED_SELECTOR = YES; 985 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 986 | GCC_WARN_UNUSED_FUNCTION = YES; 987 | GCC_WARN_UNUSED_VARIABLE = YES; 988 | HEADER_SEARCH_PATHS = ( 989 | "$(inherited)", 990 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 991 | "$(SRCROOT)/../node_modules/react-native/React/**", 992 | ); 993 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 994 | MTL_ENABLE_DEBUG_INFO = NO; 995 | SDKROOT = iphoneos; 996 | VALIDATE_PRODUCT = YES; 997 | }; 998 | name = Release; 999 | }; 1000 | /* End XCBuildConfiguration section */ 1001 | 1002 | /* Begin XCConfigurationList section */ 1003 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "WatchDemoTests" */ = { 1004 | isa = XCConfigurationList; 1005 | buildConfigurations = ( 1006 | 00E356F61AD99517003FC87E /* Debug */, 1007 | 00E356F71AD99517003FC87E /* Release */, 1008 | ); 1009 | defaultConfigurationIsVisible = 0; 1010 | defaultConfigurationName = Release; 1011 | }; 1012 | 048BC67C1C32FDC2009B0553 /* Build configuration list for PBXNativeTarget "Counter Extension" */ = { 1013 | isa = XCConfigurationList; 1014 | buildConfigurations = ( 1015 | 048BC6701C32FDC2009B0553 /* Debug */, 1016 | 048BC6711C32FDC2009B0553 /* Release */, 1017 | ); 1018 | defaultConfigurationIsVisible = 0; 1019 | }; 1020 | 048BC67E1C32FDC2009B0553 /* Build configuration list for PBXNativeTarget "Counter" */ = { 1021 | isa = XCConfigurationList; 1022 | buildConfigurations = ( 1023 | 048BC66E1C32FDC2009B0553 /* Debug */, 1024 | 048BC66F1C32FDC2009B0553 /* Release */, 1025 | ); 1026 | defaultConfigurationIsVisible = 0; 1027 | }; 1028 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "WatchDemo" */ = { 1029 | isa = XCConfigurationList; 1030 | buildConfigurations = ( 1031 | 13B07F941A680F5B00A75B9A /* Debug */, 1032 | 13B07F951A680F5B00A75B9A /* Release */, 1033 | ); 1034 | defaultConfigurationIsVisible = 0; 1035 | defaultConfigurationName = Release; 1036 | }; 1037 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "WatchDemo" */ = { 1038 | isa = XCConfigurationList; 1039 | buildConfigurations = ( 1040 | 83CBBA201A601CBA00E9B192 /* Debug */, 1041 | 83CBBA211A601CBA00E9B192 /* Release */, 1042 | ); 1043 | defaultConfigurationIsVisible = 0; 1044 | defaultConfigurationName = Release; 1045 | }; 1046 | /* End XCConfigurationList section */ 1047 | }; 1048 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 1049 | } 1050 | -------------------------------------------------------------------------------- /ios/WatchDemo.xcodeproj/xcshareddata/xcschemes/WatchDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /ios/WatchDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ios/WatchDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTRootView.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | NSURL *jsCodeLocation; 19 | 20 | /** 21 | * Loading JavaScript code - uncomment the one you want. 22 | * 23 | * OPTION 1 24 | * Load from development server. Start the server from the repository root: 25 | * 26 | * $ npm start 27 | * 28 | * To run on device, change `localhost` to the IP address of your computer 29 | * (you can get this by typing `ifconfig` into the terminal and selecting the 30 | * `inet` value under `en0:`) and make sure your computer and iOS device are 31 | * on the same Wi-Fi network. 32 | */ 33 | 34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; 35 | 36 | /** 37 | * OPTION 2 38 | * Load from pre-bundled file on disk. The static bundle is automatically 39 | * generated by "Bundle React Native code and images" build step. 40 | */ 41 | 42 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 43 | 44 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 45 | moduleName:@"WatchDemo" 46 | initialProperties:nil 47 | launchOptions:launchOptions]; 48 | 49 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 50 | UIViewController *rootViewController = [UIViewController new]; 51 | rootViewController.view = rootView; 52 | self.window.rootViewController = rootViewController; 53 | [self.window makeKeyAndVisible]; 54 | return YES; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /ios/WatchDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ios/WatchDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ios/WatchDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSAllowsArbitraryLoads 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /ios/WatchDemo/WatchManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // WatchManager.h 3 | // Metal 4 | // 5 | // Created by cbuckley on 12/29/15. 6 | // Copyright © 2015 Facebook. All rights reserved. 7 | // 8 | 9 | #import "RCTBridgeModule.h" 10 | #import 11 | 12 | @interface WatchManager : NSObject 13 | @end 14 | -------------------------------------------------------------------------------- /ios/WatchDemo/WatchManager.m: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // WatchManager.m 4 | // Metal 5 | // 6 | // Created by cbuckley on 12/29/15. 7 | // Copyright © 2015 Facebook. All rights reserved. 8 | // 9 | #import "WatchManager.h" 10 | #import "RCTAppState.h" 11 | #import "RCTAssert.h" 12 | #import "RCTBridge.h" 13 | #import "RCTLog.h" 14 | #import "RCTEventDispatcher.h" 15 | 16 | @implementation WatchManager 17 | 18 | RCT_EXPORT_MODULE(); 19 | 20 | @synthesize bridge = _bridge; 21 | 22 | - (instancetype)init { 23 | self = [super init]; 24 | if ( self ) { 25 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 26 | [notificationCenter addObserver:self selector:@selector(onWatchMessage:) name:@"onWatchMessage" object:nil]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)dealloc { 33 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 34 | } 35 | 36 | - (void)dispatchAppEventWithName:(NSString *)name body:(NSDictionary *)body { 37 | [self.bridge.eventDispatcher sendAppEventWithName:name body:body]; 38 | } 39 | 40 | - (void)onWatchMessage:(NSDictionary * )data { 41 | [self dispatchAppEventWithName:@"onWatchMessage" body:data]; 42 | } 43 | 44 | RCT_EXPORT_METHOD(activate) 45 | { 46 | if ([WCSession isSupported]) { 47 | WCSession *session = [WCSession defaultSession]; 48 | session.delegate = self; 49 | [session activateSession]; 50 | } 51 | } 52 | 53 | - (void)session:(nonnull WCSession *)session didReceiveMessage:(nonnull NSDictionary *)message replyHandler:(nonnull void (^)(NSDictionary * __nonnull)) replyHandler { 54 | RCTLog(@"Watch: Receieved msg %@", message); 55 | [self onWatchMessage:message]; 56 | } 57 | 58 | 59 | RCT_EXPORT_METHOD(sendMessage:(NSDictionary *)message) 60 | { 61 | RCTLog(@"Watch: Sending msg %@", message); 62 | [[WCSession defaultSession] sendMessage:message 63 | replyHandler:^(NSDictionary *reply) { 64 | // 65 | } 66 | errorHandler:^(NSError *error) { 67 | // 68 | } 69 | ]; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /ios/WatchDemo/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ios/WatchDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/WatchDemoTests/WatchDemoTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 240 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface WatchDemoTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation WatchDemoTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WatchDemo", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-native start" 7 | }, 8 | "dependencies": { 9 | "react-native": "^0.17.0" 10 | } 11 | } 12 | --------------------------------------------------------------------------------