├── .babelrc ├── .circleci └── config.yml ├── .editorconfig ├── .flowconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── npm-manual-publish.yml │ └── npm-publish.yml ├── .gitignore ├── .npmignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── RCTACPAnalytics.podspec ├── README.md ├── __tests__ └── ACPAnalyticsTests.js ├── android ├── README.md ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── adobe │ └── marketing │ └── mobile │ └── reactnative │ └── analytics │ ├── RCTACPAnalyticsModule.java │ └── RCTACPAnalyticsPackage.java ├── flow-typed ├── npm-custom │ └── react-native.js └── npm │ ├── babel-cli_vx.x.x.js │ ├── babel-eslint_vx.x.x.js │ ├── babel-plugin-module-resolver_vx.x.x.js │ ├── babel-preset-flow_vx.x.x.js │ ├── babel-preset-react-native_vx.x.x.js │ ├── eslint-config-airbnb_vx.x.x.js │ ├── eslint-config-prettier_vx.x.x.js │ ├── eslint-import-resolver-babel-module_vx.x.x.js │ ├── eslint-plugin-flowtype_vx.x.x.js │ ├── eslint-plugin-import_vx.x.x.js │ ├── eslint-plugin-jsx-a11y_vx.x.x.js │ ├── eslint-plugin-react-native_vx.x.x.js │ ├── eslint-plugin-react_vx.x.x.js │ ├── eslint_vx.x.x.js │ ├── flow-bin_v0.x.x.js │ ├── flow-typed_vx.x.x.js │ └── react-native_vx.x.x.js ├── ios ├── Gemfile ├── Gemfile.lock ├── Podfile ├── Podfile.lock ├── RCTACPAnalytics.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── RCTACPAnalytics.xcscheme ├── README.md └── src │ ├── RCTACPAnalytics.h │ └── RCTACPAnalytics.m ├── jest └── setup.js ├── js ├── ACPAnalytics.js └── index.js ├── package-lock.json ├── package.json └── sample ├── ACPAnalyticsSampleApp ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── Makefile ├── README.md ├── __tests__ │ └── App-test.js ├── _editorconfig ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── acpanalyticssampleapp │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── acpanalyticssampleapp │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── ACPAnalyticsSampleApp.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── ACPAnalyticsSampleApp.xcscheme │ ├── ACPAnalyticsSampleApp.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── ACPAnalyticsSampleApp │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ ├── ACPAnalyticsSampleAppTests │ │ ├── ACPAnalyticsSampleAppTests.m │ │ └── Info.plist │ ├── Podfile │ └── Podfile.lock ├── metro.config.js ├── package-lock.json └── package.json └── ACPAnalyticsTVapp ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── Makefile ├── README.md ├── __tests__ └── App-test.js ├── _editorconfig ├── android ├── app │ ├── _BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── debug.keystore │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── acpanalyticstvapp │ │ │ └── ReactNativeFlipper.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── acpanalyticstvapp │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios ├── ACPAnalyticsTVapp-tvOS │ └── Info.plist ├── ACPAnalyticsTVapp-tvOSTests │ └── Info.plist ├── ACPAnalyticsTVapp.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── ACPAnalyticsTVapp-tvOS.xcscheme │ │ └── ACPAnalyticsTVapp.xcscheme ├── ACPAnalyticsTVapp.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── ACPAnalyticsTVapp │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ ├── LaunchScreen.storyboard │ └── main.m ├── ACPAnalyticsTVappTests │ ├── ACPAnalyticsTVappTests.m │ └── Info.plist ├── Podfile └── Podfile.lock ├── metro.config.js ├── package-lock.json └── package.json /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-flow", "react-native"], 3 | "plugins": [ 4 | ["module-resolver", { 5 | "root": [ "./js/" ] 6 | }] 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build-android: 4 | docker: 5 | - image: circleci/android:api-28 6 | steps: 7 | - checkout 8 | 9 | - run: 10 | name: Building Android Project 11 | command: make build-android 12 | 13 | build-ios: 14 | macos: 15 | xcode: "13.4.0" 16 | 17 | steps: 18 | - checkout 19 | 20 | - run: npm install 21 | 22 | # restore pods related caches 23 | - restore_cache: 24 | keys: 25 | - 1-gems-{{ checksum "ios/Gemfile.lock" }} 26 | 27 | # make sure we're on the right version of cocoapods 28 | - run: 29 | name: Install latest Cocoapods 30 | command: sudo gem install cocoapods 31 | 32 | - run: 33 | name: Verify Cocoapods Version 34 | command: cd ios && bundle check || bundle install --path vendor/bundle 35 | 36 | # save cocoapods version gem data 37 | - save_cache: 38 | key: 1-gems-{{ checksum "ios/Gemfile.lock" }} 39 | paths: 40 | - vendor/bundle 41 | 42 | - run: mkdir ~/.cocoapods/repos && cd ~/.cocoapods/repos && git clone --depth 1 https://github.com/CocoaPods/Specs.git master 43 | 44 | - run: 45 | name: Building iOS Project 46 | command: make build-ios 47 | 48 | unit-test: 49 | macos: 50 | xcode: "13.4.0" 51 | 52 | steps: 53 | - checkout 54 | 55 | - run: npm install 56 | - run: npm install jest@24.8.0 -g 57 | 58 | - run: 59 | name: Unit Tests 60 | command: make run-tests 61 | 62 | 63 | build-sample-app-android: 64 | docker: 65 | - image: circleci/android:api-28-node 66 | steps: 67 | - checkout 68 | 69 | - run: 70 | name: Install react-native-cli 71 | command: sudo npm install -g react-native-cli 72 | 73 | - run: 74 | name: Copy changes into sample app 75 | command: make copy-to-sample 76 | 77 | - run: 78 | name: Building Android Sample App 79 | command: | 80 | export NODE_OPTIONS=--max-old-space-size=8192 81 | make build-sample-android 82 | 83 | build-sample-app-ios: 84 | macos: 85 | xcode: "13.4.0" 86 | 87 | steps: 88 | - checkout 89 | 90 | - run: 91 | name: Install react-native-cli 92 | command: npm install -g react-native-cli 93 | 94 | - run: 95 | name: Install latest Cocoapods 96 | command: sudo gem install cocoapods 97 | 98 | - run: 99 | name: Copy changes into sample app 100 | command: make copy-to-sample 101 | 102 | - run: 103 | name: Building iOS Sample App 104 | command: make build-sample-ios 105 | 106 | workflows: 107 | version: 2 108 | ci-workflow: 109 | jobs: 110 | # - build-android 111 | - build-ios 112 | - unit-test 113 | - build-sample-app-android 114 | - build-sample-app-ios 115 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore templates for 'react-native init' 12 | /node_modules/react-native/local-cli/.* 13 | 14 | ; Ignore polyfills 15 | /node_modules/react-native/Libraries/polyfills/.* 16 | 17 | ; Ignore various node_modules 18 | /node_modules/metro/.* 19 | 20 | ; Ignore RN jest 21 | /node_modules/react-native/.* 22 | 23 | ; Ignore Example 24 | /sample/* 25 | 26 | 27 | [include] 28 | /node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes 29 | 30 | [libs] 31 | node_modules/react-native/Libraries/react-native/react-native-interface.js 32 | node_modules/react-native/flow 33 | flow-typed/ 34 | 35 | [options] 36 | module.system=haste 37 | 38 | emoji=true 39 | 40 | munge_underscores=true 41 | 42 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 43 | 44 | module.system.node.resolve_dirname=node_modules 45 | module.system.node.resolve_dirname=./src/ 46 | 47 | module.file_ext=.js 48 | module.file_ext=.jsx 49 | module.file_ext=.json 50 | module.file_ext=.native.js 51 | 52 | suppress_type=$FlowIssue 53 | suppress_type=$FlowFixMe 54 | suppress_type=$FixMe 55 | 56 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 57 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 58 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 59 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 60 | 61 | esproposal.decorators=ignore 62 | 63 | module.name_mapper.extension='png' -> 'emptyObject' 64 | module.name_mapper='^react-navigation$' -> 'emptyObject' 65 | 66 | ; https://github.com/facebook/react-native/issues/14927 67 | module.name_mapper='^./link/link$' -> 'emptyObject' 68 | 69 | [version] 70 | 0.92.0 71 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ### Expected Behaviour 5 | 6 | ### Actual Behaviour 7 | 8 | ### Reproduce Scenario (including but not limited to) 9 | 10 | #### Steps to Reproduce 11 | 12 | #### Platform and Version 13 | 14 | #### Sample Code that illustrates the problem 15 | 16 | #### Logs taken while reproducing problem 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | 7 | ## Related Issue 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## Motivation and Context 15 | 16 | 17 | 18 | ## How Has This Been Tested? 19 | 20 | 21 | 22 | 23 | 24 | ## Screenshots (if appropriate): 25 | 26 | ## Types of changes 27 | 28 | 29 | 30 | - [ ] Bug fix (non-breaking change which fixes an issue) 31 | - [ ] New feature (non-breaking change which adds functionality) 32 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 33 | 34 | ## Checklist: 35 | 36 | 37 | 38 | 39 | - [ ] I have signed the [Adobe Open Source CLA](http://opensource.adobe.com/cla.html). 40 | - [ ] My code follows the code style of this project. 41 | - [ ] My change requires a change to the documentation. 42 | - [ ] I have updated the documentation accordingly. 43 | - [ ] I have read the **CONTRIBUTING** document. 44 | - [ ] I have added tests to cover my changes. 45 | - [ ] All new and existing tests passed. 46 | -------------------------------------------------------------------------------- /.github/workflows/npm-manual-publish.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow that is manually triggered 2 | 3 | name: npm-manual-publish 4 | 5 | # Controls when the action will run. Workflow runs when manually triggered using the UI 6 | # or API. 7 | on: 8 | workflow_dispatch: 9 | jobs: 10 | publish-latest: 11 | name: publish-latest 12 | runs-on: ubuntu-18.04 13 | steps: 14 | - name: checkout 15 | uses: actions/checkout@v2 16 | with: 17 | fetch-depth: 0 18 | ref: ${{ github.ref }} 19 | - name: node 20 | uses: actions/setup-node@v2 21 | with: 22 | node-version: 14 23 | registry-url: https://registry.npmjs.org/ 24 | - name: publish 25 | run: npm publish --access public 26 | env: 27 | NODE_AUTH_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} 28 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | name: npm-publish 2 | on: 3 | push: 4 | branches: 5 | - main 6 | jobs: 7 | npm-publish: 8 | name: npm-publish 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout repository 12 | uses: actions/checkout@main 13 | - name: Set up Node.js 14 | uses: actions/setup-node@main 15 | with: 16 | node-version: 10.0.0 17 | - name: Publish if version has been updated 18 | uses: mkiki/npm-publish-action@c4315ef5790b7bcec2cbb75b34e37681a409d78d 19 | with: 20 | tag_name: "v%s" 21 | tag_message: "v%s" 22 | commit_pattern: "^Release (\\S+)" 23 | workspace: "." 24 | env: 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | NPM_AUTH_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} 27 | NPM_AUTH: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # OSX 3 | # 4 | .DS_Store 5 | 6 | # node.js 7 | # 8 | node_modules/ 9 | npm-debug.log 10 | yarn-error.log 11 | 12 | 13 | # Xcode 14 | # 15 | build/ 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | xcuserdata 25 | *.xccheckout 26 | *.moved-aside 27 | DerivedData 28 | *.hmap 29 | *.ipa 30 | *.xcuserstate 31 | project.xcworkspace 32 | ios/Pods 33 | ios/*.xcworkspace 34 | 35 | # Android/IntelliJ 36 | # 37 | build/ 38 | .idea 39 | .gradle 40 | local.properties 41 | *.iml 42 | 43 | # BUCK 44 | buck-out/ 45 | \.buckd/ 46 | *.keystore 47 | acp-sdks/ 48 | *.tgz 49 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | sample/ 2 | .github/ 3 | .git/ 4 | .editorconfig 5 | 6 | # Built application files 7 | android/*/build/ 8 | 9 | # Crashlytics configuations 10 | android/com_crashlytics_export_strings.xml 11 | 12 | # Local configuration file (sdk path, etc) 13 | android/local.properties 14 | 15 | # Gradle generated files 16 | android/.gradle/ 17 | 18 | # Signing files 19 | android/.signing/ 20 | 21 | # User-specific configurations 22 | android/.idea/gradle.xml 23 | android/.idea/libraries/ 24 | android/.idea/workspace.xml 25 | android/.idea/tasks.xml 26 | android/.idea/.name 27 | android/.idea/compiler.xml 28 | android/.idea/copyright/profiles_settings.xml 29 | android/.idea/encodings.xml 30 | android/.idea/misc.xml 31 | android/.idea/modules.xml 32 | android/.idea/scopes/scope_settings.xml 33 | android/.idea/vcs.xml 34 | android/*.iml 35 | 36 | # Xcode 37 | *.pbxuser 38 | *.mode1v3 39 | *.mode2v3 40 | *.perspectivev3 41 | *.xcuserstate 42 | ios/Pods 43 | ios/build 44 | *project.xcworkspace* 45 | *xcuserdata* 46 | ios/*.xcworkspace 47 | ios/*.podspec 48 | 49 | # OS-specific files 50 | .DS_Store 51 | .DS_Store? 52 | ._* 53 | .Spotlight-V100 54 | .Trashes 55 | ehthumbs.db 56 | Thumbs.dbandroid/gradle 57 | android/gradlew 58 | android/build 59 | android/gradlew.bat 60 | android/gradle/ 61 | __tests__ 62 | .circleci/ 63 | .opensource/ 64 | jest/ 65 | acp-sdks/ 66 | update-android-sdk.sh 67 | CONTRIBUTING.md 68 | CODE_OF_CONDUCT.md 69 | Makefile 70 | *.tgz 71 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Adobe Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at Grp-opensourceoffice@adobe.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [https://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: https://contributor-covenant.org 74 | [version]: https://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for choosing to contribute! 4 | 5 | The following are a set of guidelines to follow when contributing to this project. 6 | 7 | ## Code Of Conduct 8 | 9 | This project adheres to the Adobe [code of conduct](../CODE_OF_CONDUCT.md). By participating, 10 | you are expected to uphold this code. Please report unacceptable behavior to 11 | [Grp-opensourceoffice@adobe.com](mailto:Grp-opensourceoffice@adobe.com). 12 | 13 | ## Have A Question? 14 | 15 | Start by filing an issue. The existing committers on this project work to reach 16 | consensus around project direction and issue solutions within issue threads 17 | (when appropriate). 18 | 19 | ## Contributor License Agreement 20 | 21 | All third-party contributions to this project must be accompanied by a signed contributor 22 | license agreement. This gives Adobe permission to redistribute your contributions 23 | as part of the project. [Sign our CLA](http://opensource.adobe.com/cla.html). You 24 | only need to submit an Adobe CLA one time, so if you have submitted one previously, 25 | you are good to go! 26 | 27 | ## Code Reviews 28 | 29 | All submissions should come in the form of pull requests and need to be reviewed 30 | by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) 31 | for more information on sending pull requests. 32 | 33 | Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when 34 | submitting a pull request! 35 | 36 | ## From Contributor To Committer 37 | 38 | We love contributions from our community! If you'd like to go a step beyond contributor 39 | and become a committer with full write access and a say in the project, you must 40 | be invited to the project. The existing committers employ an internal nomination 41 | process that must reach lazy consensus (silence is approval) before invitations 42 | are issued. If you feel you are qualified and want to get more deeply involved, 43 | feel free to reach out to existing committers to have a conversation about that. 44 | 45 | ## Security Issues 46 | 47 | Security issues shouldn't be reported on this issue tracker. Instead, [file an issue to our security experts](https://helpx.adobe.com/security/alertus.html) 48 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = ACPAnalytics 2 | 3 | setup: 4 | (npm install) 5 | (cd ios && pod deintegrate || true && pod install) 6 | 7 | clean: 8 | (rm -rf android/build && rm -rf ios/build) 9 | (cd android && ./gradlew clean) 10 | (cd ios && xcodebuild clean -workspace RCT${PROJECT_NAME}.xcworkspace -scheme RCT${PROJECT_NAME}) 11 | 12 | build-android: 13 | (cd android && ./gradlew build -x lint) 14 | 15 | build-ios: setup 16 | (cd ios && xcodebuild build -workspace RCT${PROJECT_NAME}.xcworkspace -scheme RCT${PROJECT_NAME}) 17 | 18 | build-sample-android: 19 | (cd sample/ACP*SampleApp/android && ./gradlew clean assembleRelease -x bundleReleaseJsAndAssets) 20 | 21 | build-sample-ios: 22 | (cd sample/ACP*SampleApp/ios && pod update) 23 | (cd sample/ACP*SampleApp && npx react-native run-ios) 24 | 25 | run-tests: 26 | jest --testPathIgnorePatterns sample/ node_modules/ --modulePathIgnorePatterns sample/ --runInBand 27 | 28 | run-tests-locally: setup 29 | ./node_modules/.bin/jest --testPathIgnorePatterns sample/ node_modules/ --modulePathIgnorePatterns sample/ 30 | 31 | copy-to-sample: 32 | (cd sample/ACP*SampleApp/ && make sync) -------------------------------------------------------------------------------- /RCTACPAnalytics.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 3 | 4 | Pod::Spec.new do |s| 5 | s.name = "RCTACPAnalytics" 6 | s.version = package["version"] 7 | s.summary = "Analytics library for Adobe Experience Cloud SDK. Written and Supported by Adobe." 8 | s.author = "Adobe Mobile SDK Team" 9 | 10 | s.homepage = "https://github.com/adobe/react-native-acpanalytics" 11 | 12 | s.license = "Apache 2.0 License" 13 | s.platforms = { :ios => "10.0", :tvos => "10.0" } 14 | 15 | s.source = { :git => "https://github.com/adobe/react-native-acpanalytics.git", :tag => "#{s.version}" } 16 | 17 | s.source_files = "ios/**/*.{h,m}" 18 | s.requires_arc = true 19 | 20 | s.dependency "React" 21 | s.dependency "ACPAnalytics" 22 | end 23 | -------------------------------------------------------------------------------- /__tests__/ACPAnalyticsTests.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | 12 | @format 13 | */ 14 | 15 | import { NativeModules } from 'react-native'; 16 | import ACPAnalytics from '../js/ACPAnalytics'; 17 | 18 | describe('ACPAnalytics', () => { 19 | 20 | test('extensionVersion is called', async () => { 21 | const spy = jest.spyOn(NativeModules.ACPAnalytics, 'extensionVersion'); 22 | await ACPAnalytics.extensionVersion(); 23 | expect(spy).toHaveBeenCalled(); 24 | }); 25 | 26 | test('getTrackingIdentifier is called', async () => { 27 | const spy = jest.spyOn(NativeModules.ACPAnalytics, 'getTrackingIdentifier'); 28 | await ACPAnalytics.getTrackingIdentifier(); 29 | expect(spy).toHaveBeenCalled(); 30 | }); 31 | 32 | test('getQueueSize is called', async () => { 33 | const spy = jest.spyOn(NativeModules.ACPAnalytics, 'getQueueSize'); 34 | await ACPAnalytics.getQueueSize(); 35 | expect(spy).toHaveBeenCalled(); 36 | }); 37 | 38 | test('clearQueue is called', async () => { 39 | const spy = jest.spyOn(NativeModules.ACPAnalytics, 'clearQueue'); 40 | await ACPAnalytics.clearQueue(); 41 | expect(spy).toHaveBeenCalled(); 42 | }); 43 | 44 | test('sendQueuedHits is called', async () => { 45 | const spy = jest.spyOn(NativeModules.ACPAnalytics, 'sendQueuedHits'); 46 | await ACPAnalytics.sendQueuedHits(); 47 | expect(spy).toHaveBeenCalled(); 48 | }); 49 | 50 | test('getVisitorIdentifier is called', async () => { 51 | const spy = jest.spyOn(NativeModules.ACPAnalytics, 'getVisitorIdentifier'); 52 | await ACPAnalytics.getVisitorIdentifier(); 53 | expect(spy).toHaveBeenCalled(); 54 | }); 55 | 56 | test('setVisitorIdentifier is called with correct parameters', async () => { 57 | const spy = jest.spyOn(NativeModules.ACPAnalytics, 'setVisitorIdentifier'); 58 | let vid = 'vid' 59 | await ACPAnalytics.setVisitorIdentifier(vid); 60 | expect(spy).toHaveBeenCalledWith(vid); 61 | }); 62 | 63 | }); 64 | -------------------------------------------------------------------------------- /android/README.md: -------------------------------------------------------------------------------- 1 | # Setup 2 | 3 | Open `build.gradle` in Android Studio. 4 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.1' 9 | } 10 | } 11 | 12 | apply plugin: 'com.android.library' 13 | 14 | android { 15 | compileSdkVersion 28 16 | // buildToolsVersion "23.0.1" 17 | 18 | defaultConfig { 19 | minSdkVersion 16 20 | targetSdkVersion 28 21 | versionCode 1 22 | versionName "1.0" 23 | } 24 | lintOptions { 25 | abortOnError false 26 | } 27 | } 28 | 29 | repositories { 30 | google() 31 | mavenCentral() 32 | } 33 | 34 | dependencies { 35 | implementation "com.facebook.react:react-native:+" 36 | api "com.adobe.marketing.mobile:analytics:1.+" 37 | } 38 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adobe/react-native-acpanalytics/34f5b6a1029e64256a4103775299e5f6fb3fcbaa/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 29 15:04:54 MST 2019 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-6.0-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /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 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 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 Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/java/com/adobe/marketing/mobile/reactnative/analytics/RCTACPAnalyticsModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.marketing.mobile.reactnative.analytics; 13 | 14 | import android.util.Log; 15 | 16 | import com.adobe.marketing.mobile.AdobeCallback; 17 | import com.adobe.marketing.mobile.Analytics; 18 | import com.adobe.marketing.mobile.InvalidInitException; 19 | import com.facebook.react.bridge.ReactApplicationContext; 20 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 21 | import com.facebook.react.bridge.ReactMethod; 22 | import com.facebook.react.bridge.Promise; 23 | 24 | public class RCTACPAnalyticsModule extends ReactContextBaseJavaModule { 25 | 26 | private final ReactApplicationContext reactContext; 27 | 28 | public RCTACPAnalyticsModule(ReactApplicationContext reactContext) { 29 | super(reactContext); 30 | this.reactContext = reactContext; 31 | } 32 | 33 | // Required for RN modules 34 | @Override 35 | public String getName() { 36 | return "ACPAnalytics"; 37 | } 38 | 39 | @ReactMethod 40 | public void extensionVersion(final Promise promise) { 41 | promise.resolve(Analytics.extensionVersion()); 42 | } 43 | 44 | @ReactMethod 45 | public void getTrackingIdentifier(final Promise promise) { 46 | Analytics.getTrackingIdentifier(new AdobeCallback() { 47 | @Override 48 | public void call(final String aid) { 49 | promise.resolve(aid); 50 | } 51 | }); 52 | } 53 | 54 | @ReactMethod 55 | public void getQueueSize(final Promise promise) { 56 | Analytics.getQueueSize(new AdobeCallback() { 57 | @Override 58 | public void call(final Long queueSize) { 59 | promise.resolve(queueSize); 60 | } 61 | }); 62 | } 63 | 64 | @ReactMethod 65 | public void clearQueue() { 66 | Analytics.clearQueue(); 67 | } 68 | 69 | @ReactMethod 70 | public void sendQueuedHits() { 71 | Analytics.sendQueuedHits(); 72 | } 73 | 74 | @ReactMethod 75 | public void getVisitorIdentifier(final Promise promise) { 76 | Analytics.getVisitorIdentifier(new AdobeCallback() { 77 | @Override 78 | public void call(final String vid) { 79 | promise.resolve(vid); 80 | } 81 | }); 82 | } 83 | 84 | @ReactMethod 85 | public void setVisitorIdentifier(final String vid) { 86 | Analytics.setVisitorIdentifier(vid); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /android/src/main/java/com/adobe/marketing/mobile/reactnative/analytics/RCTACPAnalyticsPackage.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | package com.adobe.marketing.mobile.reactnative.analytics; 13 | 14 | import java.util.Arrays; 15 | import java.util.Collections; 16 | import java.util.List; 17 | 18 | import com.facebook.react.ReactPackage; 19 | import com.facebook.react.bridge.NativeModule; 20 | import com.facebook.react.bridge.ReactApplicationContext; 21 | import com.facebook.react.uimanager.ViewManager; 22 | import com.facebook.react.bridge.JavaScriptModule; 23 | public class RCTACPAnalyticsPackage implements ReactPackage { 24 | @Override 25 | public List createNativeModules(ReactApplicationContext reactContext) { 26 | return Arrays.asList(new RCTACPAnalyticsModule(reactContext)); 27 | } 28 | 29 | // Deprecated from RN 0.47 30 | public List> createJSModules() { 31 | return Collections.emptyList(); 32 | } 33 | 34 | @Override 35 | public List createViewManagers(ReactApplicationContext reactContext) { 36 | return Collections.emptyList(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /flow-typed/npm-custom/react-native.js: -------------------------------------------------------------------------------- 1 | declare module 'react-native' { 2 | declare module.exports: any; 3 | } 4 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-cli_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: dbbf97fda4b804bb1bd1a12afdb8bf31 2 | // flow-typed version: <>/babel-cli_v^6.26.0/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-cli' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-cli' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-cli/bin/babel-doctor' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-cli/bin/babel-external-helpers' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-cli/bin/babel-node' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-cli/bin/babel' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-cli/lib/_babel-node' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-cli/lib/babel-external-helpers' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-cli/lib/babel-node' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'babel-cli/lib/babel/dir' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'babel-cli/lib/babel/file' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'babel-cli/lib/babel/index' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'babel-cli/lib/babel/util' { 66 | declare module.exports: any; 67 | } 68 | 69 | // Filename aliases 70 | declare module 'babel-cli/bin/babel-doctor.js' { 71 | declare module.exports: $Exports<'babel-cli/bin/babel-doctor'>; 72 | } 73 | declare module 'babel-cli/bin/babel-external-helpers.js' { 74 | declare module.exports: $Exports<'babel-cli/bin/babel-external-helpers'>; 75 | } 76 | declare module 'babel-cli/bin/babel-node.js' { 77 | declare module.exports: $Exports<'babel-cli/bin/babel-node'>; 78 | } 79 | declare module 'babel-cli/bin/babel.js' { 80 | declare module.exports: $Exports<'babel-cli/bin/babel'>; 81 | } 82 | declare module 'babel-cli/index' { 83 | declare module.exports: $Exports<'babel-cli'>; 84 | } 85 | declare module 'babel-cli/index.js' { 86 | declare module.exports: $Exports<'babel-cli'>; 87 | } 88 | declare module 'babel-cli/lib/_babel-node.js' { 89 | declare module.exports: $Exports<'babel-cli/lib/_babel-node'>; 90 | } 91 | declare module 'babel-cli/lib/babel-external-helpers.js' { 92 | declare module.exports: $Exports<'babel-cli/lib/babel-external-helpers'>; 93 | } 94 | declare module 'babel-cli/lib/babel-node.js' { 95 | declare module.exports: $Exports<'babel-cli/lib/babel-node'>; 96 | } 97 | declare module 'babel-cli/lib/babel/dir.js' { 98 | declare module.exports: $Exports<'babel-cli/lib/babel/dir'>; 99 | } 100 | declare module 'babel-cli/lib/babel/file.js' { 101 | declare module.exports: $Exports<'babel-cli/lib/babel/file'>; 102 | } 103 | declare module 'babel-cli/lib/babel/index.js' { 104 | declare module.exports: $Exports<'babel-cli/lib/babel/index'>; 105 | } 106 | declare module 'babel-cli/lib/babel/util.js' { 107 | declare module.exports: $Exports<'babel-cli/lib/babel/util'>; 108 | } 109 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-eslint_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 7265767162488d59e86e4e15ca132f34 2 | // flow-typed version: <>/babel-eslint_v^8.2.2/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-eslint' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-eslint' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-eslint/lib/analyze-scope' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-eslint/lib/babylon-to-espree/attachComments' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-eslint/lib/babylon-to-espree/convertComments' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-eslint/lib/babylon-to-espree/convertTemplateType' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-eslint/lib/babylon-to-espree/index' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-eslint/lib/babylon-to-espree/toAST' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-eslint/lib/babylon-to-espree/toToken' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'babel-eslint/lib/babylon-to-espree/toTokens' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'babel-eslint/lib/index' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'babel-eslint/lib/parse-with-patch' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'babel-eslint/lib/parse-with-scope' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'babel-eslint/lib/parse' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'babel-eslint/lib/patch-eslint-scope' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'babel-eslint/lib/visitor-keys' { 78 | declare module.exports: any; 79 | } 80 | 81 | // Filename aliases 82 | declare module 'babel-eslint/lib/analyze-scope.js' { 83 | declare module.exports: $Exports<'babel-eslint/lib/analyze-scope'>; 84 | } 85 | declare module 'babel-eslint/lib/babylon-to-espree/attachComments.js' { 86 | declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/attachComments'>; 87 | } 88 | declare module 'babel-eslint/lib/babylon-to-espree/convertComments.js' { 89 | declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/convertComments'>; 90 | } 91 | declare module 'babel-eslint/lib/babylon-to-espree/convertTemplateType.js' { 92 | declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/convertTemplateType'>; 93 | } 94 | declare module 'babel-eslint/lib/babylon-to-espree/index.js' { 95 | declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/index'>; 96 | } 97 | declare module 'babel-eslint/lib/babylon-to-espree/toAST.js' { 98 | declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toAST'>; 99 | } 100 | declare module 'babel-eslint/lib/babylon-to-espree/toToken.js' { 101 | declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toToken'>; 102 | } 103 | declare module 'babel-eslint/lib/babylon-to-espree/toTokens.js' { 104 | declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toTokens'>; 105 | } 106 | declare module 'babel-eslint/lib/index.js' { 107 | declare module.exports: $Exports<'babel-eslint/lib/index'>; 108 | } 109 | declare module 'babel-eslint/lib/parse-with-patch.js' { 110 | declare module.exports: $Exports<'babel-eslint/lib/parse-with-patch'>; 111 | } 112 | declare module 'babel-eslint/lib/parse-with-scope.js' { 113 | declare module.exports: $Exports<'babel-eslint/lib/parse-with-scope'>; 114 | } 115 | declare module 'babel-eslint/lib/parse.js' { 116 | declare module.exports: $Exports<'babel-eslint/lib/parse'>; 117 | } 118 | declare module 'babel-eslint/lib/patch-eslint-scope.js' { 119 | declare module.exports: $Exports<'babel-eslint/lib/patch-eslint-scope'>; 120 | } 121 | declare module 'babel-eslint/lib/visitor-keys.js' { 122 | declare module.exports: $Exports<'babel-eslint/lib/visitor-keys'>; 123 | } 124 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-plugin-module-resolver_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 8c634e4f7bb3231de6609711123b25c1 2 | // flow-typed version: <>/babel-plugin-module-resolver_v^3.1.3/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-plugin-module-resolver' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-plugin-module-resolver' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-plugin-module-resolver/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-plugin-module-resolver/lib/log' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-plugin-module-resolver/lib/mapToRelative' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-plugin-module-resolver/lib/normalizeOptions' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-plugin-module-resolver/lib/resolvePath' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-plugin-module-resolver/lib/transformers/call' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-plugin-module-resolver/lib/transformers/import' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'babel-plugin-module-resolver/lib/utils' { 54 | declare module.exports: any; 55 | } 56 | 57 | // Filename aliases 58 | declare module 'babel-plugin-module-resolver/lib/index.js' { 59 | declare module.exports: $Exports<'babel-plugin-module-resolver/lib/index'>; 60 | } 61 | declare module 'babel-plugin-module-resolver/lib/log.js' { 62 | declare module.exports: $Exports<'babel-plugin-module-resolver/lib/log'>; 63 | } 64 | declare module 'babel-plugin-module-resolver/lib/mapToRelative.js' { 65 | declare module.exports: $Exports<'babel-plugin-module-resolver/lib/mapToRelative'>; 66 | } 67 | declare module 'babel-plugin-module-resolver/lib/normalizeOptions.js' { 68 | declare module.exports: $Exports<'babel-plugin-module-resolver/lib/normalizeOptions'>; 69 | } 70 | declare module 'babel-plugin-module-resolver/lib/resolvePath.js' { 71 | declare module.exports: $Exports<'babel-plugin-module-resolver/lib/resolvePath'>; 72 | } 73 | declare module 'babel-plugin-module-resolver/lib/transformers/call.js' { 74 | declare module.exports: $Exports<'babel-plugin-module-resolver/lib/transformers/call'>; 75 | } 76 | declare module 'babel-plugin-module-resolver/lib/transformers/import.js' { 77 | declare module.exports: $Exports<'babel-plugin-module-resolver/lib/transformers/import'>; 78 | } 79 | declare module 'babel-plugin-module-resolver/lib/utils.js' { 80 | declare module.exports: $Exports<'babel-plugin-module-resolver/lib/utils'>; 81 | } 82 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-flow_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: aefc77e424c85866dba67bd928a7abd0 2 | // flow-typed version: <>/babel-preset-flow_v^6.23.0/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-flow' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-flow' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-flow/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-preset-flow/lib/index.js' { 31 | declare module.exports: $Exports<'babel-preset-flow/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-react-native_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b8d8c5fc296e91c6fb779bcc0854b489 2 | // flow-typed version: <>/babel-preset-react-native_v2.1.0/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-react-native' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-react-native' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-react-native/configs/hmr' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-preset-react-native/configs/internal' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-preset-react-native/configs/main' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-preset-react-native/lib/resolvePlugins' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-preset-react-native/plugins' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-preset-react-native/transforms/transform-regenerator-runtime-insertion' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-preset-react-native/transforms/transform-symbol-member' { 50 | declare module.exports: any; 51 | } 52 | 53 | // Filename aliases 54 | declare module 'babel-preset-react-native/configs/hmr.js' { 55 | declare module.exports: $Exports<'babel-preset-react-native/configs/hmr'>; 56 | } 57 | declare module 'babel-preset-react-native/configs/internal.js' { 58 | declare module.exports: $Exports<'babel-preset-react-native/configs/internal'>; 59 | } 60 | declare module 'babel-preset-react-native/configs/main.js' { 61 | declare module.exports: $Exports<'babel-preset-react-native/configs/main'>; 62 | } 63 | declare module 'babel-preset-react-native/index' { 64 | declare module.exports: $Exports<'babel-preset-react-native'>; 65 | } 66 | declare module 'babel-preset-react-native/index.js' { 67 | declare module.exports: $Exports<'babel-preset-react-native'>; 68 | } 69 | declare module 'babel-preset-react-native/lib/resolvePlugins.js' { 70 | declare module.exports: $Exports<'babel-preset-react-native/lib/resolvePlugins'>; 71 | } 72 | declare module 'babel-preset-react-native/plugins.js' { 73 | declare module.exports: $Exports<'babel-preset-react-native/plugins'>; 74 | } 75 | declare module 'babel-preset-react-native/transforms/transform-regenerator-runtime-insertion.js' { 76 | declare module.exports: $Exports<'babel-preset-react-native/transforms/transform-regenerator-runtime-insertion'>; 77 | } 78 | declare module 'babel-preset-react-native/transforms/transform-symbol-member.js' { 79 | declare module.exports: $Exports<'babel-preset-react-native/transforms/transform-symbol-member'>; 80 | } 81 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-config-airbnb_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: bdc8ab665b7f9b1a990fc84d1179f71f 2 | // flow-typed version: <>/eslint-config-airbnb_v^16.1.0/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-config-airbnb' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-config-airbnb' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'eslint-config-airbnb/base' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'eslint-config-airbnb/legacy' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'eslint-config-airbnb/rules/react-a11y' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'eslint-config-airbnb/rules/react' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'eslint-config-airbnb/test/test-base' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'eslint-config-airbnb/test/test-react-order' { 46 | declare module.exports: any; 47 | } 48 | 49 | // Filename aliases 50 | declare module 'eslint-config-airbnb/base.js' { 51 | declare module.exports: $Exports<'eslint-config-airbnb/base'>; 52 | } 53 | declare module 'eslint-config-airbnb/index' { 54 | declare module.exports: $Exports<'eslint-config-airbnb'>; 55 | } 56 | declare module 'eslint-config-airbnb/index.js' { 57 | declare module.exports: $Exports<'eslint-config-airbnb'>; 58 | } 59 | declare module 'eslint-config-airbnb/legacy.js' { 60 | declare module.exports: $Exports<'eslint-config-airbnb/legacy'>; 61 | } 62 | declare module 'eslint-config-airbnb/rules/react-a11y.js' { 63 | declare module.exports: $Exports<'eslint-config-airbnb/rules/react-a11y'>; 64 | } 65 | declare module 'eslint-config-airbnb/rules/react.js' { 66 | declare module.exports: $Exports<'eslint-config-airbnb/rules/react'>; 67 | } 68 | declare module 'eslint-config-airbnb/test/test-base.js' { 69 | declare module.exports: $Exports<'eslint-config-airbnb/test/test-base'>; 70 | } 71 | declare module 'eslint-config-airbnb/test/test-react-order.js' { 72 | declare module.exports: $Exports<'eslint-config-airbnb/test/test-react-order'>; 73 | } 74 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-config-prettier_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 3b47ab6611b713ec723daf60fcce644f 2 | // flow-typed version: <>/eslint-config-prettier_v^2.9.0/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-config-prettier' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-config-prettier' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'eslint-config-prettier/bin/cli' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'eslint-config-prettier/bin/validators' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'eslint-config-prettier/flowtype' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'eslint-config-prettier/react' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'eslint-config-prettier/standard' { 42 | declare module.exports: any; 43 | } 44 | 45 | // Filename aliases 46 | declare module 'eslint-config-prettier/bin/cli.js' { 47 | declare module.exports: $Exports<'eslint-config-prettier/bin/cli'>; 48 | } 49 | declare module 'eslint-config-prettier/bin/validators.js' { 50 | declare module.exports: $Exports<'eslint-config-prettier/bin/validators'>; 51 | } 52 | declare module 'eslint-config-prettier/flowtype.js' { 53 | declare module.exports: $Exports<'eslint-config-prettier/flowtype'>; 54 | } 55 | declare module 'eslint-config-prettier/index' { 56 | declare module.exports: $Exports<'eslint-config-prettier'>; 57 | } 58 | declare module 'eslint-config-prettier/index.js' { 59 | declare module.exports: $Exports<'eslint-config-prettier'>; 60 | } 61 | declare module 'eslint-config-prettier/react.js' { 62 | declare module.exports: $Exports<'eslint-config-prettier/react'>; 63 | } 64 | declare module 'eslint-config-prettier/standard.js' { 65 | declare module.exports: $Exports<'eslint-config-prettier/standard'>; 66 | } 67 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-import-resolver-babel-module_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: a5972d968a9d6d54326567ce1af9d99d 2 | // flow-typed version: <>/eslint-import-resolver-babel-module_v^4.0.0/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-import-resolver-babel-module' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-import-resolver-babel-module' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'eslint-import-resolver-babel-module/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'eslint-import-resolver-babel-module/lib/index.js' { 31 | declare module.exports: $Exports<'eslint-import-resolver-babel-module/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-plugin-react-native_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: c4170bf4b9a86ac45b573e9126b17dfb 2 | // flow-typed version: <>/eslint-plugin-react-native_v^3.2.1/flow_v0.92.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-plugin-react-native' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-plugin-react-native' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'eslint-plugin-react-native/lib/rules/no-color-literals' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'eslint-plugin-react-native/lib/rules/no-inline-styles' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'eslint-plugin-react-native/lib/rules/no-raw-text' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'eslint-plugin-react-native/lib/rules/no-unused-styles' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'eslint-plugin-react-native/lib/rules/sort-styles' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'eslint-plugin-react-native/lib/rules/split-platform-components' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'eslint-plugin-react-native/lib/util/Components' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'eslint-plugin-react-native/lib/util/stylesheet' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'eslint-plugin-react-native/lib/util/variable' { 58 | declare module.exports: any; 59 | } 60 | 61 | // Filename aliases 62 | declare module 'eslint-plugin-react-native/index' { 63 | declare module.exports: $Exports<'eslint-plugin-react-native'>; 64 | } 65 | declare module 'eslint-plugin-react-native/index.js' { 66 | declare module.exports: $Exports<'eslint-plugin-react-native'>; 67 | } 68 | declare module 'eslint-plugin-react-native/lib/rules/no-color-literals.js' { 69 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/rules/no-color-literals'>; 70 | } 71 | declare module 'eslint-plugin-react-native/lib/rules/no-inline-styles.js' { 72 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/rules/no-inline-styles'>; 73 | } 74 | declare module 'eslint-plugin-react-native/lib/rules/no-raw-text.js' { 75 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/rules/no-raw-text'>; 76 | } 77 | declare module 'eslint-plugin-react-native/lib/rules/no-unused-styles.js' { 78 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/rules/no-unused-styles'>; 79 | } 80 | declare module 'eslint-plugin-react-native/lib/rules/sort-styles.js' { 81 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/rules/sort-styles'>; 82 | } 83 | declare module 'eslint-plugin-react-native/lib/rules/split-platform-components.js' { 84 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/rules/split-platform-components'>; 85 | } 86 | declare module 'eslint-plugin-react-native/lib/util/Components.js' { 87 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/util/Components'>; 88 | } 89 | declare module 'eslint-plugin-react-native/lib/util/stylesheet.js' { 90 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/util/stylesheet'>; 91 | } 92 | declare module 'eslint-plugin-react-native/lib/util/variable.js' { 93 | declare module.exports: $Exports<'eslint-plugin-react-native/lib/util/variable'>; 94 | } 95 | -------------------------------------------------------------------------------- /flow-typed/npm/flow-bin_v0.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583 2 | // flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x 3 | 4 | declare module 'flow-bin' { 5 | declare module.exports: string; 6 | } 7 | -------------------------------------------------------------------------------- /ios/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'cocoapods', '= 1.10.0' 4 | -------------------------------------------------------------------------------- /ios/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.3) 5 | activesupport (5.2.4.4) 6 | concurrent-ruby (~> 1.0, >= 1.0.2) 7 | i18n (>= 0.7, < 2) 8 | minitest (~> 5.1) 9 | tzinfo (~> 1.1) 10 | addressable (2.7.0) 11 | public_suffix (>= 2.0.2, < 5.0) 12 | algoliasearch (1.27.5) 13 | httpclient (~> 2.8, >= 2.8.3) 14 | json (>= 1.5.1) 15 | atomos (0.1.3) 16 | claide (1.0.3) 17 | cocoapods (1.10.0) 18 | addressable (~> 2.6) 19 | claide (>= 1.0.2, < 2.0) 20 | cocoapods-core (= 1.10.0) 21 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 22 | cocoapods-downloader (>= 1.4.0, < 2.0) 23 | cocoapods-plugins (>= 1.0.0, < 2.0) 24 | cocoapods-search (>= 1.0.0, < 2.0) 25 | cocoapods-trunk (>= 1.4.0, < 2.0) 26 | cocoapods-try (>= 1.1.0, < 2.0) 27 | colored2 (~> 3.1) 28 | escape (~> 0.0.4) 29 | fourflusher (>= 2.3.0, < 3.0) 30 | gh_inspector (~> 1.0) 31 | molinillo (~> 0.6.6) 32 | nap (~> 1.0) 33 | ruby-macho (~> 1.4) 34 | xcodeproj (>= 1.19.0, < 2.0) 35 | cocoapods-core (1.10.0) 36 | activesupport (> 5.0, < 6) 37 | addressable (~> 2.6) 38 | algoliasearch (~> 1.0) 39 | concurrent-ruby (~> 1.1) 40 | fuzzy_match (~> 2.0.4) 41 | nap (~> 1.0) 42 | netrc (~> 0.11) 43 | public_suffix 44 | typhoeus (~> 1.0) 45 | cocoapods-deintegrate (1.0.4) 46 | cocoapods-downloader (1.4.0) 47 | cocoapods-plugins (1.0.0) 48 | nap 49 | cocoapods-search (1.0.0) 50 | cocoapods-trunk (1.5.0) 51 | nap (>= 0.8, < 2.0) 52 | netrc (~> 0.11) 53 | cocoapods-try (1.2.0) 54 | colored2 (3.1.2) 55 | concurrent-ruby (1.1.7) 56 | escape (0.0.4) 57 | ethon (0.12.0) 58 | ffi (>= 1.3.0) 59 | ffi (1.13.1) 60 | fourflusher (2.3.1) 61 | fuzzy_match (2.0.4) 62 | gh_inspector (1.1.3) 63 | httpclient (2.8.3) 64 | i18n (1.8.5) 65 | concurrent-ruby (~> 1.0) 66 | json (2.4.1) 67 | minitest (5.14.2) 68 | molinillo (0.6.6) 69 | nanaimo (0.3.0) 70 | nap (1.1.0) 71 | netrc (0.11.0) 72 | public_suffix (4.0.6) 73 | ruby-macho (1.4.0) 74 | thread_safe (0.3.6) 75 | typhoeus (1.4.0) 76 | ethon (>= 0.9.0) 77 | tzinfo (1.2.9) 78 | thread_safe (~> 0.1) 79 | xcodeproj (1.19.0) 80 | CFPropertyList (>= 2.3.3, < 4.0) 81 | atomos (~> 0.1.3) 82 | claide (>= 1.0.2, < 2.0) 83 | colored2 (~> 3.1) 84 | nanaimo (~> 0.3.0) 85 | 86 | PLATFORMS 87 | ruby 88 | 89 | DEPENDENCIES 90 | cocoapods (= 1.10.0) 91 | 92 | BUNDLED WITH 93 | 2.1.2 94 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '10.0' 2 | 3 | target 'RCTACPAnalytics' do 4 | # inherit! :search_paths 5 | # Pods for testing 6 | 7 | react_native_path = "../node_modules/react-native" 8 | 9 | pod "React-Core", :path => "#{react_native_path}/React" 10 | pod "React-cxxreact", :path => "#{react_native_path}/ReactCommon/cxxreact" 11 | pod "React-jsi", :path => "#{react_native_path}/ReactCommon/jsi" 12 | pod "React-jsiexecutor", :path => "#{react_native_path}/ReactCommon/jsiexecutor" 13 | pod "React-jsinspector", :path => "#{react_native_path}/ReactCommon/jsinspector" 14 | 15 | 16 | pod 'DoubleConversion', :podspec => "#{react_native_path}/third-party-podspecs/DoubleConversion.podspec" 17 | pod "yoga", :path => "#{react_native_path}/ReactCommon/yoga" 18 | pod "Folly", :podspec => "#{react_native_path}/third-party-podspecs/Folly.podspec" 19 | 20 | pod "ACPAnalytics" 21 | 22 | end 23 | 24 | post_install do |installer| 25 | ## Fix for XCode 12.5 beta 26 | find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm", 27 | "_initializeModules:(NSArray> *)modules", "_initializeModules:(NSArray *)modules") 28 | end 29 | 30 | def find_and_replace(dir, findstr, replacestr) 31 | Dir[dir].each do |name| 32 | text = File.read(name) 33 | replace = text.gsub(findstr,replacestr) 34 | if text != replace 35 | puts "Fix: " + name 36 | File.open(name, "w") { |file| file.puts replace } 37 | STDOUT.flush 38 | end 39 | end 40 | Dir[dir + '*/'].each(&method(:find_and_replace)) 41 | end 42 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ACPAnalytics (2.5.0): 3 | - ACPAnalytics/xcframeworks (= 2.5.0) 4 | - ACPCore (>= 2.9.0) 5 | - ACPAnalytics/xcframeworks (2.5.0): 6 | - ACPCore (>= 2.9.0) 7 | - ACPCore (2.9.4): 8 | - ACPCore/main (= 2.9.4) 9 | - ACPCore/main (2.9.4) 10 | - boost-for-react-native (1.63.0) 11 | - DoubleConversion (1.1.6) 12 | - Folly (2018.10.22.00): 13 | - boost-for-react-native 14 | - DoubleConversion 15 | - Folly/Default (= 2018.10.22.00) 16 | - glog 17 | - Folly/Default (2018.10.22.00): 18 | - boost-for-react-native 19 | - DoubleConversion 20 | - glog 21 | - glog (0.3.4) 22 | - React-Core (0.60.5): 23 | - Folly (= 2018.10.22.00) 24 | - React-cxxreact (= 0.60.5) 25 | - React-jsiexecutor (= 0.60.5) 26 | - yoga (= 0.60.5.React) 27 | - React-cxxreact (0.60.5): 28 | - boost-for-react-native (= 1.63.0) 29 | - DoubleConversion 30 | - Folly (= 2018.10.22.00) 31 | - glog 32 | - React-jsinspector (= 0.60.5) 33 | - React-jsi (0.60.5): 34 | - boost-for-react-native (= 1.63.0) 35 | - DoubleConversion 36 | - Folly (= 2018.10.22.00) 37 | - glog 38 | - React-jsi/Default (= 0.60.5) 39 | - React-jsi/Default (0.60.5): 40 | - boost-for-react-native (= 1.63.0) 41 | - DoubleConversion 42 | - Folly (= 2018.10.22.00) 43 | - glog 44 | - React-jsiexecutor (0.60.5): 45 | - DoubleConversion 46 | - Folly (= 2018.10.22.00) 47 | - glog 48 | - React-cxxreact (= 0.60.5) 49 | - React-jsi (= 0.60.5) 50 | - React-jsinspector (0.60.5) 51 | - yoga (0.60.5.React) 52 | 53 | DEPENDENCIES: 54 | - ACPAnalytics 55 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 56 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) 57 | - React-Core (from `../node_modules/react-native/React`) 58 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 59 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 60 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 61 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 62 | - yoga (from `../node_modules/react-native/ReactCommon/yoga`) 63 | 64 | SPEC REPOS: 65 | https://github.com/CocoaPods/Specs.git: 66 | - boost-for-react-native 67 | - glog 68 | trunk: 69 | - ACPAnalytics 70 | - ACPCore 71 | 72 | EXTERNAL SOURCES: 73 | DoubleConversion: 74 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 75 | Folly: 76 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" 77 | React-Core: 78 | :path: "../node_modules/react-native/React" 79 | React-cxxreact: 80 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 81 | React-jsi: 82 | :path: "../node_modules/react-native/ReactCommon/jsi" 83 | React-jsiexecutor: 84 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 85 | React-jsinspector: 86 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 87 | yoga: 88 | :path: "../node_modules/react-native/ReactCommon/yoga" 89 | 90 | SPEC CHECKSUMS: 91 | ACPAnalytics: 7067f3eb1f98d5c1a0028d632195fe6f3355b237 92 | ACPCore: 7d09a5b7233d72fa7cb4369c99a8250fd7240305 93 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 94 | DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 95 | Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 96 | glog: 1de0bb937dccdc981596d3b5825ebfb765017ded 97 | React-Core: ba421f6b4f4cbe2fb17c0b6fc675f87622e78a64 98 | React-cxxreact: 8384287780c4999351ad9b6e7a149d9ed10a2395 99 | React-jsi: 4d8c9efb6312a9725b18d6fc818ffc103f60fec2 100 | React-jsiexecutor: 90ad2f9db09513fc763bc757fdc3c4ff8bde2a30 101 | React-jsinspector: e08662d1bf5b129a3d556eb9ea343a3f40353ae4 102 | yoga: 312528f5bbbba37b4dcea5ef00e8b4033fdd9411 103 | 104 | PODFILE CHECKSUM: bca18e7309b2781b704684f00067a2376caba252 105 | 106 | COCOAPODS: 1.10.1 107 | -------------------------------------------------------------------------------- /ios/RCTACPAnalytics.xcodeproj/xcshareddata/xcschemes/RCTACPAnalytics.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ios/README.md: -------------------------------------------------------------------------------- 1 | # Setup 2 | 3 | > Note: Commands are assuming you're in the root directory of the repository. 4 | 5 | `npm install && cd ios && pod install` 6 | -------------------------------------------------------------------------------- /ios/src/RCTACPAnalytics.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | #import 14 | #import 15 | 16 | @interface RCTACPAnalytics : NSObject 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ios/src/RCTACPAnalytics.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | */ 12 | 13 | #import "RCTACPAnalytics.h" 14 | #import "ACPAnalytics.h" 15 | 16 | @implementation RCTACPAnalytics 17 | 18 | RCT_EXPORT_MODULE(ACPAnalytics); 19 | 20 | - (dispatch_queue_t)methodQueue 21 | { 22 | return dispatch_get_main_queue(); 23 | } 24 | 25 | RCT_EXPORT_METHOD(extensionVersion: (RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock)reject) { 26 | resolve([ACPAnalytics extensionVersion]); 27 | } 28 | 29 | RCT_EXPORT_METHOD(getTrackingIdentifier: (RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock)reject) { 30 | [ACPAnalytics getTrackingIdentifier:^(NSString * _Nullable trackingIdentifier) { 31 | resolve(trackingIdentifier); 32 | }]; 33 | } 34 | 35 | RCT_EXPORT_METHOD(getQueueSize: (RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock)reject) { 36 | [ACPAnalytics getQueueSize:^(NSUInteger queueSize) { 37 | resolve([NSNumber numberWithUnsignedInteger:queueSize]); 38 | }]; 39 | } 40 | 41 | RCT_EXPORT_METHOD(clearQueue) { 42 | [ACPAnalytics clearQueue]; 43 | } 44 | 45 | RCT_EXPORT_METHOD(sendQueuedHits) { 46 | [ACPAnalytics sendQueuedHits]; 47 | } 48 | 49 | RCT_EXPORT_METHOD(getVisitorIdentifier: (RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock)reject) { 50 | [ACPAnalytics getVisitorIdentifier:^(NSString * _Nullable visitorIdentifier) { 51 | resolve(visitorIdentifier); 52 | }]; 53 | } 54 | 55 | RCT_EXPORT_METHOD(setVisitorIdentifier: (nullable NSString*) visitorIdentifier) { 56 | [ACPAnalytics setVisitorIdentifier:visitorIdentifier]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /jest/setup.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | 12 | @format 13 | */ 14 | 15 | jest.mock('NativeModules', () => ({ 16 | ACPAnalytics: { 17 | extensionVersion: jest.fn(() => new Promise(resolve => resolve())), 18 | registerExtension: jest.fn(), 19 | getTrackingIdentifier: jest.fn(() => new Promise(resolve => resolve())), 20 | getQueueSize: jest.fn(() => new Promise(resolve => resolve())), 21 | clearQueue: jest.fn(), 22 | sendQueuedHits: jest.fn(), 23 | getVisitorIdentifier: jest.fn(() => new Promise(resolve => resolve())), 24 | sendQueuedHits: jest.fn(), 25 | setVisitorIdentifier: jest.fn() 26 | } 27 | })); 28 | -------------------------------------------------------------------------------- /js/ACPAnalytics.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | 12 | @flow 13 | @format 14 | */ 15 | 16 | 'use strict'; 17 | 18 | const RCTACPAnalytics = require('react-native').NativeModules.ACPAnalytics; 19 | 20 | module.exports = { 21 | /** 22 | * Returns the version of the ACPAnalytics extension 23 | * @param {string} Promise a promise that resolves with the extension verison 24 | */ 25 | extensionVersion(): Promise { 26 | return Promise.resolve(RCTACPAnalytics.extensionVersion()); 27 | }, 28 | 29 | /** 30 | * @brief Retrieves the analytics tracking identifier. 31 | * 32 | * @param callback invoked with the analytics identifier value 33 | */ 34 | getTrackingIdentifier(): Promise { 35 | return RCTACPAnalytics.getTrackingIdentifier(); 36 | }, 37 | 38 | /** 39 | * @brief Retrieves the number of hits currently in the tracking queue 40 | * 41 | * @param callback invoked with the queue size value 42 | */ 43 | getQueueSize(): Promise { 44 | return RCTACPAnalytics.getQueueSize(); 45 | }, 46 | 47 | /** 48 | * @brief Clears all hits from the tracking queue and removes them from the database. 49 | * @warning Use caution when clearing the queue manually. This process cannot be reversed. 50 | */ 51 | clearQueue() { 52 | RCTACPAnalytics.clearQueue(); 53 | }, 54 | 55 | /** 56 | * @brief Forces analytics to send all queued hits regardless of current batch options 57 | */ 58 | sendQueuedHits() { 59 | RCTACPAnalytics.sendQueuedHits(); 60 | }, 61 | 62 | /** 63 | * @brief Retrieves the visitor identifier. 64 | * 65 | * @param callback invoked with the visitor identifier value 66 | */ 67 | getVisitorIdentifier(): Promise { 68 | return RCTACPAnalytics.getVisitorIdentifier(); 69 | }, 70 | 71 | /** 72 | * @brief Sets the visitor identifier. 73 | * 74 | * @param visitorIdentifier the new value for visitor identifier 75 | */ 76 | setVisitorIdentifier(vid?: String) { 77 | RCTACPAnalytics.setVisitorIdentifier(vid); 78 | }, 79 | }; 80 | -------------------------------------------------------------------------------- /js/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2019 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | 12 | @flow 13 | @format 14 | */ 15 | 16 | 'use strict'; 17 | 18 | module.exports = { 19 | // Native modules 20 | get ACPAnalytics() { 21 | return require('./ACPAnalytics'); 22 | }, 23 | }; 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@adobe/react-native-acpanalytics", 3 | "version": "2.0.1", 4 | "description": "Adobe Experience Platform support for React Native apps.", 5 | "homepage": "https://aep-sdks.gitbook.io/docs/", 6 | "license": "Apache-2.0", 7 | "main": "./js/index.js", 8 | "scripts": { 9 | "flow": "flow" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/adobe/react-native-acpanalytics" 14 | }, 15 | "keywords": [ 16 | "react-native", 17 | "adobe", 18 | "adobe experience platform", 19 | "analytics", 20 | "ios", 21 | "android" 22 | ], 23 | "author": { 24 | "name": "Adobe Experience Platform SDK Team" 25 | }, 26 | "peerDependencies": { 27 | "react-native": ">=0.60.0", 28 | "@adobe/react-native-acpcore": ">=2.0.0" 29 | }, 30 | "devDependencies": { 31 | "@babel/generator": "^7.4.4", 32 | "@babel/preset-flow": "^7.0.0", 33 | "babel-plugin-module-resolver": "^3.1.3", 34 | "babel-preset-react-native": "5.0.2", 35 | "flow-typed": "^2.5.2", 36 | "jest": "24.8.0", 37 | "react": "^16.8.3", 38 | "react-native": "^0.60" 39 | }, 40 | "jest": { 41 | "preset": "react-native", 42 | "setupFilesAfterEnv": [ 43 | "./jest/setup.js" 44 | ], 45 | "transform": { 46 | "^.+\\.js$": "/node_modules/react-native/jest/preprocessor.js" 47 | } 48 | }, 49 | "dependencies": { 50 | "@babel/runtime": "^7.14.8" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sample/ACPAnalyticsSampleApp/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /sample/ACPAnalyticsSampleApp/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /sample/ACPAnalyticsSampleApp/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | [untyped] 15 | .*/node_modules/@react-native-community/cli/.*/.* 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/interface.js 21 | node_modules/react-native/flow/ 22 | 23 | [options] 24 | emoji=true 25 | 26 | esproposal.optional_chaining=enable 27 | esproposal.nullish_coalescing=enable 28 | 29 | exact_by_default=true 30 | 31 | module.file_ext=.js 32 | module.file_ext=.json 33 | module.file_ext=.ios.js 34 | 35 | munge_underscores=true 36 | 37 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 38 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 39 | 40 | suppress_type=$FlowIssue 41 | suppress_type=$FlowFixMe 42 | suppress_type=$FlowFixMeProps 43 | suppress_type=$FlowFixMeState 44 | 45 | [lints] 46 | sketchy-null-number=warn 47 | sketchy-null-mixed=warn 48 | sketchy-number=warn 49 | untyped-type-import=warn 50 | nonstrict-import=warn 51 | deprecated-type=warn 52 | unsafe-getters-setters=warn 53 | unnecessary-invariant=warn 54 | signature-verification-failure=warn 55 | 56 | [strict] 57 | deprecated-type 58 | nonstrict-import 59 | sketchy-null 60 | unclear-type 61 | unsafe-getters-setters 62 | untyped-import 63 | untyped-type-import 64 | 65 | [version] 66 | ^0.137.0 67 | -------------------------------------------------------------------------------- /sample/ACPAnalyticsSampleApp/.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /sample/ACPAnalyticsSampleApp/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | -------------------------------------------------------------------------------- /sample/ACPAnalyticsSampleApp/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | arrowParens: 'avoid', 7 | }; 8 | -------------------------------------------------------------------------------- /sample/ACPAnalyticsSampleApp/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /sample/ACPAnalyticsSampleApp/App.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 Adobe. All rights reserved. 3 | This file is licensed to you under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software distributed under 8 | the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS 9 | OF ANY KIND, either express or implied. See the License for the specific language 10 | governing permissions and limitations under the License. 11 | 12 | @flow 13 | @format 14 | */ 15 | 16 | import React, {Component} from 'react'; 17 | import {Platform, StyleSheet, Text, View, Button, ScrollView, NativeModules} from 'react-native'; 18 | import {ACPCore} from '@adobe/react-native-acpcore'; 19 | import {ACPAnalytics} from '@adobe/react-native-acpanalytics'; 20 | 21 | type Props = {}; 22 | export default class App extends Component { 23 | render() { 24 | return ( 25 | 26 | 27 | ACPAnalytics Test App 28 |