@contentpass/react-native-contentpass 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/docs/CODE_OF_CONDUCT.md +133 -0
- package/docs/CONTRIBUTING.md +137 -0
- package/docs/SOURCEPOINT_SDK_INTEGRATION.md +112 -0
- package/docs/assets/sourcepoint-button-config.png +0 -0
- package/docs/assets/sourcepoint-property-example.png +0 -0
- package/docs/sourcepoint-patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch +78 -0
- package/docs/sourcepoint-patches/@sourcepoint-react-native-cmp-patch-34fca36663.patch +13 -0
- package/lib/commonjs/Contentpass.js +2 -1
- package/lib/commonjs/Contentpass.js.map +1 -1
- package/lib/commonjs/OidcAuthStateStorage.js +8 -1
- package/lib/commonjs/OidcAuthStateStorage.js.map +1 -1
- package/lib/module/Contentpass.js +2 -1
- package/lib/module/Contentpass.js.map +1 -1
- package/lib/module/OidcAuthStateStorage.js +8 -1
- package/lib/module/OidcAuthStateStorage.js.map +1 -1
- package/lib/typescript/commonjs/src/Contentpass.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/OidcAuthStateStorage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/ContentpassConfig.d.ts +1 -0
- package/lib/typescript/commonjs/src/types/ContentpassConfig.d.ts.map +1 -1
- package/lib/typescript/module/src/Contentpass.d.ts.map +1 -1
- package/lib/typescript/module/src/OidcAuthStateStorage.d.ts.map +1 -1
- package/lib/typescript/module/src/types/ContentpassConfig.d.ts +1 -0
- package/lib/typescript/module/src/types/ContentpassConfig.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -37,7 +37,8 @@ npx expo prebuild
|
|
|
37
37
|
|
|
38
38
|
### Initialization
|
|
39
39
|
Wrap your app's root component with ContentpassSdkProvider. The provider requires a configuration object (contentpassConfig) with the following properties:
|
|
40
|
-
- `propertyId` - Your unique property ID
|
|
40
|
+
- `propertyId` - Your unique property ID (ask Contentpass team for details)
|
|
41
|
+
- `planId` - The ID of the plan you want to check the user's subscription status against (ask Contentpass team for details)
|
|
41
42
|
- `issuer` - The OAuth 2.0 server URL (e.g. `https://my.contentpass.net`)
|
|
42
43
|
- `redirectUrl` - the redirect URL of your app to which the OAuth2 server will redirect after the authentication
|
|
43
44
|
|
|
@@ -47,7 +48,8 @@ import React from 'react';
|
|
|
47
48
|
import { ContentpassSdkProvider } from '@contentpass/react-native-contentpass';
|
|
48
49
|
|
|
49
50
|
const contentpassConfig = {
|
|
50
|
-
propertyId: '
|
|
51
|
+
propertyId: 'property-id',
|
|
52
|
+
planId: 'plan-id',
|
|
51
53
|
issuer: 'https://my.contentpass.net',
|
|
52
54
|
redirectUrl: 'com.yourapp://oauthredirect',
|
|
53
55
|
};
|
|
@@ -120,10 +122,14 @@ const YourApp = () => {
|
|
|
120
122
|
};
|
|
121
123
|
```
|
|
122
124
|
|
|
125
|
+
## Integration with Sourcepoint SDK
|
|
126
|
+
|
|
127
|
+
See the [Sourcepoint SDK documentation](docs/SOURCEPOINT_SDK_INTEGRATION.md) for information on integrating the Contentpass SDK with the Sourcepoint SDK.
|
|
123
128
|
|
|
124
129
|
## Contributing
|
|
125
130
|
|
|
126
|
-
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
131
|
+
See the [contributing guide](docs/CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
132
|
+
|
|
127
133
|
|
|
128
134
|
## License
|
|
129
135
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
|
|
2
|
+
# Contributor Covenant Code of Conduct
|
|
3
|
+
|
|
4
|
+
## Our Pledge
|
|
5
|
+
|
|
6
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
7
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
9
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
10
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
11
|
+
identity and orientation.
|
|
12
|
+
|
|
13
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
14
|
+
diverse, inclusive, and healthy community.
|
|
15
|
+
|
|
16
|
+
## Our Standards
|
|
17
|
+
|
|
18
|
+
Examples of behavior that contributes to a positive environment for our
|
|
19
|
+
community include:
|
|
20
|
+
|
|
21
|
+
* Demonstrating empathy and kindness toward other people
|
|
22
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
23
|
+
* Giving and gracefully accepting constructive feedback
|
|
24
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
25
|
+
and learning from the experience
|
|
26
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
|
27
|
+
community
|
|
28
|
+
|
|
29
|
+
Examples of unacceptable behavior include:
|
|
30
|
+
|
|
31
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
32
|
+
any kind
|
|
33
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
34
|
+
* Public or private harassment
|
|
35
|
+
* Publishing others' private information, such as a physical or email address,
|
|
36
|
+
without their explicit permission
|
|
37
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
38
|
+
professional setting
|
|
39
|
+
|
|
40
|
+
## Enforcement Responsibilities
|
|
41
|
+
|
|
42
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
43
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
44
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
45
|
+
or harmful.
|
|
46
|
+
|
|
47
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
48
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
49
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
50
|
+
decisions when appropriate.
|
|
51
|
+
|
|
52
|
+
## Scope
|
|
53
|
+
|
|
54
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
55
|
+
an individual is officially representing the community in public spaces.
|
|
56
|
+
Examples of representing our community include using an official e-mail address,
|
|
57
|
+
posting via an official social media account, or acting as an appointed
|
|
58
|
+
representative at an online or offline event.
|
|
59
|
+
|
|
60
|
+
## Enforcement
|
|
61
|
+
|
|
62
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
63
|
+
reported to the community leaders responsible for enforcement at
|
|
64
|
+
[INSERT CONTACT METHOD].
|
|
65
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
66
|
+
|
|
67
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
68
|
+
reporter of any incident.
|
|
69
|
+
|
|
70
|
+
## Enforcement Guidelines
|
|
71
|
+
|
|
72
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
73
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
74
|
+
|
|
75
|
+
### 1. Correction
|
|
76
|
+
|
|
77
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
78
|
+
unprofessional or unwelcome in the community.
|
|
79
|
+
|
|
80
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
81
|
+
clarity around the nature of the violation and an explanation of why the
|
|
82
|
+
behavior was inappropriate. A public apology may be requested.
|
|
83
|
+
|
|
84
|
+
### 2. Warning
|
|
85
|
+
|
|
86
|
+
**Community Impact**: A violation through a single incident or series of
|
|
87
|
+
actions.
|
|
88
|
+
|
|
89
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
90
|
+
interaction with the people involved, including unsolicited interaction with
|
|
91
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
92
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
93
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
|
94
|
+
ban.
|
|
95
|
+
|
|
96
|
+
### 3. Temporary Ban
|
|
97
|
+
|
|
98
|
+
**Community Impact**: A serious violation of community standards, including
|
|
99
|
+
sustained inappropriate behavior.
|
|
100
|
+
|
|
101
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
102
|
+
communication with the community for a specified period of time. No public or
|
|
103
|
+
private interaction with the people involved, including unsolicited interaction
|
|
104
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
105
|
+
Violating these terms may lead to a permanent ban.
|
|
106
|
+
|
|
107
|
+
### 4. Permanent Ban
|
|
108
|
+
|
|
109
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
110
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
111
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
112
|
+
|
|
113
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
114
|
+
community.
|
|
115
|
+
|
|
116
|
+
## Attribution
|
|
117
|
+
|
|
118
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
119
|
+
version 2.1, available at
|
|
120
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
121
|
+
|
|
122
|
+
Community Impact Guidelines were inspired by
|
|
123
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
124
|
+
|
|
125
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
126
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
127
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
128
|
+
|
|
129
|
+
[homepage]: https://www.contributor-covenant.org
|
|
130
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
131
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
132
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
133
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are always welcome, no matter how large or small!
|
|
4
|
+
|
|
5
|
+
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md).
|
|
6
|
+
|
|
7
|
+
## Development workflow
|
|
8
|
+
|
|
9
|
+
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
|
|
10
|
+
|
|
11
|
+
- The library package in the root directory.
|
|
12
|
+
- An example app in the `example/` directory.
|
|
13
|
+
- An expo example app in the `expoExample/` directory.
|
|
14
|
+
- A shared frontend code for example apps in the `sharedExample/` directory.
|
|
15
|
+
|
|
16
|
+
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
yarn
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
|
|
23
|
+
|
|
24
|
+
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.
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
If you want to use Android Studio or XCode to edit the native code, you can open the
|
|
30
|
+
- `example/android`
|
|
31
|
+
- `example/ios`
|
|
32
|
+
- `expoExample/android`
|
|
33
|
+
- `expoExample/ios`
|
|
34
|
+
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 > contentpass-react-native-contentpass`.
|
|
35
|
+
|
|
36
|
+
To edit the Java or Kotlin files, open `android` in Android studio and find the source files at `@contentpass/react-native-contentpass` under `Android`.
|
|
37
|
+
|
|
38
|
+
You can use various commands from the root directory to work with the project.
|
|
39
|
+
|
|
40
|
+
To start the packager:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
yarn example start
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
OR
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
yarn expo-example start
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
To run the example app on Android:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
yarn example android
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
OR
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
yarn expo-example android
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
To run the example app on iOS:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
yarn example ios
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
OR
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
yarn expo-example ios
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Make sure your code passes TypeScript, ESLint and Prettier. Run the following to verify:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
yarn typecheck
|
|
80
|
+
yarn lint
|
|
81
|
+
yarn prettier:check
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
To fix formatting errors, run the following:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
yarn lint --fix
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Remember to add tests for your change if possible. Run the unit tests by:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
yarn test
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Commit message convention
|
|
97
|
+
|
|
98
|
+
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
|
|
99
|
+
|
|
100
|
+
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
|
|
101
|
+
- `feat`: new features, e.g. add new method to the module.
|
|
102
|
+
- `refactor`: code refactor, e.g. migrate from class components to hooks.
|
|
103
|
+
- `docs`: changes into documentation, e.g. add usage example for the module..
|
|
104
|
+
- `test`: adding or updating tests, e.g. add integration tests using detox.
|
|
105
|
+
- `chore`: tooling changes, e.g. change CI config.
|
|
106
|
+
|
|
107
|
+
Our pre-commit hooks verify that your commit message matches this format when committing.
|
|
108
|
+
|
|
109
|
+
### Linting and tests
|
|
110
|
+
|
|
111
|
+
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
|
|
112
|
+
|
|
113
|
+
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
|
|
114
|
+
|
|
115
|
+
Our pre-commit hooks verify that the linter and tests pass when committing.
|
|
116
|
+
|
|
117
|
+
### Publishing to npm
|
|
118
|
+
|
|
119
|
+
We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
|
|
120
|
+
|
|
121
|
+
To publish new versions, run the following:
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
yarn release
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Sending a pull request
|
|
128
|
+
|
|
129
|
+
> **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).
|
|
130
|
+
|
|
131
|
+
When you're sending a pull request:
|
|
132
|
+
|
|
133
|
+
- Prefer small pull requests focused on one change.
|
|
134
|
+
- Verify that linters and tests are passing.
|
|
135
|
+
- Review the documentation to make sure it looks good.
|
|
136
|
+
- Follow the pull request template when opening a pull request.
|
|
137
|
+
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Integration with Sourcepoint SDK
|
|
2
|
+
The Contentpass SDK can be seamlessly integrated with the Sourcepoint SDK to manage consent. Since the Sourcepoint SDK
|
|
3
|
+
is a separate React Native package, you must install it independently. For detailed guidance, refer to the
|
|
4
|
+
[Sourcepoint SDK documentation](https://github.com/SourcePointUSA/react-native-sourcepoint-cmp).
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Setting Up Sourcepoint
|
|
8
|
+
To use the Sourcepoint SDK, follow these steps:
|
|
9
|
+
|
|
10
|
+
1. Create a Sourcepoint Account: Set up a Sourcepoint account and create a property with the type APP.
|
|
11
|
+
2. Configure the Property, ensure the property includes:
|
|
12
|
+
- Campaigns
|
|
13
|
+
- Partition Sets
|
|
14
|
+
- Scenarios (with the `acps` parameter — see [here](https://docs.contentpass.net/docs/onboarding/cmp/sourcepoint#4-sourcepoint-contentpass-integration) for details)
|
|
15
|
+
- Messages
|
|
16
|
+
|
|
17
|
+
For more information, consult the [Sourcepoint documentation](https://docs.sourcepoint.com/hc/en-us).
|
|
18
|
+
|
|
19
|
+
A newly created property should resemble the following example:
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
### Adding a Custom Action to Sourcepoint Messages
|
|
23
|
+
To integrate the Sourcepoint SDK with the Contentpass SDK, you must define a custom action in Sourcepoint Messages:
|
|
24
|
+
1. Navigate to `Messages` > `GDPR Messages` > `Web / Webview (TCF)`.
|
|
25
|
+
2. Edit the relevant message and add a custom action to the login button, such as `cp('login')`.
|
|
26
|
+
3. This custom action will authenticate users through the Contentpass SDK.
|
|
27
|
+
|
|
28
|
+
Example configuration:
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
## Code Integration
|
|
32
|
+
After setting up Sourcepoint, install its SDK package. Use the following code to integrate Contentpass and Sourcepoint
|
|
33
|
+
SDKs in your app.
|
|
34
|
+
|
|
35
|
+
### Important note
|
|
36
|
+
After creating a property in Sourcepoint, you must wait approximately 15 minutes before it becomes available for use
|
|
37
|
+
with the `@sourcepoint/react-native-cmp` package. This delay allows the configuration to propagate.
|
|
38
|
+
|
|
39
|
+
### Implementation
|
|
40
|
+
Install the Sourcepoint SDK package, then use the following code to integrate the two SDKs in your app:
|
|
41
|
+
|
|
42
|
+
```jsx
|
|
43
|
+
import { useEffect, useRef, useState } from 'react';
|
|
44
|
+
import { SPConsentManager } from '@sourcepoint/react-native-cmp';
|
|
45
|
+
import { ContentpassStateType, useContentpassSdk } from '@contentpass/react-native-contentpass';
|
|
46
|
+
|
|
47
|
+
const sourcePointConfig = {
|
|
48
|
+
accountId: 'SOURCEPOINT_ACCOUNT_ID',
|
|
49
|
+
propertyId: 'SOURCEPOINT_PROPERTY_ID',
|
|
50
|
+
propertyName: 'SOURCEPOINT_PROPERTY_NAME',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const setupSourcepoint = (hasValidSubscription) => {
|
|
54
|
+
const { accountId, propertyName, propertyId } = sourcePointConfig;
|
|
55
|
+
const spConsentManager = new SPConsentManager();
|
|
56
|
+
|
|
57
|
+
spConsentManager.build(accountId, propertyId, propertyName, {
|
|
58
|
+
gdpr: {
|
|
59
|
+
targetingParams: {
|
|
60
|
+
acps: hasValidSubscription ? 'true' : 'false',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
return spConsentManager;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const App = () => {
|
|
69
|
+
const [authResult, setAuthResult] = useState();
|
|
70
|
+
const contentpassSdk = useContentpassSdk();
|
|
71
|
+
const spConsentManager = useRef();
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const onContentpassStateChange = (state) => {
|
|
75
|
+
setAuthResult(state);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
contentpassSdk.registerObserver(onContentpassStateChange);
|
|
79
|
+
|
|
80
|
+
return () => {
|
|
81
|
+
contentpassSdk.unregisterObserver(onContentpassStateChange);
|
|
82
|
+
};
|
|
83
|
+
}, [contentpassSdk]);
|
|
84
|
+
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
// wait for the authResult to be set before setting up Sourcepoint
|
|
87
|
+
if (!authResult || authResult.state === ContentpassStateType.INITIALISING) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
spConsentManager.current = setupSourcepoint(
|
|
92
|
+
authResult.hasValidSubscription || false
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
spConsentManager.current?.onAction((action) => {
|
|
96
|
+
if (action.customActionId === "cp('login')") {
|
|
97
|
+
contentpassSdk.authenticate()
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
spConsentManager.current?.loadMessage();
|
|
102
|
+
|
|
103
|
+
return () => {
|
|
104
|
+
spConsentManager.current?.dispose();
|
|
105
|
+
};
|
|
106
|
+
}, [authResult, contentpassSdk]);
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
// Your app content
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
```
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
diff --git a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt
|
|
2
|
+
index deb04fb18dbd8adffcb225801ad35b3154a3c7ad..4d372d921cbae6163179435feb9c821e3c37134b 100644
|
|
3
|
+
--- a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt
|
|
4
|
+
+++ b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt
|
|
5
|
+
@@ -119,6 +119,7 @@ class RNSourcepointCmpModule internal constructor(context: ReactApplicationConte
|
|
6
|
+
override fun onAction(view: View, consentAction: ConsentAction): ConsentAction {
|
|
7
|
+
sendEvent(SDKEvent.onAction, createMap().apply {
|
|
8
|
+
putString("actionType", RNSourcepointActionType.from(consentAction.actionType).name)
|
|
9
|
+
+ putString("customActionId", consentAction.customActionId ?: "")
|
|
10
|
+
})
|
|
11
|
+
return consentAction
|
|
12
|
+
}
|
|
13
|
+
diff --git a/ios/RNSourcepointCmp.swift b/ios/RNSourcepointCmp.swift
|
|
14
|
+
index 556b56618c847ad8aeaf9cdc680813cc26b732a9..ba7d707232d72fe5038ec05fb6fdb8e27216e4ee 100644
|
|
15
|
+
--- a/ios/RNSourcepointCmp.swift
|
|
16
|
+
+++ b/ios/RNSourcepointCmp.swift
|
|
17
|
+
@@ -69,7 +69,10 @@ extension RNSourcepointCmp: SPDelegate {
|
|
18
|
+
func onAction(_ action: SPAction, from controller: UIViewController) {
|
|
19
|
+
RNSourcepointCmp.shared?.sendEvent(
|
|
20
|
+
withName: "onAction",
|
|
21
|
+
- body: ["actionType": RNSourcepointActionType(from: action.type).rawValue]
|
|
22
|
+
+ body: [
|
|
23
|
+
+ "actionType": RNSourcepointActionType(from: action.type).rawValue,
|
|
24
|
+
+ "customActionId": action.customActionId ?? "",
|
|
25
|
+
+ ]
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
diff --git a/lib/typescript/src/index.d.ts b/lib/typescript/src/index.d.ts
|
|
30
|
+
index 1602516717becd5ec0a8e5036ad2d821110af96f..67bb9e5153b7489c5ead4dcd056b502b71bc2a7d 100644
|
|
31
|
+
--- a/lib/typescript/src/index.d.ts
|
|
32
|
+
+++ b/lib/typescript/src/index.d.ts
|
|
33
|
+
@@ -12,6 +12,7 @@ export declare class SPConsentManager implements Spec {
|
|
34
|
+
loadUSNatPrivacyManager(pmId: string): void;
|
|
35
|
+
onAction(callback: (body: {
|
|
36
|
+
actionType: SPActionType;
|
|
37
|
+
+ customActionId: string;
|
|
38
|
+
}) => void): void;
|
|
39
|
+
onSPUIReady(callback: () => void): void;
|
|
40
|
+
onSPUIFinished(callback: () => void): void;
|
|
41
|
+
diff --git a/lib/typescript/src/types.d.ts b/lib/typescript/src/types.d.ts
|
|
42
|
+
index a15f7a06c3e0635168987a44a33009ff42bbd31c..a035a72af14f32adf0ff88f959eb8c517ffaea47 100644
|
|
43
|
+
--- a/lib/typescript/src/types.d.ts
|
|
44
|
+
+++ b/lib/typescript/src/types.d.ts
|
|
45
|
+
@@ -86,6 +86,7 @@ export interface Spec extends TurboModule {
|
|
46
|
+
loadUSNatPrivacyManager(pmId: string): void;
|
|
47
|
+
onAction(callback: (body: {
|
|
48
|
+
actionType: SPActionType;
|
|
49
|
+
+ customActionId: string;
|
|
50
|
+
}) => void): void;
|
|
51
|
+
onSPUIReady(callback: () => void): void;
|
|
52
|
+
onSPUIFinished(callback: () => void): void;
|
|
53
|
+
diff --git a/src/index.ts b/src/index.ts
|
|
54
|
+
index b3e76b15572c56f1a4e54068b90243d6dd028e18..a03d87fea4a93edb6bf904c99d32b029b840bade 100644
|
|
55
|
+
--- a/src/index.ts
|
|
56
|
+
+++ b/src/index.ts
|
|
57
|
+
@@ -67,7 +67,7 @@ export class SPConsentManager implements Spec {
|
|
58
|
+
RNSourcepointCmp.loadUSNatPrivacyManager(pmId);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
- onAction(callback: (body: { actionType: SPActionType }) => void): void {
|
|
62
|
+
+ onAction(callback: (body: { actionType: SPActionType, customActionId: string }) => void): void {
|
|
63
|
+
this.emitter.removeAllListeners('onAction');
|
|
64
|
+
this.emitter.addListener('onAction', callback);
|
|
65
|
+
}
|
|
66
|
+
diff --git a/src/types.ts b/src/types.ts
|
|
67
|
+
index 26ac3d8162c0534af98e2a20d237856195fe5a10..4257aff5ed128988c7d3fba60545672966162b20 100644
|
|
68
|
+
--- a/src/types.ts
|
|
69
|
+
+++ b/src/types.ts
|
|
70
|
+
@@ -113,7 +113,7 @@ export interface Spec extends TurboModule {
|
|
71
|
+
loadGDPRPrivacyManager(pmId: string): void;
|
|
72
|
+
loadUSNatPrivacyManager(pmId: string): void;
|
|
73
|
+
|
|
74
|
+
- onAction(callback: (body: { actionType: SPActionType }) => void): void;
|
|
75
|
+
+ onAction(callback: (body: { actionType: SPActionType, customActionId: string }) => void): void;
|
|
76
|
+
onSPUIReady(callback: () => void): void;
|
|
77
|
+
onSPUIFinished(callback: () => void): void;
|
|
78
|
+
onFinished(callback: () => void): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
diff --git a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpTypes.kt b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpTypes.kt
|
|
2
|
+
index bb8c6c37adc3d7980c7e92268b98b9d97ef8de40..3d67b3a3f44743c4542a1966e66e1af3ea93c555 100644
|
|
3
|
+
--- a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpTypes.kt
|
|
4
|
+
+++ b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpTypes.kt
|
|
5
|
+
@@ -16,7 +16,7 @@ data class SPCampaign(
|
|
6
|
+
val rawTargetingParam: ReadableMap?,
|
|
7
|
+
val supportLegacyUSPString: Boolean
|
|
8
|
+
) {
|
|
9
|
+
- val targetingParams = rawTargetingParam?.toHashMap()?.map { TargetingParam(it.key, it.toString()) } ?: emptyList()
|
|
10
|
+
+ val targetingParams = rawTargetingParam?.toHashMap()?.map { TargetingParam(it.key, it.value.toString()) } ?: emptyList()
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
data class SPCampaigns(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_OidcAuthStateStorage","_interopRequireDefault","require","_ContentpassState","_reactNativeAppAuth","_oidcConsts","_RefreshTokenStrategy","_fetchContentpassToken","_validateSubscription","_sentryIntegration","e","__esModule","default","Contentpass","contentpassState","state","ContentpassStateType","INITIALISING","contentpassStateObservers","oidcAuthState","refreshTimer","constructor","config","authStateStorage","OidcAuthStateStorage","propertyId","setSentryExtraAttribute","initialiseAuthState","authenticate","result","authorize","clientId","redirectUrl","issuer","scopes","SCOPES","additionalParameters","cp_route","prompt","cp_property","err","reportError","msg","changeContentpassState","ERROR","error","onNewAuthState","registerObserver","observer","includes","push","unregisterObserver","filter","o","logout","clearOidcAuthState","UNAUTHENTICATED","hasValidSubscription","recoverFromError","authState","getOidcAuthState","storeOidcAuthState","strategy","setupRefreshTimer","RefreshTokenStrategy","INSTANTLY","contentpassToken","fetchContentpassToken","idToken","validateSubscription","AUTHENTICATED","accessTokenExpirationDate","NO_REFRESH","now","Date","expirationDate","timeDiff","getTime","refreshToken","clearTimeout","setTimeout","TIMER_SET","counter","Error","refreshResult","refresh","onRefreshTokenError","REFRESH_TOKEN_RETRIES","delay","Promise","resolve","forEach","exports"],"sourceRoot":"../../src","sources":["Contentpass.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,iBAAA,GAAAD,OAAA;AAIA,IAAAE,mBAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,qBAAA,GAAAP,sBAAA,CAAAC,OAAA;AAEA,IAAAO,kBAAA,GAAAP,OAAA;AAA2E,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI5D,MAAMG,WAAW,CAAC;EAIvBC,gBAAgB,GAAqB;IAC3CC,KAAK,EAAEC,sCAAoB,CAACC;EAC9B,CAAC;EACOC,yBAAyB,GAA0B,EAAE;EACrDC,aAAa,GAAyB,IAAI;EAC1CC,YAAY,GAA0B,IAAI;EAElDC,WAAWA,CAACC,MAAyB,EAAE;IACrC,IAAI,CAACC,gBAAgB,GAAG,IAAIC,6BAAoB,CAACF,MAAM,CAACG,UAAU,CAAC;IACnE,IAAI,CAACH,MAAM,GAAGA,MAAM;IACpB,IAAAI,0CAAuB,EAAC,YAAY,EAAEJ,MAAM,CAACG,UAAU,CAAC;IACxD,IAAI,CAACE,mBAAmB,CAAC,CAAC;EAC5B;EAEOC,YAAY,GAAG,MAAAA,CAAA,KAA2B;IAC/C,IAAIC,MAAuB;IAE3B,IAAI;MACFA,MAAM,GAAG,MAAM,IAAAC,6BAAS,EAAC;QACvBC,QAAQ,EAAE,IAAI,CAACT,MAAM,CAACG,UAAU;QAChCO,WAAW,EAAE,IAAI,CAACV,MAAM,CAACU,WAAW;QACpCC,MAAM,EAAE,IAAI,CAACX,MAAM,CAACW,MAAM;QAC1BC,MAAM,EAAEC,kBAAM;QACdC,oBAAoB,EAAE;UACpBC,QAAQ,EAAE,OAAO;UACjBC,MAAM,EAAE,SAAS;UACjBC,WAAW,EAAE,IAAI,CAACjB,MAAM,CAACG;
|
|
1
|
+
{"version":3,"names":["_OidcAuthStateStorage","_interopRequireDefault","require","_ContentpassState","_reactNativeAppAuth","_oidcConsts","_RefreshTokenStrategy","_fetchContentpassToken","_validateSubscription","_sentryIntegration","e","__esModule","default","Contentpass","contentpassState","state","ContentpassStateType","INITIALISING","contentpassStateObservers","oidcAuthState","refreshTimer","constructor","config","authStateStorage","OidcAuthStateStorage","propertyId","setSentryExtraAttribute","initialiseAuthState","authenticate","result","authorize","clientId","redirectUrl","issuer","scopes","SCOPES","additionalParameters","cp_route","prompt","cp_property","cp_plan","planId","err","reportError","msg","changeContentpassState","ERROR","error","onNewAuthState","registerObserver","observer","includes","push","unregisterObserver","filter","o","logout","clearOidcAuthState","UNAUTHENTICATED","hasValidSubscription","recoverFromError","authState","getOidcAuthState","storeOidcAuthState","strategy","setupRefreshTimer","RefreshTokenStrategy","INSTANTLY","contentpassToken","fetchContentpassToken","idToken","validateSubscription","AUTHENTICATED","accessTokenExpirationDate","NO_REFRESH","now","Date","expirationDate","timeDiff","getTime","refreshToken","clearTimeout","setTimeout","TIMER_SET","counter","Error","refreshResult","refresh","onRefreshTokenError","REFRESH_TOKEN_RETRIES","delay","Promise","resolve","forEach","exports"],"sourceRoot":"../../src","sources":["Contentpass.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,iBAAA,GAAAD,OAAA;AAIA,IAAAE,mBAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,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,KAAK;IACnE,IAAAC,8BAAW,EAACD,GAAG,EAAE;MACfE,GAAG,EAAE,iCAAiCwC,OAAO;IAC/C,CAAC,CAAC;IACF;IACA,IAAIA,OAAO,GAAGK,iCAAqB,EAAE;MACnC,MAAMC,KAAK,GAAGN,OAAO,GAAG,IAAI,GAAG,EAAE;MACjC,MAAM,IAAIO,OAAO,CAAEC,OAAO,IAAKV,UAAU,CAACU,OAAO,EAAEF,KAAK,CAAC,CAAC;MAC1D,MAAM,IAAI,CAACV,YAAY,CAACI,OAAO,GAAG,CAAC,CAAC;MACpC;IACF;IAEA,MAAM,IAAI,CAAC5B,MAAM,CAAC,CAAC;EACrB,CAAC;EAEOX,sBAAsB,GAAI9B,KAAuB,IAAK;IAC5D,IAAI,CAACD,gBAAgB,GAAGC,KAAK;IAC7B,IAAI,CAACG,yBAAyB,CAAC2E,OAAO,CAAE3C,QAAQ,IAAKA,QAAQ,CAACnC,KAAK,CAAC,CAAC;EACvE,CAAC;AACH;AAAC+E,OAAA,CAAAlF,OAAA,GAAAC,WAAA","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _reactNativeEncryptedStorage = _interopRequireDefault(require("react-native-encrypted-storage"));
|
|
8
|
+
var _sentryIntegration = require("./sentryIntegration.js");
|
|
8
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
10
|
const AUTH_STATE_KEY = 'OIDCAuthState';
|
|
10
11
|
class OidcAuthStateStorage {
|
|
@@ -19,7 +20,13 @@ class OidcAuthStateStorage {
|
|
|
19
20
|
return oidcAuthStateString ? JSON.parse(oidcAuthStateString) : undefined;
|
|
20
21
|
}
|
|
21
22
|
async clearOidcAuthState() {
|
|
22
|
-
|
|
23
|
+
try {
|
|
24
|
+
await _reactNativeEncryptedStorage.default.removeItem(this.key);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
(0, _sentryIntegration.reportError)(err, {
|
|
27
|
+
msg: 'Failed to clear OIDC auth state. Most probably we tried to remove item which does not exist'
|
|
28
|
+
});
|
|
29
|
+
}
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
32
|
exports.default = OidcAuthStateStorage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeEncryptedStorage","_interopRequireDefault","require","e","__esModule","default","AUTH_STATE_KEY","OidcAuthStateStorage","constructor","clientId","key","storeOidcAuthState","authState","EncryptedStorage","setItem","JSON","stringify","getOidcAuthState","oidcAuthStateString","getItem","parse","undefined","clearOidcAuthState","removeItem","exports"],"sourceRoot":"../../src","sources":["OidcAuthStateStorage.ts"],"mappings":";;;;;;AAAA,IAAAA,4BAAA,GAAAC,sBAAA,CAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNativeEncryptedStorage","_interopRequireDefault","require","_sentryIntegration","e","__esModule","default","AUTH_STATE_KEY","OidcAuthStateStorage","constructor","clientId","key","storeOidcAuthState","authState","EncryptedStorage","setItem","JSON","stringify","getOidcAuthState","oidcAuthStateString","getItem","parse","undefined","clearOidcAuthState","removeItem","err","reportError","msg","exports"],"sourceRoot":"../../src","sources":["OidcAuthStateStorage.ts"],"mappings":";;;;;;AAAA,IAAAA,4BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAAkD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElD,MAAMG,cAAc,GAAG,eAAe;AAUvB,MAAMC,oBAAoB,CAAC;EAGxCC,WAAWA,CAACC,QAAgB,EAAE;IAC5B,IAAI,CAACC,GAAG,GAAG,kBAAkBD,QAAQ,IAAIH,cAAc,EAAE;EAC3D;EAEA,MAAaK,kBAAkBA,CAACC,SAAwB,EAAE;IACxD,MAAMC,oCAAgB,CAACC,OAAO,CAAC,IAAI,CAACJ,GAAG,EAAEK,IAAI,CAACC,SAAS,CAACJ,SAAS,CAAC,CAAC;EACrE;EAEA,MAAaK,gBAAgBA,CAAA,EAAuC;IAClE,MAAMC,mBAAmB,GAAG,MAAML,oCAAgB,CAACM,OAAO,CAAC,IAAI,CAACT,GAAG,CAAC;IAEpE,OAAOQ,mBAAmB,GAAGH,IAAI,CAACK,KAAK,CAACF,mBAAmB,CAAC,GAAGG,SAAS;EAC1E;EAEA,MAAaC,kBAAkBA,CAAA,EAAG;IAChC,IAAI;MACF,MAAMT,oCAAgB,CAACU,UAAU,CAAC,IAAI,CAACb,GAAG,CAAC;IAC7C,CAAC,CAAC,OAAOc,GAAQ,EAAE;MACjB,IAAAC,8BAAW,EAACD,GAAG,EAAE;QACfE,GAAG,EAAE;MACP,CAAC,CAAC;IACJ;EACF;AACF;AAACC,OAAA,CAAAtB,OAAA,GAAAE,oBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OidcAuthStateStorage","ContentpassStateType","authorize","refresh","REFRESH_TOKEN_RETRIES","SCOPES","RefreshTokenStrategy","fetchContentpassToken","validateSubscription","reportError","setSentryExtraAttribute","Contentpass","contentpassState","state","INITIALISING","contentpassStateObservers","oidcAuthState","refreshTimer","constructor","config","authStateStorage","propertyId","initialiseAuthState","authenticate","result","clientId","redirectUrl","issuer","scopes","additionalParameters","cp_route","prompt","cp_property","err","msg","changeContentpassState","ERROR","error","onNewAuthState","registerObserver","observer","includes","push","unregisterObserver","filter","o","logout","clearOidcAuthState","UNAUTHENTICATED","hasValidSubscription","recoverFromError","authState","getOidcAuthState","storeOidcAuthState","strategy","setupRefreshTimer","INSTANTLY","contentpassToken","idToken","AUTHENTICATED","accessTokenExpirationDate","NO_REFRESH","now","Date","expirationDate","timeDiff","getTime","refreshToken","clearTimeout","setTimeout","TIMER_SET","counter","Error","refreshResult","onRefreshTokenError","delay","Promise","resolve","forEach"],"sourceRoot":"../../src","sources":["Contentpass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age","ContentpassStateType","authorize","refresh","REFRESH_TOKEN_RETRIES","SCOPES","RefreshTokenStrategy","fetchContentpassToken","validateSubscription","reportError","setSentryExtraAttribute","Contentpass","contentpassState","state","INITIALISING","contentpassStateObservers","oidcAuthState","refreshTimer","constructor","config","authStateStorage","propertyId","initialiseAuthState","authenticate","result","clientId","redirectUrl","issuer","scopes","additionalParameters","cp_route","prompt","cp_property","cp_plan","planId","err","msg","changeContentpassState","ERROR","error","onNewAuthState","registerObserver","observer","includes","push","unregisterObserver","filter","o","logout","clearOidcAuthState","UNAUTHENTICATED","hasValidSubscription","recoverFromError","authState","getOidcAuthState","storeOidcAuthState","strategy","setupRefreshTimer","INSTANTLY","contentpassToken","idToken","AUTHENTICATED","accessTokenExpirationDate","NO_REFRESH","now","Date","expirationDate","timeDiff","getTime","refreshToken","clearTimeout","setTimeout","TIMER_SET","counter","Error","refreshResult","onRefreshTokenError","delay","Promise","resolve","forEach"],"sourceRoot":"../../src","sources":["Contentpass.ts"],"mappings":";;AAAA,OAAOA,oBAAoB,MAEpB,2BAAwB;AAC/B,SAEEC,oBAAoB,QACf,6BAA0B;AACjC,SACEC,SAAS,EAETC,OAAO,QACF,uBAAuB;AAC9B,SAASC,qBAAqB,EAAEC,MAAM,QAAQ,wBAAqB;AACnE,SAASC,oBAAoB,QAAQ,iCAA8B;AACnE,OAAOC,qBAAqB,MAAM,kCAA+B;AACjE,OAAOC,oBAAoB,MAAM,iCAA8B;AAE/D,SAASC,WAAW,EAAEC,uBAAuB,QAAQ,wBAAqB;AAI1E,eAAe,MAAMC,WAAW,CAAC;EAIvBC,gBAAgB,GAAqB;IAC3CC,KAAK,EAAEZ,oBAAoB,CAACa;EAC9B,CAAC;EACOC,yBAAyB,GAA0B,EAAE;EACrDC,aAAa,GAAyB,IAAI;EAC1CC,YAAY,GAA0B,IAAI;EAElDC,WAAWA,CAACC,MAAyB,EAAE;IACrC,IAAI,CAACC,gBAAgB,GAAG,IAAIpB,oBAAoB,CAACmB,MA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D,gBAAgB,GAAGC,KAAK;IAC7B,IAAI,CAACE,yBAAyB,CAACiE,OAAO,CAAEtC,QAAQ,IAAKA,QAAQ,CAAC7B,KAAK,CAAC,CAAC;EACvE,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import EncryptedStorage from 'react-native-encrypted-storage';
|
|
4
|
+
import { reportError } from "./sentryIntegration.js";
|
|
4
5
|
const AUTH_STATE_KEY = 'OIDCAuthState';
|
|
5
6
|
export default class OidcAuthStateStorage {
|
|
6
7
|
constructor(clientId) {
|
|
@@ -14,7 +15,13 @@ export default class OidcAuthStateStorage {
|
|
|
14
15
|
return oidcAuthStateString ? JSON.parse(oidcAuthStateString) : undefined;
|
|
15
16
|
}
|
|
16
17
|
async clearOidcAuthState() {
|
|
17
|
-
|
|
18
|
+
try {
|
|
19
|
+
await EncryptedStorage.removeItem(this.key);
|
|
20
|
+
} catch (err) {
|
|
21
|
+
reportError(err, {
|
|
22
|
+
msg: 'Failed to clear OIDC auth state. Most probably we tried to remove item which does not exist'
|
|
23
|
+
});
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
}
|
|
20
27
|
//# sourceMappingURL=OidcAuthStateStorage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EncryptedStorage","AUTH_STATE_KEY","OidcAuthStateStorage","constructor","clientId","key","storeOidcAuthState","authState","setItem","JSON","stringify","getOidcAuthState","oidcAuthStateString","getItem","parse","undefined","clearOidcAuthState","removeItem"],"sourceRoot":"../../src","sources":["OidcAuthStateStorage.ts"],"mappings":";;AAAA,OAAOA,gBAAgB,MAAM,gCAAgC;
|
|
1
|
+
{"version":3,"names":["EncryptedStorage","reportError","AUTH_STATE_KEY","OidcAuthStateStorage","constructor","clientId","key","storeOidcAuthState","authState","setItem","JSON","stringify","getOidcAuthState","oidcAuthStateString","getItem","parse","undefined","clearOidcAuthState","removeItem","err","msg"],"sourceRoot":"../../src","sources":["OidcAuthStateStorage.ts"],"mappings":";;AAAA,OAAOA,gBAAgB,MAAM,gCAAgC;AAC7D,SAASC,WAAW,QAAQ,wBAAqB;AAEjD,MAAMC,cAAc,GAAG,eAAe;AAUtC,eAAe,MAAMC,oBAAoB,CAAC;EAGxCC,WAAWA,CAACC,QAAgB,EAAE;IAC5B,IAAI,CAACC,GAAG,GAAG,kBAAkBD,QAAQ,IAAIH,cAAc,EAAE;EAC3D;EAEA,MAAaK,kBAAkBA,CAACC,SAAwB,EAAE;IACxD,MAAMR,gBAAgB,CAACS,OAAO,CAAC,IAAI,CAACH,GAAG,EAAEI,IAAI,CAACC,SAAS,CAACH,SAAS,CAAC,CAAC;EACrE;EAEA,MAAaI,gBAAgBA,CAAA,EAAuC;IAClE,MAAMC,mBAAmB,GAAG,MAAMb,gBAAgB,CAACc,OAAO,CAAC,IAAI,CAACR,GAAG,CAAC;IAEpE,OAAOO,mBAAmB,GAAGH,IAAI,CAACK,KAAK,CAACF,mBAAmB,CAAC,GAAGG,SAAS;EAC1E;EAEA,MAAaC,kBAAkBA,CAAA,EAAG;IAChC,IAAI;MACF,MAAMjB,gBAAgB,CAACkB,UAAU,CAAC,IAAI,CAACZ,GAAG,CAAC;IAC7C,CAAC,CAAC,OAAOa,GAAQ,EAAE;MACjBlB,WAAW,CAACkB,GAAG,EAAE;QACfC,GAAG,EAAE;MACP,CAAC,CAAC;IACJ;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contentpass.d.ts","sourceRoot":"","sources":["../../../../src/Contentpass.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAUlC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEpE,MAAM,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C,sBAAsB,CAG5B;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcAuthStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/OidcAuthStateStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OidcAuthStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/OidcAuthStateStorage.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAET,QAAQ,EAAE,MAAM;IAIf,kBAAkB,CAAC,SAAS,EAAE,aAAa;IAI3C,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAMtD,kBAAkB;CAShC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentpassConfig.d.ts","sourceRoot":"","sources":["../../../../../src/types/ContentpassConfig.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"ContentpassConfig.d.ts","sourceRoot":"","sources":["../../../../../src/types/ContentpassConfig.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contentpass.d.ts","sourceRoot":"","sources":["../../../../src/Contentpass.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAUlC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAE3C,OAAO,CAAC,gBAAgB,CAEtB;IACF,OAAO,CAAC,yBAAyB,CAA6B;IAC9D,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,YAAY,CAA+B;gBAEvC,MAAM,EAAE,iBAAiB;IAO9B,YAAY,QAAa,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"Contentpass.d.ts","sourceRoot":"","sources":["../../../../src/Contentpass.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAUlC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAE3C,OAAO,CAAC,gBAAgB,CAEtB;IACF,OAAO,CAAC,yBAAyB,CAA6B;IAC9D,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,YAAY,CAA+B;gBAEvC,MAAM,EAAE,iBAAiB;IAO9B,YAAY,QAAa,OAAO,CAAC,IAAI,CAAC,CA2B3C;IAEK,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB;IAS9C,kBAAkB,CAAC,QAAQ,EAAE,mBAAmB;IAMhD,MAAM,sBAMX;IAEK,gBAAgB,sBAMrB;IAEF,OAAO,CAAC,mBAAmB,CAWzB;IAEF,OAAO,CAAC,cAAc,CA2BpB;IAEF,OAAO,CAAC,iBAAiB,CAyBvB;IAEF,OAAO,CAAC,YAAY,CAsBlB;IAEF,OAAO,CAAC,mBAAmB,CAazB;IAEF,OAAO,CAAC,sBAAsB,CAG5B;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OidcAuthStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/OidcAuthStateStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OidcAuthStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/OidcAuthStateStorage.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,MAAM,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAET,QAAQ,EAAE,MAAM;IAIf,kBAAkB,CAAC,SAAS,EAAE,aAAa;IAI3C,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAMtD,kBAAkB;CAShC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentpassConfig.d.ts","sourceRoot":"","sources":["../../../../../src/types/ContentpassConfig.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"ContentpassConfig.d.ts","sourceRoot":"","sources":["../../../../../src/types/ContentpassConfig.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentpass/react-native-contentpass",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Contentpass React Native SDK",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"android",
|
|
24
24
|
"ios",
|
|
25
25
|
"cpp",
|
|
26
|
+
"docs",
|
|
26
27
|
"*.podspec",
|
|
27
28
|
"!ios/build",
|
|
28
29
|
"!android/build",
|