# movr_module_rn

> React Native movr module for iOS and Android

Latest version **1.3.2** (published 2024-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install movr_module_rn
pnpm add movr_module_rn
yarn add movr_module_rn
bun add movr_module_rn
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2024-02-17 |
| First published | 2022-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 163.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Your Name |
| Maintainers | brendanmovr |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/movr_module_rn
- Repository: https://github.com/eamers/movr_module_rn
- Issues: https://github.com/eamers/movr_module_rn/issues
- npm.io page: https://npm.io/package/movr_module_rn

## Recent versions

- 1.3.2 (latest) — 2024-02-17
- 1.2.3 (beta) — 2023-11-22
- 1.3.1 — 2024-02-15
- 1.3.0 — 2024-02-08
- 1.2.9 — 2024-02-06
- 1.2.8 — 2024-02-05
- 1.2.7 — 2024-01-25
- 1.2.6 — 2024-01-07
- 1.2.5 — 2023-12-22
- 1.2.4 — 2023-11-22
- 1.2.2 — 2023-11-10
- 1.2.1 — 2023-11-10
- 1.2.0 — 2023-11-10
- 1.1.9 — 2023-11-08
- 1.1.8 — 2023-10-26
- … 14 more at https://npm.io/package/movr_module_rn/versions

## README

# React Native Movr SDK

## Getting started

`$ npm install movr_module_rn --save` or `$ yarn add movr_module_rn`

### Android

Add following repositories to your android/build.gradle file:

```javascript
allprojects {
  repositories {
      ...
      maven {
          url "$rootDir/../node_modules/movr_module_rn/modules/host/outputs/repo"
      }
      maven {
          url "https://storage.googleapis.com/download.flutter.io"
      }
  }
}
```

### iOS

- Add following to your Podfile:

```javascript
require_relative '../node_modules/movr_module_rn/ios/pods'

…
target ‘YourProjectName’ do
 …
 use_movr_module_rn!()
 …
end

post_install do |installer|
  …
  movr_module_rn_post_install(installer)
  …
end

```
- Run cd ios && pod install

## Usage
```javascript
import MovrModuleRn from 'movr_module_rn';
```
Config input parameters
```javascript
const parameters = {
  apiKey: 'xxxxxx',
  userId: 'userId',
  apiBaseUrl: 'xxxxx',
  primaryColor: '#FF6666',
  fontFamily: 'Montserrat',
  startingPage: 'xxxxxx',
};
```
Convert JSON parameter to string and start MovrScreen with the string parameter

```javascript
MovrModuleRn.startFlutterActivity(JSON.stringify(parameters), text => {
  // 1st param - string paramter
  // 2nd param - callback which returns input argument
  console.log(text);
});
```

## Example
```javascript
import React from 'react';
import {
  Button,
  SafeAreaView,
  ScrollView,
  StatusBar,
  useColorScheme,
} from 'react-native';

import MovrModuleRn from 'movr_module_rn';

const Colors = {
  white: '#fff',
  black: '#000',
  light: '#ddd',
  dark: '#333',
  lighter: '#eee',
  darker: '#111',
};

const App: React.FC = () => {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
    flex: 1,
  };
  return (
    <SafeAreaView style={backgroundStyle}>
      <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
      <ScrollView
        contentInsetAdjustmentBehavior="automatic"
        style={backgroundStyle}>
        <Button
          title={'Start Movr Screen'}
          onPress={() => {
          const parameters = {
              apiKey: 'xxxx',
              userId: 'xxxx', // This is generated on the partner side
              apiBaseUrl: 'xxxx',
              fontFamily: 'Montserrat',
              startingPage: 'minis',
              theme: {
                textStyles: {
                    "display_large":  {"font": "Montserrat", "weight":900, "size":50},
                    "body_large":  {"font": "Montserrat", "weight":600, "size":18},
                    "headline_large":  {"font": "Montserrat", "weight":900, "size":50}
                },
                "colors": { // These are just examples, leave blank for defaults
                    "movr_beige":"#A0816C",
                    "movr_navy":"#000080",
                    "movr_black": "#000000",
                    "assessments":"#0000FF",
                    "prescriptions":"#FF0000",
                    "session_builder":"#FFFF00",
                    "icons_color":"#FFFF00",
                    hide_drop_shadow: true
                }
              }
            };
            MovrModuleRn.startFlutterActivity(
              JSON.stringify(parameters),
              text => {
                // 1st param - string argment
                // 2nd param - callback which returns input argument
                console.log(text);
              },
            );
          }}
        />
      </ScrollView>
    </SafeAreaView>
  );
};

export default App;
```

---
_Source: https://npm.io/package/movr_module_rn · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
