├── .github
├── PULL_REQUEST_TEMPLATE.md
├── dependabot.yml
└── workflows
│ ├── daily.yml
│ ├── dependabot-automerge.yml
│ ├── issue-autorespond-and-close.yml
│ ├── pull-request.yml
│ ├── release.yml
│ └── sonarcloud.yml
├── .gitignore
├── .npmignore
├── LICENSE
├── README.md
├── android
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── libs
│ ├── java-json.jar
│ └── react-native-android
│ │ └── com
│ │ └── facebook
│ │ └── react
│ │ ├── hermes-engine
│ │ ├── 0.70.5
│ │ │ ├── hermes-engine-0.70.5-debug-sources.jar
│ │ │ ├── hermes-engine-0.70.5-debug-sources.jar.md5
│ │ │ ├── hermes-engine-0.70.5-debug-sources.jar.sha1
│ │ │ ├── hermes-engine-0.70.5-debug-sources.jar.sha256
│ │ │ ├── hermes-engine-0.70.5-debug-sources.jar.sha512
│ │ │ ├── hermes-engine-0.70.5-debug.aar
│ │ │ ├── hermes-engine-0.70.5-debug.aar.md5
│ │ │ ├── hermes-engine-0.70.5-debug.aar.sha1
│ │ │ ├── hermes-engine-0.70.5-debug.aar.sha256
│ │ │ ├── hermes-engine-0.70.5-debug.aar.sha512
│ │ │ ├── hermes-engine-0.70.5-release-sources.jar
│ │ │ ├── hermes-engine-0.70.5-release-sources.jar.md5
│ │ │ ├── hermes-engine-0.70.5-release-sources.jar.sha1
│ │ │ ├── hermes-engine-0.70.5-release-sources.jar.sha256
│ │ │ ├── hermes-engine-0.70.5-release-sources.jar.sha512
│ │ │ ├── hermes-engine-0.70.5-release.aar
│ │ │ ├── hermes-engine-0.70.5-release.aar.md5
│ │ │ ├── hermes-engine-0.70.5-release.aar.sha1
│ │ │ ├── hermes-engine-0.70.5-release.aar.sha256
│ │ │ ├── hermes-engine-0.70.5-release.aar.sha512
│ │ │ ├── hermes-engine-0.70.5.module
│ │ │ ├── hermes-engine-0.70.5.module.md5
│ │ │ ├── hermes-engine-0.70.5.module.sha1
│ │ │ ├── hermes-engine-0.70.5.module.sha256
│ │ │ ├── hermes-engine-0.70.5.module.sha512
│ │ │ ├── hermes-engine-0.70.5.pom
│ │ │ ├── hermes-engine-0.70.5.pom.md5
│ │ │ ├── hermes-engine-0.70.5.pom.sha1
│ │ │ ├── hermes-engine-0.70.5.pom.sha256
│ │ │ └── hermes-engine-0.70.5.pom.sha512
│ │ ├── maven-metadata.xml
│ │ ├── maven-metadata.xml.md5
│ │ ├── maven-metadata.xml.sha1
│ │ ├── maven-metadata.xml.sha256
│ │ └── maven-metadata.xml.sha512
│ │ └── react-native
│ │ ├── 0.70.5
│ │ ├── react-native-0.70.5-debug-sources.jar
│ │ ├── react-native-0.70.5-debug-sources.jar.md5
│ │ ├── react-native-0.70.5-debug-sources.jar.sha1
│ │ ├── react-native-0.70.5-debug-sources.jar.sha256
│ │ ├── react-native-0.70.5-debug-sources.jar.sha512
│ │ ├── react-native-0.70.5-debug.aar
│ │ ├── react-native-0.70.5-debug.aar.md5
│ │ ├── react-native-0.70.5-debug.aar.sha1
│ │ ├── react-native-0.70.5-debug.aar.sha256
│ │ ├── react-native-0.70.5-debug.aar.sha512
│ │ ├── react-native-0.70.5-release-sources.jar
│ │ ├── react-native-0.70.5-release-sources.jar.md5
│ │ ├── react-native-0.70.5-release-sources.jar.sha1
│ │ ├── react-native-0.70.5-release-sources.jar.sha256
│ │ ├── react-native-0.70.5-release-sources.jar.sha512
│ │ ├── react-native-0.70.5-release.aar
│ │ ├── react-native-0.70.5-release.aar.md5
│ │ ├── react-native-0.70.5-release.aar.sha1
│ │ ├── react-native-0.70.5-release.aar.sha256
│ │ ├── react-native-0.70.5-release.aar.sha512
│ │ ├── react-native-0.70.5.module
│ │ ├── react-native-0.70.5.module.md5
│ │ ├── react-native-0.70.5.module.sha1
│ │ ├── react-native-0.70.5.module.sha256
│ │ ├── react-native-0.70.5.module.sha512
│ │ ├── react-native-0.70.5.pom
│ │ ├── react-native-0.70.5.pom.md5
│ │ ├── react-native-0.70.5.pom.sha1
│ │ ├── react-native-0.70.5.pom.sha256
│ │ └── react-native-0.70.5.pom.sha512
│ │ ├── maven-metadata.xml
│ │ ├── maven-metadata.xml.md5
│ │ ├── maven-metadata.xml.sha1
│ │ ├── maven-metadata.xml.sha256
│ │ └── maven-metadata.xml.sha512
└── src
│ ├── main
│ ├── AndroidManifest.xml
│ └── java
│ │ └── com
│ │ └── mparticle
│ │ └── react
│ │ ├── MParticleModule.java
│ │ ├── MParticlePackage.java
│ │ └── Utils.java
│ └── test
│ └── java
│ └── com
│ └── mparticle
│ └── react
│ ├── IdentityApiTest.java
│ ├── MParticleUserTest.java
│ └── testutils
│ ├── MockMParticleUser.java
│ ├── MockMap.java
│ ├── MockReadableArray.java
│ ├── MockWritableMap.java
│ └── Mutable.java
├── ios
├── RNMParticle.xcodeproj
│ └── project.pbxproj
└── RNMParticle
│ ├── RNMParticle.h
│ └── RNMParticle.m
├── js
└── index.js
├── package.json
├── react-native-mparticle.podspec
├── release.sh
├── sample
├── .babelrc
├── .buckconfig
├── .flowconfig
├── .gitattributes
├── .gitignore
├── .watchmanconfig
├── __tests__
│ ├── index.android.js
│ └── index.ios.js
├── android
│ ├── app
│ │ ├── BUCK
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── mparticlesample
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── keystores
│ │ ├── BUCK
│ │ └── debug.keystore.properties
│ └── settings.gradle
├── build
├── index.android.js
├── index.ios.js
├── index.js
├── ios
│ ├── MParticleSample.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── MParticleSample.xcscheme
│ ├── MParticleSample
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.xib
│ │ ├── Images.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ └── main.m
│ ├── MParticleSampleTests
│ │ ├── Info.plist
│ │ └── MParticleSampleTests.m
│ └── Podfile
├── package.json
├── run-android
└── yarn.lock
└── yarn.lock
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Summary
2 | {provide a thorough description of the changes}
3 |
4 | ## Testing Plan
5 | {explain how this has been tested, and what additional testing should be done}
6 |
7 | ## Master Issue
8 | Closes https://go.mparticle.com/work/REPLACEME
9 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: gradle
4 | directory: "/android"
5 | schedule:
6 | interval: daily
7 | labels: ["dependabot"]
8 | open-pull-requests-limit: 10
9 | ignore:
10 | - dependency-name: "com.google.firebase:firebase-messaging"
11 | commit-message:
12 | prefix: "chore"
13 |
--------------------------------------------------------------------------------
/.github/workflows/daily.yml:
--------------------------------------------------------------------------------
1 | name: "Daily"
2 |
3 | on:
4 |
5 | schedule:
6 | - cron: "0 0 * * *"
7 |
8 | # Allow workflow to be manually run from the GitHub UI
9 | workflow_dispatch:
10 |
11 | jobs:
12 |
13 | # daily-job:
14 | # name: "Daily Common Repo Checks"
15 | # uses: mParticle/mparticle-workflows/.github/workflows/daily-cron.yml@main
16 |
17 | daily-local-job:
18 | name: "Daily Local Repo Checks"
19 | uses: mParticle/react-native-mparticle/.github/workflows/pull-request.yml@main
20 |
--------------------------------------------------------------------------------
/.github/workflows/dependabot-automerge.yml:
--------------------------------------------------------------------------------
1 | name: "Dependabot Automerge"
2 |
3 | on:
4 | workflow_run:
5 | workflows: ["Build and Test"]
6 | types:
7 | - completed
8 |
9 | jobs:
10 | automerge-dependabot:
11 | name: "Automerge Dependabot PR"
12 | uses: mParticle/mparticle-workflows/.github/workflows/dependabot-automerge.yml@main
13 |
--------------------------------------------------------------------------------
/.github/workflows/issue-autorespond-and-close.yml:
--------------------------------------------------------------------------------
1 | name: Auto respond and close issue
2 |
3 | on:
4 | issues:
5 | types:
6 | - opened
7 |
8 | jobs:
9 | auto-respond-and-close-issue:
10 | uses: mparticle/mparticle-workflows/.github/workflows/auto-respond-close-issue.yml@main
11 | with:
12 | issue_number: ${{ github.event.issue.number }}
13 | repository: ${{ github.repository }}
14 | user_login: ${{ github.event.issue.user.login }}
--------------------------------------------------------------------------------
/.github/workflows/pull-request.yml:
--------------------------------------------------------------------------------
1 | name: "Build and Test"
2 |
3 | on:
4 | pull_request:
5 | push:
6 | workflow_call:
7 | workflow_dispatch:
8 |
9 | jobs:
10 | js-tests:
11 | name: "JS Tests"
12 | runs-on: macOS-latest
13 | steps:
14 | - name: "Checkout"
15 | uses: actions/checkout@v4
16 | - uses: actions/setup-node@master
17 | - uses: c-hive/gha-yarn-cache@v2
18 |
19 | - name: "Install node modules"
20 | run: |
21 | yarn install
22 |
23 | - name: "Run test"
24 | run: |
25 | yarn test
26 |
27 | android-unit-tests:
28 | name: "Android Unit Tests"
29 | runs-on: ubuntu-latest
30 | steps:
31 | - name: "Checkout"
32 | uses: actions/checkout@v4
33 | - name: "Run Android Unit Tests"
34 | working-directory: android
35 | run: ./gradlew test
36 |
37 | android-lint:
38 | name: "Android Unit Tests"
39 | runs-on: ubuntu-latest
40 | steps:
41 | - name: "Checkout"
42 | uses: actions/checkout@v4
43 | - name: "Run Android Unit Tests"
44 | working-directory: android
45 | run: ./gradlew lint
46 |
47 | android-kotlin-lint:
48 | name: "Android Unit Tests"
49 | runs-on: ubuntu-latest
50 | steps:
51 | - name: "Checkout"
52 | uses: actions/checkout@v4
53 | - name: "Run Android Unit Tests"
54 | working-directory: android
55 | run: ./gradlew ktlintCheck
56 |
57 | automerge-dependabot:
58 | name: "Save PR Number for Dependabot Automerge"
59 | needs: [ js-tests, android-unit-tests, android-lint, android-kotlin-lint ]
60 | uses: mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main
61 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release SDK
2 |
3 | on:
4 | workflow_dispatch
5 |
6 | jobs:
7 | # SDK release is done from public/master branch.
8 | confirm-master-branch:
9 | name: Confirm release is run on public/master branch
10 | uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@main
11 |
12 | # All new code is stored in internal/development. Release from public/master will merge changes from internal/development into
13 | # public/master, then run semantic-release on public/master to update changelog and release notes. Before semantic-release publishes
14 | # to npm, it builds the dist/ folder. Finally, commits from public/master are synced back to internal/master and internal/development.
15 |
16 | react-tests:
17 | name: Run React Native Unit Tests
18 | runs-on: ubuntu-latest
19 | needs: ['confirm-master-branch']
20 | steps:
21 | - name: Checkout
22 | uses: actions/checkout@v3
23 | - uses: actions/setup-node@master
24 | - uses: c-hive/gha-yarn-cache@v2
25 |
26 | - name: Install node modules
27 | run: yarn install
28 |
29 | - name: Run test
30 | run: yarn test
31 |
32 | android-unit-tests:
33 | name: Run Android Unit Tests
34 | runs-on: ubuntu-latest
35 | needs: ['confirm-master-branch']
36 | steps:
37 | - name: Checkout
38 | uses: actions/checkout@v3
39 |
40 | - name: Run Android Unit Tests
41 | run: echo "pwd"; pwd; echo "ls:"; ls; cd android; ./gradlew test
42 |
43 | release-and-sync-repos:
44 | name: Release and Sync Repos
45 | runs-on: ubuntu-latest
46 | needs: ['android-unit-tests', 'react-tests']
47 | steps:
48 | - name: Checkout internal/development
49 | uses: actions/checkout@v3
50 |
51 | - name: Setup Node.js
52 | uses: actions/setup-node@v3
53 | with:
54 | node-version: 12.x
55 |
56 | - name: Install node modules
57 | run: yarn install
58 |
59 | - name: Release
60 | run: ./release.sh ${{ secrets.NPM_TOKEN}}
--------------------------------------------------------------------------------
/.github/workflows/sonarcloud.yml:
--------------------------------------------------------------------------------
1 | name: "SonarCloud"
2 |
3 | on:
4 | workflow_dispatch:
5 | workflow_run:
6 | workflows: ["Build and Test"]
7 | types:
8 | - completed
9 |
10 | jobs:
11 | sonarcloud-check:
12 | name: "SonarCloud Check"
13 | uses: mParticle/mparticle-workflows/.github/workflows/sonarcloud.yml@main
14 | secrets: inherit
15 | with:
16 | app_relative_path: "android"
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 | *.DS_Store
9 |
10 | ## Various settings
11 | *.pbxuser
12 | !default.pbxuser
13 | *.mode1v3
14 | !default.mode1v3
15 | *.mode2v3
16 | !default.mode2v3
17 | *.perspectivev3
18 | !default.perspectivev3
19 | xcuserdata/
20 |
21 | ## Other
22 | *.moved-aside
23 | *.xcuserstate
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 |
29 | ## Playgrounds
30 | timeline.xctimeline
31 | playground.xcworkspace
32 |
33 | # Swift Package Manager
34 | #
35 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
36 | # Packages/
37 | .build/
38 |
39 | # CocoaPods
40 | #
41 | # We recommend against adding the Pods directory to your .gitignore. However
42 | # you should judge for yourself, the pros and cons are mentioned at:
43 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
44 | #
45 | Pods/
46 |
47 | # Carthage
48 | #
49 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
50 | **/Carthage/Checkouts
51 |
52 | **/Carthage/Build
53 |
54 | # fastlane
55 | #
56 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
57 | # screenshots whenever they are needed.
58 | # For more information about the recommended setup visit:
59 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
60 |
61 | fastlane/report.xml
62 | fastlane/Preview.html
63 | fastlane/screenshots
64 | fastlane/test_output
65 |
66 | **/Podfile.lock
67 | **/*.xcworkspace
68 | Cartfile.resolved
69 | **/node_modules
70 | npm-debug.log
71 | # Intellij
72 | .idea/
73 | *.iml
74 | *.iws
75 |
76 | # Gradle
77 | build
78 | .gradle
79 | local.properties
80 | package-lock.json
81 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | sample
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2017 mParticle, Inc.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
15 |
16 | Apache License
17 | Version 2.0, January 2004
18 | http://www.apache.org/licenses/
19 |
20 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
21 |
22 | 1. Definitions.
23 |
24 | "License" shall mean the terms and conditions for use, reproduction,
25 | and distribution as defined by Sections 1 through 9 of this document.
26 |
27 | "Licensor" shall mean the copyright owner or entity authorized by
28 | the copyright owner that is granting the License.
29 |
30 | "Legal Entity" shall mean the union of the acting entity and all
31 | other entities that control, are controlled by, or are under common
32 | control with that entity. For the purposes of this definition,
33 | "control" means (i) the power, direct or indirect, to cause the
34 | direction or management of such entity, whether by contract or
35 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
36 | outstanding shares, or (iii) beneficial ownership of such entity.
37 |
38 | "You" (or "Your") shall mean an individual or Legal Entity
39 | exercising permissions granted by this License.
40 |
41 | "Source" form shall mean the preferred form for making modifications,
42 | including but not limited to software source code, documentation
43 | source, and configuration files.
44 |
45 | "Object" form shall mean any form resulting from mechanical
46 | transformation or translation of a Source form, including but
47 | not limited to compiled object code, generated documentation,
48 | and conversions to other media types.
49 |
50 | "Work" shall mean the work of authorship, whether in Source or
51 | Object form, made available under the License, as indicated by a
52 | copyright notice that is included in or attached to the work
53 | (an example is provided in the Appendix below).
54 |
55 | "Derivative Works" shall mean any work, whether in Source or Object
56 | form, that is based on (or derived from) the Work and for which the
57 | editorial revisions, annotations, elaborations, or other modifications
58 | represent, as a whole, an original work of authorship. For the purposes
59 | of this License, Derivative Works shall not include works that remain
60 | separable from, or merely link (or bind by name) to the interfaces of,
61 | the Work and Derivative Works thereof.
62 |
63 | "Contribution" shall mean any work of authorship, including
64 | the original version of the Work and any modifications or additions
65 | to that Work or Derivative Works thereof, that is intentionally
66 | submitted to Licensor for inclusion in the Work by the copyright owner
67 | or by an individual or Legal Entity authorized to submit on behalf of
68 | the copyright owner. For the purposes of this definition, "submitted"
69 | means any form of electronic, verbal, or written communication sent
70 | to the Licensor or its representatives, including but not limited to
71 | communication on electronic mailing lists, source code control systems,
72 | and issue tracking systems that are managed by, or on behalf of, the
73 | Licensor for the purpose of discussing and improving the Work, but
74 | excluding communication that is conspicuously marked or otherwise
75 | designated in writing by the copyright owner as "Not a Contribution."
76 |
77 | "Contributor" shall mean Licensor and any individual or Legal Entity
78 | on behalf of whom a Contribution has been received by Licensor and
79 | subsequently incorporated within the Work.
80 |
81 | 2. Grant of Copyright License. Subject to the terms and conditions of
82 | this License, each Contributor hereby grants to You a perpetual,
83 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
84 | copyright license to reproduce, prepare Derivative Works of,
85 | publicly display, publicly perform, sublicense, and distribute the
86 | Work and such Derivative Works in Source or Object form.
87 |
88 | 3. Grant of Patent License. Subject to the terms and conditions of
89 | this License, each Contributor hereby grants to You a perpetual,
90 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
91 | (except as stated in this section) patent license to make, have made,
92 | use, offer to sell, sell, import, and otherwise transfer the Work,
93 | where such license applies only to those patent claims licensable
94 | by such Contributor that are necessarily infringed by their
95 | Contribution(s) alone or by combination of their Contribution(s)
96 | with the Work to which such Contribution(s) was submitted. If You
97 | institute patent litigation against any entity (including a
98 | cross-claim or counterclaim in a lawsuit) alleging that the Work
99 | or a Contribution incorporated within the Work constitutes direct
100 | or contributory patent infringement, then any patent licenses
101 | granted to You under this License for that Work shall terminate
102 | as of the date such litigation is filed.
103 |
104 | 4. Redistribution. You may reproduce and distribute copies of the
105 | Work or Derivative Works thereof in any medium, with or without
106 | modifications, and in Source or Object form, provided that You
107 | meet the following conditions:
108 |
109 | (a) You must give any other recipients of the Work or
110 | Derivative Works a copy of this License; and
111 |
112 | (b) You must cause any modified files to carry prominent notices
113 | stating that You changed the files; and
114 |
115 | (c) You must retain, in the Source form of any Derivative Works
116 | that You distribute, all copyright, patent, trademark, and
117 | attribution notices from the Source form of the Work,
118 | excluding those notices that do not pertain to any part of
119 | the Derivative Works; and
120 |
121 | (d) If the Work includes a "NOTICE" text file as part of its
122 | distribution, then any Derivative Works that You distribute must
123 | include a readable copy of the attribution notices contained
124 | within such NOTICE file, excluding those notices that do not
125 | pertain to any part of the Derivative Works, in at least one
126 | of the following places: within a NOTICE text file distributed
127 | as part of the Derivative Works; within the Source form or
128 | documentation, if provided along with the Derivative Works; or,
129 | within a display generated by the Derivative Works, if and
130 | wherever such third-party notices normally appear. The contents
131 | of the NOTICE file are for informational purposes only and
132 | do not modify the License. You may add Your own attribution
133 | notices within Derivative Works that You distribute, alongside
134 | or as an addendum to the NOTICE text from the Work, provided
135 | that such additional attribution notices cannot be construed
136 | as modifying the License.
137 |
138 | You may add Your own copyright statement to Your modifications and
139 | may provide additional or different license terms and conditions
140 | for use, reproduction, or distribution of Your modifications, or
141 | for any such Derivative Works as a whole, provided Your use,
142 | reproduction, and distribution of the Work otherwise complies with
143 | the conditions stated in this License.
144 |
145 | 5. Submission of Contributions. Unless You explicitly state otherwise,
146 | any Contribution intentionally submitted for inclusion in the Work
147 | by You to the Licensor shall be under the terms and conditions of
148 | this License, without any additional terms or conditions.
149 | Notwithstanding the above, nothing herein shall supersede or modify
150 | the terms of any separate license agreement you may have executed
151 | with Licensor regarding such Contributions.
152 |
153 | 6. Trademarks. This License does not grant permission to use the trade
154 | names, trademarks, service marks, or product names of the Licensor,
155 | except as required for reasonable and customary use in describing the
156 | origin of the Work and reproducing the content of the NOTICE file.
157 |
158 | 7. Disclaimer of Warranty. Unless required by applicable law or
159 | agreed to in writing, Licensor provides the Work (and each
160 | Contributor provides its Contributions) on an "AS IS" BASIS,
161 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
162 | implied, including, without limitation, any warranties or conditions
163 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
164 | PARTICULAR PURPOSE. You are solely responsible for determining the
165 | appropriateness of using or redistributing the Work and assume any
166 | risks associated with Your exercise of permissions under this License.
167 |
168 | 8. Limitation of Liability. In no event and under no legal theory,
169 | whether in tort (including negligence), contract, or otherwise,
170 | unless required by applicable law (such as deliberate and grossly
171 | negligent acts) or agreed to in writing, shall any Contributor be
172 | liable to You for damages, including any direct, indirect, special,
173 | incidental, or consequential damages of any character arising as a
174 | result of this License or out of the use or inability to use the
175 | Work (including but not limited to damages for loss of goodwill,
176 | work stoppage, computer failure or malfunction, or any and all
177 | other commercial damages or losses), even if such Contributor
178 | has been advised of the possibility of such damages.
179 |
180 | 9. Accepting Warranty or Additional Liability. While redistributing
181 | the Work or Derivative Works thereof, You may choose to offer,
182 | and charge a fee for, acceptance of support, warranty, indemnity,
183 | or other liability obligations and/or rights consistent with this
184 | License. However, in accepting such obligations, You may act only
185 | on Your own behalf and on Your sole responsibility, not on behalf
186 | of any other Contributor, and only if You agree to indemnify,
187 | defend, and hold each Contributor harmless for any liability
188 | incurred by, or claims asserted against, such Contributor by reason
189 | of your accepting any such warranty or additional liability.
190 |
191 | END OF TERMS AND CONDITIONS
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-mparticle
2 |
3 | [](https://badge.fury.io/js/react-native-mparticle)
4 | [](http://standardjs.com/)
5 |
6 | React Native allows developers to use a single code base to deploy features to multiple platforms. With the mParticle React Native library, you can leverage a single API to deploy your data to hundreds of integrations from your iOS and Android apps.
7 |
8 | ### Supported Features
9 | | Method | Android | iOS |
10 | | --- | --- | --- |
11 | | Custom Events |
[X]
|
[X]
|
12 | | Page Views |
[X]
|
[X]
|
13 | | Identity |
[X]
|
[X]
|
14 | | eCommerce |
[X]
|
[X]
|
15 | | Consent |
[X]
|
[X]
|
16 |
17 | # Installation
18 |
19 | **Download and install the mParticle React Native library** from npm:
20 |
21 | ```bash
22 | $ npm install react-native-mparticle --save
23 | ```
24 |
25 | ## iOS
26 |
27 | 1. **Copy your mParticle key and secret** from [your app's dashboard][1].
28 |
29 | [1]: https://app.mparticle.com/setup/inputs/apps
30 |
31 | 2. **Install the SDK** using CocoaPods:
32 |
33 | The npm install step above will automatically include our react framework and the core iOS framework in your project. However depending on your app and its other dependecies you must integrate it in 1 of 3 ways
34 |
35 | A. Static Libraries are the React Native default but since mParticle iOS contains swift code you need to add an exception for it in the from of a pre-install command in the Podfile.
36 | ```bash
37 | pre_install do |installer|
38 | installer.pod_targets.each do |pod|
39 | if pod.name == 'mParticle-Apple-SDK'
40 | def pod.build_type;
41 | Pod::BuildType.new(:linkage => :dynamic, :packaging => :framework)
42 | end
43 | end
44 | end
45 | end
46 | ```
47 | Then run the following command
48 | ```
49 | bundle exec pod install
50 | ```
51 |
52 | B&C. Frameworks are the default for Swift development and while it isn't preferred by React Native it is supported. Additionally you can define whether the frameworks are built staticly or dynamically.
53 |
54 | Update your Podfile to be ready to use dynamically linked frameworks by commenting out the following line
55 | ```bash
56 | # :flipper_configuration => flipper_config,
57 | ```
58 | Then run either of the following commands
59 | ```
60 | $ USE_FRAMEWORKS=static bundle exec pod install
61 | ```
62 | or
63 | ```
64 | $ USE_FRAMEWORKS=dynamic bundle exec pod install
65 | ```
66 |
67 | 3. Import and start the mParticle Apple SDK into Swift or Objective-C.
68 |
69 | The mParticle SDK is initialized by calling the `startWithOptions` method within the `application:didFinishLaunchingWithOptions:` delegate call.
70 |
71 | Preferably the location of the initialization method call should be one of the last statements in the `application:didFinishLaunchingWithOptions:`.
72 |
73 | The `startWithOptions` method requires an options argument containing your key and secret and an initial Identity request.
74 |
75 | > Note that you must initialize the SDK in the `application:didFinishLaunchingWithOptions:` method. Other parts of the SDK rely on the `UIApplicationDidBecomeActiveNotification` notification to function properly. Failing to start the SDK as indicated will impair it. Also, please do **not** use _GCD_'s `dispatch_async` to start the SDK.
76 |
77 | For more help, see [the iOS set up docs](https://docs.mparticle.com/developers/sdk/ios/getting-started/#create-an-input).
78 |
79 | #### Swift Example
80 |
81 | ```swift
82 | import mParticle_Apple_SDK
83 |
84 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
85 |
86 | //override point for customization after application launch.
87 | let mParticleOptions = MParticleOptions(key: "<<>>", secret: "<<>>")
88 |
89 | //optional- Please see the Identity page for more information on building this object
90 | let request = MPIdentityApiRequest()
91 | request.email = "email@example.com"
92 | mParticleOptions.identifyRequest = request
93 | //optional
94 | mParticleOptions.onIdentifyComplete = { (apiResult, error) in
95 | NSLog("Identify complete. userId = %@ error = %@", apiResult?.user.userId.stringValue ?? "Null User ID", error?.localizedDescription ?? "No Error Available")
96 | }
97 | //optional
98 | mParticleOptions.onAttributionComplete = { (attributionResult, error) in
99 | NSLog(@"Attribution Complete. attributionResults = %@", attributionResult.linkInfo)
100 | }
101 | MParticle.sharedInstance().start(with: mParticleOptions)
102 | return true
103 | }
104 | ```
105 |
106 | #### Objective-C Example
107 |
108 | Your import statement should be this:
109 |
110 | ```objective-c
111 | #if defined(__has_include) && __has_include()
112 | #import
113 | #elif defined(__has_include) && __has_include()
114 | #import
115 | #else
116 | #import "mParticle.h"
117 | #endif
118 | ```
119 |
120 | Next, you'll need to start the SDK:
121 |
122 | ```objective-c
123 | - (BOOL)application:(UIApplication *)application
124 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
125 |
126 | MParticleOptions *mParticleOptions = [MParticleOptions optionsWithKey:@"REPLACE ME"
127 | secret:@"REPLACE ME"];
128 |
129 | //optional - Please see the Identity page for more information on building this object
130 | MPIdentityApiRequest *request = [MPIdentityApiRequest requestWithEmptyUser];
131 | request.email = @"email@example.com";
132 | mParticleOptions.identifyRequest = request;
133 | //optional
134 | mParticleOptions.onIdentifyComplete = ^(MPIdentityApiResult * _Nullable apiResult, NSError * _Nullable error) {
135 | NSLog(@"Identify complete. userId = %@ error = %@", apiResult.user.userId, error);
136 | };
137 | //optional
138 | mParticleOptions.onAttributionComplete(MPAttributionResult * _Nullable attributionResult, NSError * _Nullable error) {
139 | NSLog(@"Attribution Complete. attributionResults = %@", attributionResult.linkInfo)
140 | }
141 |
142 | [[MParticle sharedInstance] startWithOptions:mParticleOptions];
143 |
144 | return YES;
145 | }
146 | ```
147 |
148 | See [Identity](http://docs.mparticle.com/developers/sdk/ios/identity/) for more information on supplying an `MPIdentityApiRequest` object during SDK initialization.
149 |
150 | 4. Remember to start Metro with:
151 | ```bash
152 | $ npm start
153 | ```
154 | and build your workspace from xCode.
155 |
156 |
157 | ## Android
158 |
159 | 1. Copy your mParticle key and secret from [your workspace's dashboard](https://app.mparticle.com/setup/inputs/apps) and construct an `MParticleOptions` object.
160 |
161 | 2. Call `start` from the `onCreate` method of your app's `Application` class. It's crucial that the SDK be started here for proper session management. If you don't already have an `Application` class, create it and then specify its fully-qualified name in the `` tag of your app's `AndroidManifest.xml`.
162 |
163 | For more help, see [the Android set up docs](https://docs.mparticle.com/developers/sdk/android/getting-started/#create-an-input).
164 |
165 | ```kotlin
166 | package com.example.myapp;
167 |
168 | import android.app.Application;
169 | import com.mparticle.MParticle;
170 |
171 | class MyApplication : Application() {
172 | fun onCreate() {
173 | super.onCreate()
174 | val options: MParticleOptions = MParticleOptions.builder(this)
175 | .credentials("REPLACE ME WITH KEY", "REPLACE ME WITH SECRET")
176 | //optional
177 | .logLevel(MParticle.LogLevel.VERBOSE)
178 | //optional
179 | .identify(identifyRequest)
180 | //optional
181 | .identifyTask(
182 | BaseIdentityTask()
183 | .addFailureListener { errorResponse -> }
184 | .addSuccessListener{ result -> }
185 | )
186 | //optional
187 | .attributionListener(this)
188 | .build()
189 | MParticle.start(options)
190 | }
191 | }
192 | ```
193 |
194 | > **Warning:** Don't log events in your `Application.onCreate()`. Android may instantiate your `Application` class in the background without your knowledge, including when the user isn't using their device, and lead to unexpected results.
195 |
196 |
197 | # Usage
198 |
199 | ## Import the mParticle Module
200 |
201 | ```js
202 | import MParticle from 'react-native-mparticle'
203 | ```
204 |
205 | ## Logging Events
206 |
207 | To log basic events:
208 |
209 | ```js
210 | MParticle.logEvent('Test event', MParticle.EventType.Other, { 'Test key': 'Test value' })
211 | ```
212 |
213 | To log commerce events:
214 |
215 | ```js
216 | const product = new MParticle.Product('Test product for cart', '1234', 19.99)
217 | const transactionAttributes = new MParticle.TransactionAttributes('Test transaction id')
218 | const event = MParticle.CommerceEvent.createProductActionEvent(MParticle.ProductActionType.AddToCart, [product], transactionAttributes)
219 |
220 | MParticle.logCommerceEvent(event)
221 | ```
222 |
223 | ```js
224 | const promotion = new MParticle.Promotion('Test promotion id', 'Test promotion name', 'Test creative', 'Test position')
225 | const event = MParticle.CommerceEvent.createPromotionEvent(MParticle.PromotionActionType.View, [promotion])
226 |
227 | MParticle.logCommerceEvent(event)
228 | ```
229 |
230 | ```js
231 | const product = new MParticle.Product('Test product that was viewed', '5678', 29.99)
232 | const impression = new MParticle.Impression('Test impression list name', [product])
233 | const event = MParticle.CommerceEvent.createImpressionEvent([impression])
234 |
235 | MParticle.logCommerceEvent(event)
236 | ```
237 |
238 | To log screen events:
239 |
240 | ```js
241 | MParticle.logScreenEvent('Test screen', { 'Test key': 'Test value' })
242 | ```
243 |
244 | ## User
245 |
246 | To set, remove, and get user details, call the `User` or `Identity` methods as follows:
247 |
248 | ```js
249 | MParticle.User.setUserAttribute('User ID', 'Test key', 'Test value')
250 | ```
251 |
252 | ```js
253 | MParticle.User.setUserAttribute('User ID', MParticle.UserAttributeType.FirstName, 'Test first name')
254 | ```
255 |
256 | ```js
257 | MParticle.User.setUserAttributeArray('User ID', 'Test key', ['Test value 1', 'Test value 2'])
258 | ```
259 |
260 | ```js
261 | MParticle.User.setUserTag('User ID', 'Test value')
262 | ```
263 |
264 | ```js
265 | MParticle.User.removeUserAttribute('User ID', 'Test key')
266 | ```
267 |
268 | ```js
269 | MParticle.Identity.getUserIdentities((userIdentities) => {
270 | console.debug(userIdentities);
271 | });
272 | ```
273 |
274 | ## IdentityRequest
275 |
276 | ```js
277 | var request = new MParticle.IdentityRequest()
278 | ```
279 |
280 | **Setting** user identities:
281 |
282 | ```js
283 | var request = new MParticle.IdentityRequest();
284 | request.setUserIdentity('example@example.com', MParticle.UserIdentityType.Email);
285 | ```
286 |
287 | ## Identity
288 |
289 | ```js
290 | MParticle.Identity.getCurrentUser((currentUser) => {
291 | console.debug(currentUser.userID);
292 | });
293 | ```
294 |
295 | ```js
296 | var request = new MParticle.IdentityRequest();
297 |
298 | MParticle.Identity.identify(request, (error, userId) => {
299 | if (error) {
300 | console.debug(error); //error is an MParticleError
301 | } else {
302 | console.debug(userId);
303 | }
304 | });
305 | ```
306 |
307 | ```js
308 | var request = new MParticle.IdentityRequest();
309 | request.email = 'test email';
310 |
311 | MParticle.Identity.login(request, (error, userId) => {
312 | if (error) {
313 | console.debug(error); //error is an MParticleError
314 | } else {
315 | console.debug(userId);
316 | }
317 | });
318 | ```
319 |
320 | ```js
321 | var request = new MParticle.IdentityRequest();
322 |
323 | MParticle.Identity.logout(request, (error, userId) => {
324 | if (error) {
325 | console.debug(error);
326 | } else {
327 | console.debug(userId);
328 | }
329 | });
330 | ```
331 |
332 | ```js
333 | var request = new MParticle.IdentityRequest();
334 | request.email = 'test email 2';
335 |
336 | MParticle.Identity.modify(request, (error, userId) => {
337 | if (error) {
338 | console.debug(error); //error is an MParticleError
339 | } else {
340 | console.debug(userId);
341 | }
342 | });
343 | ```
344 |
345 | ## Attribution
346 | ```
347 | var attributions = MParticle.getAttributions();
348 | ```
349 |
350 | In order to listen for Attributions asynchronously, you need to set the proper field in `MParticleOptions` as shown in the [Android](#Android) or the [iOS](#iOS) SDK start examples.
351 |
352 | ## Kits
353 | Check if a kit is active
354 |
355 | ```
356 | var isKitActive = MParticle.isKitActive(kitId);
357 | ```
358 |
359 | Check and set the SDK's opt out status
360 |
361 | ```
362 | var isOptedOut = MParticle.getOptOut();
363 | MParticle.setOptOut(!isOptedOut);
364 | ```
365 |
366 | ## Push Registration
367 |
368 | The method `MParticle.logPushRegistration()` accepts 2 parameters. For Android, provide both the `pushToken` and `senderId`. For iOS, provide the push token in the first parameter, and simply pass `null` for the second parameter.
369 |
370 | ### Android
371 |
372 | ```
373 | MParticle.logPushRegistration(pushToken, senderId);
374 | ```
375 |
376 | ### iOS
377 |
378 | ```
379 | MParticle.logPushRegistration(pushToken, null);
380 | ```
381 |
382 | ## GDPR Consent
383 | Add a GDPRConsent
384 |
385 | ```
386 | var gdprConsent = GDPRConsent()
387 | .setConsented(true)
388 | .setDocument("the document")
389 | .setTimestamp(new Date().getTime()) // optional, native SDK will automatically set current timestamp if omitted
390 | .setLocation("the location")
391 | .setHardwareId("the hardwareId");
392 |
393 | MParticle.addGDPRConsentState(gdprConsent, "the purpose");
394 | ```
395 |
396 | Remove a GDPRConsent
397 | ```
398 | MParticle.removeGDPRConsentStateWithPurpose("the purpose");
399 | ```
400 |
401 | ## CCPA Consent
402 | Add a CCPAConsent
403 |
404 | ```
405 | var ccpaConsent = CCPAConsent()
406 | .setConsented(true)
407 | .setDocument("the document")
408 | .setTimestamp(new Date().getTime()) // optional, native SDK will automatically set current timestamp if omitted
409 | .setLocation("the location")
410 | .setHardwareId("the hardwareId");
411 |
412 | MParticle.addCCPAConsentState(ccpaConsent);
413 | ```
414 |
415 | Remove CCPAConsent
416 | ```
417 | MParticle.removeCCPAConsentState();
418 | ```
419 |
420 |
421 | # License
422 |
423 | Apache 2.0
424 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | google()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:7.4.2'
8 | }
9 | }
10 |
11 | plugins {
12 | id "org.sonarqube" version "4.4.1.3373"
13 | id "org.jlleitschuh.gradle.ktlint" version "11.6.1"
14 | }
15 |
16 | sonarqube {
17 | properties {
18 | property "sonar.projectKey", "react-native-mparticle"
19 | property "sonar.organization", "mparticle"
20 | property "sonar.host.url", "https://sonarcloud.io"
21 | }
22 | }
23 |
24 | apply plugin: 'org.jlleitschuh.gradle.ktlint'
25 | apply plugin: 'com.android.library'
26 |
27 | android {
28 | compileSdkVersion 33
29 |
30 | defaultConfig {
31 | minSdkVersion 21
32 | targetSdkVersion 33
33 | versionCode 2
34 | versionName "2.0.0"
35 | }
36 | buildTypes {
37 | release {
38 | minifyEnabled false
39 | }
40 | }
41 | adbOptions {
42 | timeOutInMs 10 * 60 * 1000
43 | installOptions "-d","-t"
44 | }
45 | }
46 |
47 | repositories {
48 | maven {
49 | //update periodically - current version: 0.70.5
50 | url "$rootDir/react-native-android"
51 | }
52 | mavenCentral()
53 | google()
54 |
55 | }
56 |
57 | dependencies {
58 | compileOnly 'com.facebook.react:react-native:0.20.1'
59 |
60 | //
61 | // In your app, you should include mParticle core like this:
62 | //
63 | // compile 'com.mparticle:android-core:REPLACEME'
64 | //
65 | // (See https://github.com/mparticle/mparticle-android-sdk for the latest version)
66 | //
67 | compileOnly 'com.mparticle:android-core:[5.9.3, )'
68 |
69 | //
70 | // And, if you want to include kits, you can do so as follows:
71 | //
72 | // compile 'com.mparticle:android-example-kit:REPLACEME'
73 | //
74 |
75 | testImplementation 'org.mockito:mockito-core:5.8.0'
76 | androidTestImplementation 'org.mockito:mockito-android:5.8.0'
77 | testImplementation 'androidx.annotation:annotation:1.7.1'
78 |
79 | testImplementation 'junit:junit:4.13.2'
80 | testImplementation files('libs/java-json.jar')
81 |
82 | testImplementation 'com.mparticle:android-core:5.55.0'
83 | testImplementation 'com.facebook.react:react-native:0.20.1'
84 | }
85 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 |
25 | # Automatically convert third-party libraries to use AndroidX
26 | android.enableJetifier=true
27 |
28 | # Version of flipper SDK to use with React Native
29 | FLIPPER_VERSION=0.125.0
30 |
31 | # Use this property to specify which architecture you want to build.
32 | # You can also override it from the CLI using
33 | # ./gradlew -PreactNativeArchitectures=x86_64
34 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
35 |
36 | # Use this property to enable support to the new architecture.
37 | # This will allow you to use TurboModules and the Fabric render in
38 | # your application. You should enable this flag either if you want
39 | # to write custom TurboModules/Fabric components OR use libraries that
40 | # are providing them.
41 | newArchEnabled=false
42 |
43 | # The hosted JavaScript engine
44 | # Supported values: expo.jsEngine = "hermes" | "jsc"
45 | expo.jsEngine=jsc
46 |
47 | # Enable GIF support in React Native images (~200 B increase)
48 | expo.gif.enabled=true
49 | # Enable webp support in React Native images (~85 KB increase)
50 | expo.webp.enabled=true
51 | # Enable animated webp support (~3.4 MB increase)
52 | # Disabled by default because iOS doesn't support animated webp
53 | expo.webp.animated=false
54 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Apr 03 15:57:13 EDT 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
7 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/android/libs/java-json.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/java-json.jar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.md5:
--------------------------------------------------------------------------------
1 | 7b864274b543d21ee7d7c9c8e7f7b043
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha1:
--------------------------------------------------------------------------------
1 | 75340c383a5d55a37d68181f12b1d8d939a3f065
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha256:
--------------------------------------------------------------------------------
1 | 1fe6791aeefb0391d319d763c655a6f8232676141b886d0a467b8834a0b86497
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha512:
--------------------------------------------------------------------------------
1 | b6d659b87a103dd21026d8715420d047b70e76219d39121795598811cff2c7bb6cf3a860d8836fe6eeb753f785d7c2f7b961ea48c5cba27626a6e1cb5b07ee62
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.md5:
--------------------------------------------------------------------------------
1 | 8f67048d84e52b2c37b14459567a5a9d
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha1:
--------------------------------------------------------------------------------
1 | f246204e16175a16e94ddab8556b5980c6241d14
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha256:
--------------------------------------------------------------------------------
1 | 98edd89a8c6b428921a71c83353b7c2ead7561ef78390d3d2f8bdec7ea0bccba
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha512:
--------------------------------------------------------------------------------
1 | ccbb56a7ba17357aa68c9ba685f118acae462481c186ba2e18a5dff3a779fb6cf1b6557965777282625b1fea8a82336ee3d6166d226ac494413770ade3369402
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.md5:
--------------------------------------------------------------------------------
1 | c8db891c3be1b407d7079c02c303243b
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha1:
--------------------------------------------------------------------------------
1 | 34cf662170d553da87ddd8ef2213f13212955d1d
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha256:
--------------------------------------------------------------------------------
1 | e622d9a7db5ba1a2161785ab8745dda58d1012aad04f7f9489fce207cf567f8a
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha512:
--------------------------------------------------------------------------------
1 | 205a0fd395d6d02c27c4611ae1ceca7ccb4f3554f17f44d338f9ffef2e3521e933616e74ac1b17bb7d300891ede5ecf58e966a11becda27f6760f862f2316783
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.md5:
--------------------------------------------------------------------------------
1 | 4eea565acfa26284caefb83ea547a27d
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha1:
--------------------------------------------------------------------------------
1 | 6d67ef0ee827fb500c5dae6e8de8497b7513b51f
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha256:
--------------------------------------------------------------------------------
1 | 3cf7d55a8e2a610cb293d91acc90881114df0150aea5bb19b2df78158c331134
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha512:
--------------------------------------------------------------------------------
1 | f114d26c0c757a2a333423738861dfcd225a790ba97a3a140e21cd131e9cf1c8cdc9e78372c735b6dc8f8ca004cf38e7b75b3c07afef5230fba7b57e71d332b3
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module:
--------------------------------------------------------------------------------
1 | {
2 | "formatVersion": "1.1",
3 | "component": {
4 | "group": "com.facebook.react",
5 | "module": "hermes-engine",
6 | "version": "0.70.5",
7 | "attributes": {
8 | "org.gradle.status": "release"
9 | }
10 | },
11 | "createdBy": {
12 | "gradle": {
13 | "version": "7.5.1"
14 | }
15 | },
16 | "variants": [
17 | {
18 | "name": "debugVariantDefaultApiPublication",
19 | "attributes": {
20 | "com.android.build.api.attributes.BuildTypeAttr": "debug",
21 | "org.gradle.category": "library",
22 | "org.gradle.dependency.bundling": "external",
23 | "org.gradle.libraryelements": "aar",
24 | "org.gradle.usage": "java-api"
25 | },
26 | "files": [
27 | {
28 | "name": "hermes-engine-0.70.5-debug.aar",
29 | "url": "hermes-engine-0.70.5-debug.aar",
30 | "size": 4033701,
31 | "sha512": "ccbb56a7ba17357aa68c9ba685f118acae462481c186ba2e18a5dff3a779fb6cf1b6557965777282625b1fea8a82336ee3d6166d226ac494413770ade3369402",
32 | "sha256": "98edd89a8c6b428921a71c83353b7c2ead7561ef78390d3d2f8bdec7ea0bccba",
33 | "sha1": "f246204e16175a16e94ddab8556b5980c6241d14",
34 | "md5": "8f67048d84e52b2c37b14459567a5a9d"
35 | }
36 | ]
37 | },
38 | {
39 | "name": "debugVariantDefaultRuntimePublication",
40 | "attributes": {
41 | "com.android.build.api.attributes.BuildTypeAttr": "debug",
42 | "org.gradle.category": "library",
43 | "org.gradle.dependency.bundling": "external",
44 | "org.gradle.libraryelements": "aar",
45 | "org.gradle.usage": "java-runtime"
46 | },
47 | "dependencies": [
48 | {
49 | "group": "com.facebook.fbjni",
50 | "module": "fbjni",
51 | "version": {
52 | "requires": "0.2.2"
53 | }
54 | },
55 | {
56 | "group": "com.facebook.soloader",
57 | "module": "soloader",
58 | "version": {
59 | "requires": "0.10.3"
60 | }
61 | },
62 | {
63 | "group": "com.facebook.yoga",
64 | "module": "proguard-annotations",
65 | "version": {
66 | "requires": "1.19.0"
67 | }
68 | },
69 | {
70 | "group": "androidx.annotation",
71 | "module": "annotation",
72 | "version": {
73 | "requires": "1.3.0"
74 | }
75 | }
76 | ],
77 | "files": [
78 | {
79 | "name": "hermes-engine-0.70.5-debug.aar",
80 | "url": "hermes-engine-0.70.5-debug.aar",
81 | "size": 4033701,
82 | "sha512": "ccbb56a7ba17357aa68c9ba685f118acae462481c186ba2e18a5dff3a779fb6cf1b6557965777282625b1fea8a82336ee3d6166d226ac494413770ade3369402",
83 | "sha256": "98edd89a8c6b428921a71c83353b7c2ead7561ef78390d3d2f8bdec7ea0bccba",
84 | "sha1": "f246204e16175a16e94ddab8556b5980c6241d14",
85 | "md5": "8f67048d84e52b2c37b14459567a5a9d"
86 | }
87 | ]
88 | },
89 | {
90 | "name": "debugVariantDefaultSourcePublication",
91 | "attributes": {
92 | "com.android.build.api.attributes.BuildTypeAttr": "debug",
93 | "org.gradle.category": "documentation",
94 | "org.gradle.dependency.bundling": "external",
95 | "org.gradle.docstype": "sources",
96 | "org.gradle.usage": "java-runtime"
97 | },
98 | "files": [
99 | {
100 | "name": "hermes-engine-0.70.5-debug-sources.jar",
101 | "url": "hermes-engine-0.70.5-debug-sources.jar",
102 | "size": 62707,
103 | "sha512": "b6d659b87a103dd21026d8715420d047b70e76219d39121795598811cff2c7bb6cf3a860d8836fe6eeb753f785d7c2f7b961ea48c5cba27626a6e1cb5b07ee62",
104 | "sha256": "1fe6791aeefb0391d319d763c655a6f8232676141b886d0a467b8834a0b86497",
105 | "sha1": "75340c383a5d55a37d68181f12b1d8d939a3f065",
106 | "md5": "7b864274b543d21ee7d7c9c8e7f7b043"
107 | }
108 | ]
109 | },
110 | {
111 | "name": "releaseVariantDefaultApiPublication",
112 | "attributes": {
113 | "com.android.build.api.attributes.BuildTypeAttr": "release",
114 | "org.gradle.category": "library",
115 | "org.gradle.dependency.bundling": "external",
116 | "org.gradle.libraryelements": "aar",
117 | "org.gradle.usage": "java-api"
118 | },
119 | "files": [
120 | {
121 | "name": "hermes-engine-0.70.5-release.aar",
122 | "url": "hermes-engine-0.70.5-release.aar",
123 | "size": 3458378,
124 | "sha512": "f114d26c0c757a2a333423738861dfcd225a790ba97a3a140e21cd131e9cf1c8cdc9e78372c735b6dc8f8ca004cf38e7b75b3c07afef5230fba7b57e71d332b3",
125 | "sha256": "3cf7d55a8e2a610cb293d91acc90881114df0150aea5bb19b2df78158c331134",
126 | "sha1": "6d67ef0ee827fb500c5dae6e8de8497b7513b51f",
127 | "md5": "4eea565acfa26284caefb83ea547a27d"
128 | }
129 | ]
130 | },
131 | {
132 | "name": "releaseVariantDefaultRuntimePublication",
133 | "attributes": {
134 | "com.android.build.api.attributes.BuildTypeAttr": "release",
135 | "org.gradle.category": "library",
136 | "org.gradle.dependency.bundling": "external",
137 | "org.gradle.libraryelements": "aar",
138 | "org.gradle.usage": "java-runtime"
139 | },
140 | "dependencies": [
141 | {
142 | "group": "com.facebook.fbjni",
143 | "module": "fbjni",
144 | "version": {
145 | "requires": "0.2.2"
146 | }
147 | },
148 | {
149 | "group": "com.facebook.soloader",
150 | "module": "soloader",
151 | "version": {
152 | "requires": "0.10.3"
153 | }
154 | },
155 | {
156 | "group": "com.facebook.yoga",
157 | "module": "proguard-annotations",
158 | "version": {
159 | "requires": "1.19.0"
160 | }
161 | },
162 | {
163 | "group": "androidx.annotation",
164 | "module": "annotation",
165 | "version": {
166 | "requires": "1.3.0"
167 | }
168 | }
169 | ],
170 | "files": [
171 | {
172 | "name": "hermes-engine-0.70.5-release.aar",
173 | "url": "hermes-engine-0.70.5-release.aar",
174 | "size": 3458378,
175 | "sha512": "f114d26c0c757a2a333423738861dfcd225a790ba97a3a140e21cd131e9cf1c8cdc9e78372c735b6dc8f8ca004cf38e7b75b3c07afef5230fba7b57e71d332b3",
176 | "sha256": "3cf7d55a8e2a610cb293d91acc90881114df0150aea5bb19b2df78158c331134",
177 | "sha1": "6d67ef0ee827fb500c5dae6e8de8497b7513b51f",
178 | "md5": "4eea565acfa26284caefb83ea547a27d"
179 | }
180 | ]
181 | },
182 | {
183 | "name": "releaseVariantDefaultSourcePublication",
184 | "attributes": {
185 | "com.android.build.api.attributes.BuildTypeAttr": "release",
186 | "org.gradle.category": "documentation",
187 | "org.gradle.dependency.bundling": "external",
188 | "org.gradle.docstype": "sources",
189 | "org.gradle.usage": "java-runtime"
190 | },
191 | "files": [
192 | {
193 | "name": "hermes-engine-0.70.5-release-sources.jar",
194 | "url": "hermes-engine-0.70.5-release-sources.jar",
195 | "size": 62694,
196 | "sha512": "205a0fd395d6d02c27c4611ae1ceca7ccb4f3554f17f44d338f9ffef2e3521e933616e74ac1b17bb7d300891ede5ecf58e966a11becda27f6760f862f2316783",
197 | "sha256": "e622d9a7db5ba1a2161785ab8745dda58d1012aad04f7f9489fce207cf567f8a",
198 | "sha1": "34cf662170d553da87ddd8ef2213f13212955d1d",
199 | "md5": "c8db891c3be1b407d7079c02c303243b"
200 | }
201 | ]
202 | }
203 | ]
204 | }
205 |
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.md5:
--------------------------------------------------------------------------------
1 | 4ff83d5a836dec90593a9de87e02b66f
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha1:
--------------------------------------------------------------------------------
1 | b5236e1fc7e7d9e5ddf5219e8a6bb08a0237d9da
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha256:
--------------------------------------------------------------------------------
1 | 4e27316d4f981093d6f73885dcdc5e64dc23a18ad892d68cf7b7fc22cdfc598d
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha512:
--------------------------------------------------------------------------------
1 | 8b5d314a29a4a5d578a43a7a5b8243736247084af2e36eb4830050fd29103ed930a3a6f8d1dfa68f3be226891f14d2e56e8122a4fef9c28464cbbcd1e52a6204
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 | 4.0.0
10 | com.facebook.react
11 | hermes-engine
12 | 0.70.5
13 | pom
14 |
15 |
16 | com.facebook.fbjni
17 | fbjni
18 | 0.2.2
19 | compile
20 | true
21 |
22 |
23 | com.facebook.soloader
24 | soloader
25 | 0.10.3
26 | compile
27 | true
28 |
29 |
30 | com.facebook.yoga
31 | proguard-annotations
32 | 1.19.0
33 | compile
34 | true
35 |
36 |
37 | androidx.annotation
38 | annotation
39 | 1.3.0
40 | compile
41 | true
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.md5:
--------------------------------------------------------------------------------
1 | 9182f5e678c542dba36f6bc0168d49a9
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha1:
--------------------------------------------------------------------------------
1 | 6a6ff8f12beb194ef2fb27de7c4594bfed44088b
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha256:
--------------------------------------------------------------------------------
1 | 7ddd030c89cc685a0061c3ec5340140161fd1fab1df7859699b23ad64a4fbd6f
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha512:
--------------------------------------------------------------------------------
1 | 0bf0740d048ee97daaa8771e6a8ca340a59b68e2d4c0f5e9feeb090b87a059c2ecfc993592d26c409a2fb5ea28c839846ea5567c7abde8b5e285e3c742ee1987
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.facebook.react
4 | hermes-engine
5 |
6 | 0.70.5
7 | 0.70.5
8 |
9 | 0.70.5
10 |
11 | 20221106211107
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.md5:
--------------------------------------------------------------------------------
1 | d696a517f905ef03db049e3498bed1d8
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha1:
--------------------------------------------------------------------------------
1 | 62474f1140166dd5b0cdb3a0433691fd413f6cc7
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha256:
--------------------------------------------------------------------------------
1 | 3e3e01b6b286761657f01a1a0b92386e2532badb0ceca6d54a29dfc032a00bfd
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha512:
--------------------------------------------------------------------------------
1 | fbaf046e2812062b9c153695d7fd934b64959de73b084611b938c80e77e9b5df91aab55de42920103f564ba9b66423ac5ab74516f7a69355a7b4a6cbd360fc53
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.md5:
--------------------------------------------------------------------------------
1 | 74d86431fd9bc24b8769b1dcff698814
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha1:
--------------------------------------------------------------------------------
1 | c64ee18787feb457f9a4f3ffc888b0f312afe16c
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha256:
--------------------------------------------------------------------------------
1 | 947f3bb8fe00e0d72d10eb3fe1bd00c181ee366fdf28fcd6e35794575faa1fb1
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha512:
--------------------------------------------------------------------------------
1 | 1cabc724dd44d1266c637d9db0a41e1d0d03d7b333770b173c7724bd56a318e43947bf1bd5f83734c4afdf5f695749bbb8e77c4df2268974cc23d8a7b399d179
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.md5:
--------------------------------------------------------------------------------
1 | 8b6106b2cab596fdcdf1de5b495419dd
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha1:
--------------------------------------------------------------------------------
1 | 650825ef196f2045dfe93cf7eff46ed6a9cb851e
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha256:
--------------------------------------------------------------------------------
1 | e9f11e2e7c0e95bdc8443566d9ba6cec9b9613ee09426832f38050edcf65b828
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha512:
--------------------------------------------------------------------------------
1 | a75e86a070303e119cc4875d194740bc99a70dc4c538e994fe68fd7320a47d91c1c7094bccb923e36c51231e8ce6b8d0b2665a3e9aad246a63ca073decce4a68
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.md5:
--------------------------------------------------------------------------------
1 | b4c3cdc59566abc5ea37bd6311ce818c
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha1:
--------------------------------------------------------------------------------
1 | 3fe922c099cf22070fb5131914012269c68337e6
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha256:
--------------------------------------------------------------------------------
1 | 19a94e1af4190b32e8ed0a463a7deeccfb4785a03cde91b88efafee0931f9c80
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha512:
--------------------------------------------------------------------------------
1 | 253ca7b3b2b6953681ce77d43c2c75bbb6f4f6699e5fba3f2fdb657fd6e12ff578bc7ba8fa27945a017354daf2ef28f6bfaf22e87d68d34625b05c57d1999368
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mParticle/react-native-mparticle/a09018ce0eb1d2b9c9404549d2f3b7eb8fbc2e14/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.md5:
--------------------------------------------------------------------------------
1 | 50b3e7bf5bfc3acab1e9f498f988d3f0
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha1:
--------------------------------------------------------------------------------
1 | 00c9f58ad16f8e6f11bc75ad826bf4e805f6ac69
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha256:
--------------------------------------------------------------------------------
1 | 591fab93fa3ff09b66748007dd4bcd4ae5f9da14bbf5ab5d6109cb1a29f9c918
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha512:
--------------------------------------------------------------------------------
1 | 28f0e88dcd49bd32c355f11822fe299b81d88c69f9eb2f650ee933c09aa4a88364024b44e0237821a429dc1d7af4db46d4205a86755343bef91aa163b3e5c385
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.md5:
--------------------------------------------------------------------------------
1 | c0dfc07b0961a25ba9ceb2b494f46bb6
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha1:
--------------------------------------------------------------------------------
1 | 80f317430557db0de3088903d62818e3e3f9b90c
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha256:
--------------------------------------------------------------------------------
1 | a99732a86b4bc51cd3e2c1d87a16bec11f45ee151c264b2873b803a571caef1e
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha512:
--------------------------------------------------------------------------------
1 | cd3ab73cec4f59e339a1f3f08a35a89e7a28bfee744e53b8eefbef873dbf96a075d46bb0de4142a0ffddfdaf4d1f139afd5108d39521fe28cd95e21068bbaf10
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 | 4.0.0
10 | com.facebook.react
11 | react-native
12 | 0.70.5
13 | pom
14 | ReactNative
15 | A framework for building native apps with React
16 | https://github.com/facebook/react-native
17 |
18 |
19 | MIT License
20 | https://github.com/facebook/react-native/blob/HEAD/LICENSE
21 | repo
22 |
23 |
24 |
25 |
26 | facebook
27 | Facebook
28 |
29 |
30 |
31 | scm:git:https://github.com/facebook/react-native.git
32 | scm:git:git@github.com:facebook/react-native.git
33 | https://github.com/facebook/react-native.git
34 |
35 |
36 |
37 | androidx.appcompat
38 | appcompat-resources
39 | 1.4.1
40 | compile
41 | true
42 |
43 |
44 | androidx.appcompat
45 | appcompat
46 | 1.4.1
47 | compile
48 | true
49 |
50 |
51 | androidx.autofill
52 | autofill
53 | 1.1.0
54 | compile
55 | true
56 |
57 |
58 | androidx.swiperefreshlayout
59 | swiperefreshlayout
60 | 1.0.0
61 | compile
62 | true
63 |
64 |
65 | com.facebook.fbjni
66 | fbjni-java-only
67 | 0.2.2
68 | compile
69 | true
70 |
71 |
72 | com.facebook.fresco
73 | fresco
74 | 2.5.0
75 | compile
76 | true
77 |
78 |
79 | com.facebook.fresco
80 | imagepipeline-okhttp3
81 | 2.5.0
82 | compile
83 | true
84 |
85 |
86 | com.facebook.fresco
87 | ui-common
88 | 2.5.0
89 | compile
90 | true
91 |
92 |
93 | com.facebook.infer.annotation
94 | infer-annotation
95 | 0.18.0
96 | compile
97 | true
98 |
99 |
100 | com.facebook.soloader
101 | soloader
102 | 0.10.4
103 | compile
104 | true
105 |
106 |
107 | com.facebook.yoga
108 | proguard-annotations
109 | 1.19.0
110 | compile
111 | true
112 |
113 |
114 | com.google.code.findbugs
115 | jsr305
116 | 3.0.2
117 | compile
118 | true
119 |
120 |
121 | com.squareup.okhttp3
122 | okhttp-urlconnection
123 | 4.9.2
124 | compile
125 | true
126 |
127 |
128 | com.squareup.okhttp3
129 | okhttp
130 | 4.9.2
131 | compile
132 | true
133 |
134 |
135 | com.squareup.okio
136 | okio
137 | 2.9.0
138 | compile
139 | true
140 |
141 |
142 | javax.inject
143 | javax.inject
144 | 1
145 | compile
146 | true
147 |
148 |
149 | org.jetbrains.kotlin
150 | kotlin-stdlib-jdk8
151 | 1.6.10
152 | compile
153 | true
154 |
155 |
156 |
157 |
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.md5:
--------------------------------------------------------------------------------
1 | 314aca710fcde34076ae5994d7f9b97e
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha1:
--------------------------------------------------------------------------------
1 | 6a163a1b47caaf40d6e1073ea5c7e12985e5039a
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha256:
--------------------------------------------------------------------------------
1 | 801b36c31a6e9a37096d594bd2ab459c2506d6a25c8417e912a29af7b7d6507e
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha512:
--------------------------------------------------------------------------------
1 | 2b7a31bf8d9b01bc8185de8a018e469e5eea59c311e4a1cd531004b016d2218ff0c683f1c4ad904d28248fa3b58d0c54384f9b19dfedb68e82ce3d226fa10b70
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.facebook.react
4 | react-native
5 |
6 | 0.70.5
7 | 0.70.5
8 |
9 | 0.70.5
10 |
11 | 20221106211052
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.md5:
--------------------------------------------------------------------------------
1 | 2fd397e2d08ed150f66851e1e34dd67e
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha1:
--------------------------------------------------------------------------------
1 | d4efb834e0463c9149216b52f559ffbb81710ece
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha256:
--------------------------------------------------------------------------------
1 | e3a583f456c35a1bd17a05d4627fec2fa5c7d80ea095f5d6d24c13b98b341453
--------------------------------------------------------------------------------
/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha512:
--------------------------------------------------------------------------------
1 | 4b9cfbc4aed81b138b7942f7488f450c4475d60f0d352f9e67b54e38879873e7f78ee744835d46be66ba32925244d4916add618897b45180381fb95bb8082cd6
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/android/src/main/java/com/mparticle/react/MParticlePackage.java:
--------------------------------------------------------------------------------
1 | package com.mparticle.react;
2 |
3 | import com.facebook.react.ReactPackage;
4 | import com.facebook.react.bridge.JavaScriptModule;
5 | import com.facebook.react.bridge.NativeModule;
6 | import com.facebook.react.bridge.ReactApplicationContext;
7 | import com.facebook.react.uimanager.ViewManager;
8 |
9 | import java.util.ArrayList;
10 | import java.util.Collections;
11 | import java.util.List;
12 |
13 | public class MParticlePackage implements ReactPackage {
14 | @Override
15 | public List createNativeModules(
16 | ReactApplicationContext reactContext) {
17 | List modules = new ArrayList<>();
18 |
19 | modules.add(new MParticleModule(reactContext));
20 |
21 | return modules;
22 | }
23 |
24 | // Deprecated RN 0.47
25 | public List> createJSModules() {
26 | return Collections.emptyList();
27 | }
28 |
29 | @Override
30 | public List createViewManagers(
31 | ReactApplicationContext reactContext) {
32 | return Collections.emptyList();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/android/src/main/java/com/mparticle/react/Utils.java:
--------------------------------------------------------------------------------
1 | package com.mparticle.react;
2 |
3 | import com.facebook.react.bridge.ReadableMap;
4 |
5 | public class Utils {
6 |
7 | public static long parseMpid(String longString) {
8 | try {
9 | return Long.parseLong(longString);
10 | } catch (NumberFormatException ex) {
11 | return 0L;
12 | }
13 | }
14 |
15 | public static Long getLong(ReadableMap readableMap, String key, boolean allowLossy) {
16 | switch (readableMap.getType(key)) {
17 | case String:
18 | return Long.valueOf(readableMap.getString(key));
19 | case Number:
20 | if (allowLossy) {
21 | try {
22 | return Integer.valueOf(readableMap.getInt(key)).longValue();
23 | } catch (Exception ex) {
24 | return Double.valueOf(readableMap.getDouble(key)).longValue();
25 | }
26 | }
27 | break;
28 | case Null:
29 | return null;
30 | }
31 | throw new NumberFormatException("Expecting " + (allowLossy ? " Number or " : "") + "String representation of a Long. Received " + readableMap.getType(key));
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/android/src/test/java/com/mparticle/react/IdentityApiTest.java:
--------------------------------------------------------------------------------
1 | package com.mparticle.react;
2 |
3 | import androidx.annotation.NonNull;
4 |
5 | import com.facebook.react.bridge.Callback;
6 | import com.facebook.react.bridge.ReactApplicationContext;
7 | import com.facebook.react.bridge.ReadableMap;
8 | import com.mparticle.MParticle;
9 | import com.mparticle.identity.AliasRequest;
10 | import com.mparticle.identity.IdentityApi;
11 | import com.mparticle.identity.MParticleUser;
12 | import com.mparticle.react.testutils.MockMParticleUser;
13 | import com.mparticle.react.testutils.MockMap;
14 | import com.mparticle.react.testutils.Mutable;
15 |
16 | import org.json.JSONException;
17 | import org.json.JSONObject;
18 | import org.junit.Before;
19 | import org.junit.Test;
20 | import org.junit.runner.RunWith;
21 | import org.mockito.ArgumentCaptor;
22 | import org.mockito.Mockito;
23 | import org.mockito.MockitoAnnotations;
24 | import org.mockito.junit.MockitoJUnitRunner;
25 |
26 | import java.util.Random;
27 |
28 | import static junit.framework.TestCase.assertEquals;
29 | import static org.junit.Assert.assertNull;
30 | import static org.junit.Assert.assertTrue;
31 |
32 | @RunWith(MockitoJUnitRunner.class)
33 | public class IdentityApiTest {
34 | MParticleModule identityApi;
35 | Random random = new Random();
36 |
37 | @Before
38 | public void before() {
39 | MockitoAnnotations.openMocks(this);
40 | MParticle.setInstance(Mockito.mock(MParticle.class));
41 | Mockito.when(MParticle.getInstance().Identity()).thenReturn(Mockito.mock(IdentityApi.class));
42 | Mockito.lenient().when(MParticle.getInstance().Identity().getUser(0L)).thenReturn(null);
43 | identityApi = new MParticleModule(Mockito.mock(ReactApplicationContext.class));
44 | }
45 |
46 |
47 | @Test
48 | public void testGetCurrentUser() {
49 | final Mutable callbackCalled = new Mutable<>(false);
50 | final Long mockId = random.nextLong();
51 |
52 | MParticleUser mockUser = new MockMParticleUser() {
53 | @NonNull
54 | @Override
55 | public long getId() {
56 | return mockId;
57 | }
58 | };
59 | Mockito.when(MParticle.getInstance().Identity().getCurrentUser()).thenReturn(mockUser);
60 | identityApi.getCurrentUserWithCompletion(new Callback() {
61 | @Override
62 | public void invoke(Object... args) {
63 | assertNull(args[0]);
64 | assertEquals(mockId.toString(), args[1]);
65 | callbackCalled.value = true;
66 | }
67 | });
68 |
69 | assertTrue(callbackCalled.value);
70 | callbackCalled.value = false;
71 |
72 | Mockito.when(MParticle.getInstance().Identity().getCurrentUser()).thenReturn(null);
73 | identityApi.getCurrentUserWithCompletion(new Callback() {
74 | @Override
75 | public void invoke(Object... args) {
76 | assertNull(args[0]);
77 | assertNull(args[1]);
78 | callbackCalled.value = true;
79 | }
80 | });
81 | assertTrue(callbackCalled.value);
82 | }
83 |
84 |
85 | @Test
86 | public void testAliasRequest() throws JSONException {
87 | ArgumentCaptor aliasCaptor = ArgumentCaptor.forClass(AliasRequest.class);
88 | final Mutable