Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 32 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/f

- The library package in the root directory.
- An example app in the `example/` directory.
- An expo example app in the `expoExample/` directory.
- A shared frontend code for example apps in the `sharedExample/` directory.

To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:

Expand All @@ -19,13 +21,19 @@ yarn

> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.

The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
The [example app](/example/) and [expo example app](/expoExample/) demonstrates usage of the library. You need to run it to test any changes you make.

It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example apps.
Changes to the library's JavaScript code will be reflected in the example apps without a rebuild, but native code changes will require a rebuild of the example app.

If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/ContentpassExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-contentpass`.
If you want to use Android Studio or XCode to edit the native code, you can open the
- `example/android`
- `example/ios`
- `expoExample/android`
- `expoExample/ios`
directories respectively in those editors. To edit the Objective-C or Swift files, open `ios/ContentpassExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-contentpass`.

To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-contentpass` under `Android`.
To edit the Java or Kotlin files, open `android` in Android studio and find the source files at `react-native-contentpass` under `Android`.

You can use various commands from the root directory to work with the project.

Expand All @@ -35,23 +43,42 @@ To start the packager:
yarn example start
```

OR

```sh
yarn expo-example start
```

To run the example app on Android:

```sh
yarn example android
```

OR

```sh
yarn expo-example android
```

To run the example app on iOS:

```sh
yarn example ios
```

Make sure your code passes TypeScript and ESLint. Run the following to verify:
OR

```sh
yarn expo-example ios
```

Make sure your code passes TypeScript, ESLint and Prettier. Run the following to verify:

```sh
yarn typecheck
yarn lint
yarn prettier:check
```

To fix formatting errors, run the following:
Expand Down Expand Up @@ -97,18 +124,6 @@ To publish new versions, run the following:
yarn release
```

### Scripts

The `package.json` file contains various scripts for common tasks:

- `yarn`: setup project by installing dependencies.
- `yarn typecheck`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn test`: run unit tests with Jest.
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.

### Sending a pull request

> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
Expand Down
7 changes: 6 additions & 1 deletion sharedExample/src/contentpassConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import type { ContentpassConfig } from 'react-native-contentpass';

export const contentpassConfig: ContentpassConfig = {
// Testing app
propertyId: 'cc3fc4ad-cbe5-4d09-bf85-a49796603b19',
redirectUrl: 'de.contentpass.demo://oauth',
issuer: 'https://my.contentpass.dev',
// Staging app
// propertyId: '78da2fd3-8b25-4642-b7b7-4a0193d00f89',
// issuer: 'https://my.contentpass.io',

redirectUrl: 'de.contentpass.demo://oauth',
};