{"dist":{"shasum":"939a59654bc041b22c18fd28048ad5a661f3641f","tarball":"https://registry.npmjs.org/expo-react-native-adapter/-/expo-react-native-adapter-2.0.0-rc.2.tgz","fileCount":57,"integrity":"sha512-LANs2MSE50t6+hYHRmJoY/fuk+vJz+P4RBPMihhZrHALtAJgZnBaD60y/xY+IOMYEMMmLvPBZznv+mB/QZ8hZA==","signatures":[{"sig":"MEUCIDAuBkKtUItCOumAsKou5ymkyuaRh0EyEta7iOXZ6W46AiEAwR8QSOHZIz9wzyYNezEgp+LreZKjZfcMm8jDC5xkacY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG/F/CRA9TVsSAnZWagAAIisP/1nUA0iXFREaVQcOfJvb\nhWKqV48gXSf5Xzq3dP7K+0XYZolhKQHtJY3OSgR933uYYxcr/UVRG2gjUVFK\nJo61SJGtGddYN/8EbFC6ziVXDyPX5lsve6PNH78xbqv3VN88Sz2v5ApcNXND\n9etlpgLLXLxGmCefFTwr/QrQHIeaJB1TmQt69xhokTb65nezCFSYrnQ3xBXh\n9X82fjjsyzHbtqKZADoprKIOM6p8Amhbchthh3W10bMxt7juCACPtEaYpFjD\n3/CX/ZSQJTIhEx+eU8TtoxqLOpn1T6YdKOSugMvkd4vfM2roIr9x1P/sPxpn\n660Nls3oZD61THdrz0qG+Vn+RzBor83MUfUDvZWM+gak1ZYghjt1taSK1jZ/\nT7ceThPLjoGq6wHgA33hr5dUKVAnKnNdUPHcwSmO2i0t6tMHUiPHiAacpGp6\nxYTK7fBX59cF2VZni47eh7C3imYoktf8YO6dU2Mq36IXww9eJJkYRaAK+Jhg\nkEPuzgdhY9YjhnIoGss1kqLGBlNYZHwXFguQCM1mISnoPpVDPGxvwuMfF0N9\nUR07HXCZePLBBALqkUNv1kH0vB1LOSgnIQG+wJeybfbo18rx8ZFNMLe+0sz6\nyJ06qjO3VvdwMz1pp6vq213QMtqSEOD7rrmpSxqmbHHx2KNU0BXNh/1AGSI5\nhEku\r\n=fo6i\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    ```objc\n    @interface AppDelegate () <RCTBridgeDelegate>\n\n    // add this line\n    @property (nonatomic, strong) EXModuleRegistryAdapter *moduleRegistryAdapter;\n\n    @end\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    ```\n4. Add two methods to the `AppDelegate`'s implementation:\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    ```\n5. When initializing `RCTBridge`, make the `AppDelegate` a delegate of the bridge:\n    ```objc\n    RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];\n    ```\n6. That's it! All in all, your `AppDelegate.m` should look similar to:\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","gitHead":"36f587788050b6e9acc3ddfbd5b9112bc2c6b285","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":"tsapeta","email":"sapeta.tomasz@gmail.com"},"homepage":"https://github.com/expo/expo/tree/master/packages/expo-react-native-adapter","keywords":["react-native","expo","adapter"],"repository":{"url":"https://github.com/expo/expo.git","type":"git"},"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":"jakubste","email":"jakub.ste@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"}],"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-rc.1","expo-image-loader-interface":"~2.0.0-rc.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"expo-core":"~2.0.0-rc.2","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-rc.1"},"_npmOperationalInternal":{"tmp":"tmp/expo-react-native-adapter_2.0.0-rc.2_1545335166449_0.19183509467820214","host":"s3://npm-registry-packages"},"_id":"expo-react-native-adapter@2.0.0-rc.2","version":"2.0.0-rc.2"}