{"bugs":{"url":"https://github.com/expo/expo/issues"},"dist":{"shasum":"5907b2473c6028217efce3d21c94e2fd857b2f87","tarball":"https://registry.npmjs.org/expo-react-native-adapter/-/expo-react-native-adapter-2.1.0-alpha.1.tgz","fileCount":64,"integrity":"sha512-PTBVAmkb9Z8AT+vKhHfI7Lqdf82aRTOvwLYTJ+Qvdjprez5imVWl7zXWYiZtxbQrQsXmjNWJuOT3BLZvbfDjxg==","signatures":[{"sig":"MEYCIQCTEKowEZwIKDSigelqEic++u764h2zWm345ndRMrkebAIhAL3JdEKf/5fbhUU/VJhdaIqZs+4znaOCwoOJw1tRGE2P","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbIuaCRA9TVsSAnZWagAAVtIP/3mJlu/O3djkcKQOcMqt\nevvTEcNLegp6Cge7QKL4zd73Vdt/wtLMbvUhgtIGOiM1YeRnVwM4J9j1VKJG\nnzQeVBRcOREEriBFrM+R5Kn/6Eg/jBvqaIb29uXGlvBNdWMBTy07DvHAhTpc\nvZ6mO7eWD+HEvTKWWmyqqLsjmWt1JnvoMR93gG0+rJ/y6OvZY9JdBBXyBJ+Z\nkx7oXdBsufGDZEEGBJecZOxr+r3cJ5U/H2g7EIecsP6J3tN5Jm/rU6WvfD2k\nRGygk7QVXsDzvfhfypvgJFAjon+axEzpZE2H3pt2zpoYTEUVuCeSKLyyX3GZ\n7/xTGtble8Ol8ph0dmGSJJCC2b7EK4PmzK19wu+qh4Cgyo4q0JE5c9S4rJs9\n8bed+/13O9Dg9OX5oNEKequirKJ7Ec+6sHWApuUdqI8iPaZrVeopKariN0qC\nxDAJEoOuuLLTG34teX1Vb7uQfpQCuh0dKqwV/sflEA7IJx29zGENx8avQexS\n7B1ztbSrNaPjqWiuxkAaD99W7RxeB0BaK7eFLnw3yFtXDTnGaCSNdlc1Cc5p\nmtdHqO5MPBWIqYYLFp4ijeFkFWPPnLOPK4gpfInXo6mOTUmBQBbz17OEqQKb\notdANaAgIQiZYSZsqRpZAIkcEPNZc8CNhpm9rDFgAm2fAPGomtY3AX6UofpY\nxJzc\r\n=Zfqq\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"preset":"expo-module-scripts"},"main":"build/index.js","name":"expo-react-native-adapter","types":"build/index.d.ts","author":{"name":"650 Industries, Inc."},"readme":"# expo-react-native-adapter\n\nA React Native adapter for Expo Universal Modules. It requires [`expo-core`](https://github.com/expo/expo-core) to be installed and linked.\n\n**Note:** The following installation/setup instructions are only applicable to plain React Native applications, i. e. if your project is a detached Expo project and it has ExpoKit/expoview included, the installation has already been done for you.\n\n## JavaScript installation\n\n```sh\n$ yarn add expo-react-native-adapter\n\n# or\n\n$ npm install expo-react-native-adapter --save\n```\n\n## Installation\n\n### iOS (Cocoapods)\n\nIf you're using Cocoapods, add the dependency to your `Podfile`:\n\n`pod 'EXReactNativeAdapter', path: '../node_modules/expo-react-native-adapter/ios', inhibit_warnings: true`\n\nand run `pod install`.\n\n### Android\n\n1.  Append the following lines to `android/settings.gradle`:\n    ```gradle\n    include ':expo-react-native-adapter'\n    project(':expo-react-native-adapter').projectDir = new File(rootProject.projectDir, '../node_modules/expo-react-native-adapter/android')\n    ```\n2.  Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n    ```gradle\n    compile project(':expo-react-native-adapter')\n    ```\n\n## Additional required setup\n\n#### iOS\n\n1. Open the `AppDelegate.m` of your application.\n2. Import `<EXCore/EXModuleRegistry.h>`, `<EXReactNativeAdapter/EXNativeModulesProxy.h>` and `<EXReactNativeAdapter/EXModuleRegistryAdapter.h>`.\n3. Make `AppDelegate` implement `RCTBridgeDelegate` protocol (`@interface AppDelegate () <RCTBridgeDelegate>`).\n4. Add a new instance variable to your `AppDelegate`:\n\n   ```objc\n   @interface AppDelegate () <RCTBridgeDelegate>\n\n   // add this line\n   @property (nonatomic, strong) EXModuleRegistryAdapter *moduleRegistryAdapter;\n\n   @end\n   ```\n\n5. In `-application:didFinishLaunchingWithOptions:` add the following at the top of the implementation:\n   ```objc\n   self.moduleRegistryAdapter = [[EXModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[EXModuleRegistryProvider alloc] init]];\n   ```\n6. Add two methods to the `AppDelegate`'s implementation:\n\n   ```objc\n   - (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge\n   {\n       NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge andExperience:nil];\n       // If you'd like to export some custom RCTBridgeModules that are not Expo modules, add them here!\n       return extraModules;\n   }\n\n   - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {\n       return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\" fallbackResource:nil];\n   }\n   ```\n\n7. When initializing `RCTBridge`, make the `AppDelegate` a delegate of the bridge:\n   ```objc\n   RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];\n   ```\n8. That's it! All in all, your `AppDelegate.m` should look similar to:\n\n   <details>\n       <summary>Click to expand</summary>\n       <p>\n\n   ```objc\n   #import \"AppDelegate.h\"\n\n   #import <React/RCTBundleURLProvider.h>\n   #import <React/RCTRootView.h>\n\n   #import <EXCore/EXModuleRegistry.h>\n   #import <EXReactNativeAdapter/EXNativeModulesProxy.h>\n   #import <EXReactNativeAdapter/EXModuleRegistryAdapter.h>\n\n   @interface AppDelegate () <RCTBridgeDelegate>\n\n   @property (nonatomic, strong) EXModuleRegistryAdapter *moduleRegistryAdapter;\n\n   @end\n\n   @implementation AppDelegate\n\n   - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n   {\n       self.moduleRegistryAdapter = [[EXModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[EXModuleRegistryProvider alloc] init]];\n       RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];\n       RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@\"YOUR_MODULE_NAME\" initialProperties:nil];\n       rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];\n\n       self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];\n       UIViewController *rootViewController = [UIViewController new];\n       rootViewController.view = rootView;\n       self.window.rootViewController = rootViewController;\n       [self.window makeKeyAndVisible];\n       return YES;\n   }\n\n   - (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge\n   {\n       NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge andExperience:nil];\n       // If you'd like to export some custom RCTBridgeModules that are not Expo modules, add them here!\n       return extraModules;\n   }\n\n   - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {\n       return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index\" fallbackResource:nil];\n   }\n\n   @end\n   ```\n\n   </details>\n\n#### Android\n\n1. Open the `MainApplication.java` of your application.\n2. Add to the imports:\n   ```java\n   import expo.adapters.react.ModuleRegistryAdapter;\n   import expo.adapters.react.ReactAdapterPackage;\n   import expo.adapters.react.ReactModuleRegistryProvider;\n   import expo.core.interfaces.Package;\n   ```\n3. Create an instance variable on the `Application`:\n   ```java\n   private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(Arrays.<Package>asList(\n       new ReactAdapterPackage()\n       // more packages, like\n       // new CameraPackage(), if you use expo-camera\n       // etc.\n   ));\n   ```\n4. Add `new ModuleRegistryAdapter(mModuleRegistryProvider)` to the list returned by `protected List<ReactPackage> getPackages()`.\n5. You're good to go!\n\n## Usage\n\n### Calling methods on native modules\n\nNative modules are available behind the proxy (`NativeModulesProxy` of `expo-core`).\n\nTo call an exported method, use `NativeModulesProxy[clientCodeName].exportedMethod(...arguments)`, like this:\n\n```js\n// For EX_REGISTER_MODULE(FileSystem,) or EX_REGISTER_EXPORTED_MODULE(FileSystem)\n// and EX_EXPORT_METHOD_AS(getInfo, getInfo:(NSString *)path)\n\n// or for method\n// @ExpoMethod\n// public void getInfo(String path, Promise promise)\n// defined in native module with name FileSystem\n\nimport { NativeModulesProxy } from 'expo-core';\n\nconst { FileSystem } = NativeModulesProxy;\n\nFileSystem.getInfo('file:///...');\n```\n\nNote that all the methods return `Promise`s.\n\n### Synthetic Platform Events\n\nWhen creating web universal modules, you may find that you need to send events back to the API layer.\nIn this case you will want to use the shared `SyntheticPlatformEmitter` instance from `expo-core`. The shared emitter emit events to `react-native`'s `NativeEventEmitter` and `expo-core`'s `EventEmitter` .\n\n`ExponentGyroscope.web.ts`\n\n```js\n// Example from expo-sensors native web gyroscope sensor\n\nimport { SyntheticPlatformEmitter } from 'expo-core';\n\nSyntheticPlatformEmitter.emit('gyroscopeDidUpdate', { x, y, z });\n```\n\nThis emitted event is then received with a `EventEmitter` in the developer-facing API.\n\n```js\nimport { EventEmitter } from 'expo-core';\n\nimport ExponentGyroscope from './ExponentGyroscope';\n\nconst nativeEmitter = new EventEmitter(ExponentGyroscope);\n\n// On Android and iOS, `nativeEmitter` receives events sent from Objective-C and Java. On web, it\n// receives events from the shared `SyntheticPlatformEmitter` instance.\nnativeEmitter.addListener('gyroscopeDidUpdate', ({ x, y, z }) => {});\n```\n","gitHead":"f15abc53c111bd0438cd36dc456c59cfa7c56a58","license":"MIT","scripts":{"test":"expo-module test","build":"expo-module build","clean":"expo-module clean","prepare":"expo-module prepare","expo-module":"expo-module","prepublishOnly":"expo-module prepublishOnly"},"_npmUser":{"name":"brentvatne","email":"brentvatne@gmail.com"},"homepage":"https://github.com/expo/expo/tree/master/packages/expo-react-native-adapter","keywords":["react-native","expo","adapter"],"repository":{"url":"git+https://github.com/expo/expo.git","type":"git"},"_npmVersion":"6.4.1","description":"The adapter to use Expo universal modules with the React Native bridge","directories":{},"maintainers":[{"name":"barthec","email":"bartlomiejbukowski.b@gmail.com"},{"name":"brentvatne","email":"brentvatne@gmail.com"},{"name":"ccheever","email":"ccheever@gmail.com"},{"name":"dsokal","email":"dominiksokal@gmail.com"},{"name":"esamelson","email":"eric@expo.io"},{"name":"evanbacon","email":"baconbrix@gmail.com"},{"name":"expoadmin","email":"support@expo.io"},{"name":"exponent","email":"exponent.team@gmail.com"},{"name":"fson","email":"ville.immonen@iki.fi"},{"name":"ide","email":"ide+npm@jameside.com"},{"name":"janicduplessis","email":"janicduplessis@gmail.com"},{"name":"jesseruder","email":"jesseruder@gmail.com"},{"name":"nikki93","email":"s.nikhilesh@gmail.com"},{"name":"quinlanj","email":"quinlanjung@gmail.com"},{"name":"sjchmiela","email":"sjchmiela@gmail.com"},{"name":"terribleben","email":"ben@exp.host"},{"name":"tsapeta","email":"sapeta.tomasz@gmail.com"},{"name":"wkozyra","email":"wojciech.kozyra@swmansion.com"}],"_nodeVersion":"10.12.0","dependencies":{"invariant":"^2.2.4","prop-types":"^15.6.1","lodash.omit":"^4.5.0","lodash.pick":"^4.4.0","expo-permissions-interface":"~2.0.0","expo-image-loader-interface":"~2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"expo-core":"~2.0.0","babel-preset-expo":"^5.0.0","@types/lodash.omit":"^4.5.4","@types/lodash.pick":"^4.4.4","expo-module-scripts":"^1.0.0"},"peerDependencies":{"react-native":"^0.57.1","expo-font-interface":"~2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/expo-react-native-adapter_2.1.0-alpha.1_1550617497830_0.33009456585137875","host":"s3://npm-registry-packages"},"_id":"expo-react-native-adapter@2.1.0-alpha.1","version":"2.1.0-alpha.1"}