├── .gitignore ├── CHANGELOG.md ├── LICENSE.txt ├── README.md ├── example ├── .bundle │ └── config ├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── Gemfile ├── Gemfile.lock ├── Utils.android.js ├── Utils.ios.js ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ ├── adjust.json │ │ │ ├── appsflyer.json │ │ │ ├── braze.json │ │ │ ├── facebook.json │ │ │ └── firebase.json │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── 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 │ ├── .xcode.env │ ├── Podfile │ ├── Podfile.lock │ ├── adjust.json │ ├── appsflyer.json │ ├── braze.json │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── example │ │ ├── AppDelegate.swift │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ ├── PrivacyInfo.xcprivacy │ │ ├── adjust.json │ │ ├── appsflyer.json │ │ ├── braze.json │ │ ├── facebook.json │ │ └── firebase.json │ ├── facebook.json │ └── firebase.json ├── jest.config.js ├── metro.config.js ├── package-lock.json ├── package.json ├── react-native.config.js └── tsconfig.json ├── modules ├── adobe-visitor │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── android │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tealium │ │ │ └── react │ │ │ └── adobevisitor │ │ │ ├── Extensions.kt │ │ │ └── TealiumReactAdobeVisitor.kt │ ├── common.ts │ ├── index.d.ts │ ├── index.js │ ├── ios │ │ ├── TealiumReactAdobeExtensions.swift │ │ ├── TealiumReactAdobeVisitor-Bridging-Header.h │ │ ├── TealiumReactAdobeVisitor.m │ │ ├── TealiumReactAdobeVisitor.swift │ │ └── TealiumReactAdobeVisitor.xcodeproj │ │ │ └── project.pbxproj │ ├── package.json │ └── tealium-react-adobe-visitor.podspec ├── attribution │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── android │ │ ├── build.gradle │ │ ├── gradle.properties │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tealium │ │ │ └── react │ │ │ └── attribution │ │ │ └── TealiumReactNativeAttribution.kt │ ├── common.ts │ ├── index.d.ts │ ├── index.js │ ├── ios │ │ ├── TealiumReactAttribution-Bridging-Header.h │ │ ├── TealiumReactAttribution.m │ │ └── TealiumReactAttribution.swift │ ├── package.json │ └── tealium-react-attribution.podspec ├── crash-reporter │ ├── LICENSE │ ├── README.md │ ├── android │ │ ├── build.gradle │ │ ├── gradle.properties │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tealium │ │ │ └── react │ │ │ └── crashreporter │ │ │ └── TealiumReactCrashReporter.kt │ ├── index.d.ts │ ├── index.js │ ├── ios │ │ ├── TealiumReactCrashReporter-Bridging-Header.h │ │ ├── TealiumReactCrashReporter.m │ │ ├── TealiumReactCrashReporter.swift │ │ └── TealiumReactCrashReporter.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── package.json │ └── tealium-react-native-crash-reporter.podspec ├── location │ ├── LICENSE │ ├── README.md │ ├── android │ │ ├── .dcignore │ │ ├── README.md │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── jacoco.exec │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tealium │ │ │ │ └── react │ │ │ │ └── location │ │ │ │ └── InstrumentedTests.kt │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tealium │ │ │ └── react │ │ │ └── location │ │ │ └── TealiumReactLocation.kt │ ├── common.ts │ ├── index.d.ts │ ├── index.js │ ├── ios │ │ ├── TealiumReactNativeLocation-Bridging-Header.h │ │ ├── TealiumReactNativeLocation.m │ │ ├── TealiumReactNativeLocation.swift │ │ └── TealiumReactNativeLocation.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcuserdata │ │ │ └── jameskeith.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── package.json │ └── tealium-react-native-location.podspec └── moments-api │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── android │ ├── build.gradle │ ├── gradle.properties │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── tealium │ │ └── react │ │ └── momentsapi │ │ ├── Extensions.kt │ │ └── TealiumReactNativeMomentsApi.kt │ ├── common.ts │ ├── index.d.ts │ ├── index.js │ ├── ios │ ├── TealiumReactMomentsApi-Bridging-Header.h │ ├── TealiumReactMomentsApi.m │ ├── TealiumReactMomentsApi.swift │ └── TealiumReactMomentsExtensions.swift │ ├── package.json │ └── tealium-react-moments-api.podspec ├── npm-package ├── LICENSE ├── README.md ├── android │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── tealium │ │ │ └── react │ │ │ └── InstrumentedTests.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── tealium │ │ │ └── react │ │ │ ├── Constants.kt │ │ │ ├── Extensions.kt │ │ │ ├── Listeners.kt │ │ │ ├── OptionalModule.kt │ │ │ ├── RemoteCommandFactory.kt │ │ │ └── TealiumReact.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── tealium │ │ └── react │ │ ├── ExtensionsTests.kt │ │ ├── ListenersTests.kt │ │ └── TealiumReactTests.kt ├── common.ts ├── index.d.ts ├── index.js ├── ios │ ├── EventEmitter.swift │ ├── OptionalModule.swift │ ├── RemoteCommandFactory.swift │ ├── TealiumReactConstants.swift │ ├── TealiumReactExtensions.swift │ ├── TealiumReactNative-Bridging-Header.h │ ├── TealiumReactNative.m │ ├── TealiumReactNative.swift │ ├── TealiumReactNative.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── christina.xcuserdatad │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ │ └── karentamayo.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── TealiumReactNative.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── TealiumWrapper.swift ├── package.json └── tealium-react-native.podspec └── remotecommands ├── tealium-react-adjust ├── .gitignore ├── LICENSE ├── README.md ├── android │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── tealium │ │ └── react │ │ └── adjust │ │ └── AdjustModule.kt ├── common.ts ├── index.d.ts ├── index.js ├── ios │ ├── AdjustRemoteCommandWrapper.swift │ ├── TealiumReactAdjust-Bridging-Header.h │ ├── TealiumReactAdjust.m │ ├── TealiumReactAdjust.swift │ └── TealiumReactAdjust.xcodeproj │ │ └── project.pbxproj ├── package.json └── tealium-react-adjust.podspec ├── tealium-react-appsflyer ├── .gitignore ├── LICENSE ├── README.md ├── android │ ├── build.gradle │ ├── gradle.properties │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── tealium │ │ └── react │ │ └── appsflyer │ │ └── AppsFlyerModule.kt ├── index.d.ts ├── index.js ├── ios │ ├── AppsFlyerRemoteCommandWrapper.swift │ ├── TealiumReactAppsFlyer-Bridging-Header.h │ ├── TealiumReactAppsFlyer.m │ ├── TealiumReactAppsFlyer.swift │ └── TealiumReactAppsFlyer.xcodeproj │ │ └── project.pbxproj ├── package.json └── tealium-react-appsflyer.podspec ├── tealium-react-braze ├── .gitignore ├── LICENSE ├── README.md ├── android │ ├── README.md │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── tealium │ │ └── react │ │ └── braze │ │ └── BrazeModule.kt ├── index.d.ts ├── index.js ├── ios │ ├── BrazeRemoteCommandWrapper.swift │ ├── TealiumReactBraze.m │ ├── TealiumReactBraze.swift │ ├── TealiumReactBraze.xcodeproj │ │ └── project.pbxproj │ └── TealiumReactBraze.xcworkspace │ │ └── contents.xcworkspacedata ├── package.json └── tealium-react-braze.podspec ├── tealium-react-facebook ├── .gitignore ├── LICENSE ├── README.md ├── android │ ├── README.md │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── tealium │ │ └── react │ │ └── facebook │ │ └── FacebookModule.kt ├── index.d.ts ├── index.js ├── ios │ ├── FacebookRemoteCommandWrapper.swift │ ├── TealiumReactFacebook.m │ ├── TealiumReactFacebook.swift │ ├── TealiumReactFacebook.xcodeproj │ │ └── project.pbxproj │ └── TealiumReactFacebook.xcworkspace │ │ └── contents.xcworkspacedata ├── package.json └── tealium-react-facebook.podspec └── tealium-react-firebase ├── .gitignore ├── .watchmanconfig ├── LICENSE ├── README.md ├── android ├── README.md ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── tealium │ │ └── react │ │ └── firebase │ │ └── FirebaseModule.kt │ └── test │ └── java │ └── com │ └── tealium │ └── react │ └── firebase │ └── FirebaseModuleTests.kt ├── index.d.ts ├── index.js ├── ios ├── Firebase.xcodeproj │ └── project.pbxproj ├── Firebase.xcworkspace │ └── contents.xcworkspacedata ├── FirebaseRemoteCommandWrapper.swift ├── TealiumReactFirebase.m ├── TealiumReactFirebase.swift └── tealium-react-firebase-Bridging-Header.h ├── package.json └── tealium-react-firebase.podspec /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/macos 3 | 4 | ### macOS ### 5 | *.DS_Store 6 | .AppleDouble 7 | .LSOverride 8 | 9 | # Xcode 10 | *.xcuserstate 11 | 12 | # Icon must end with two \r 13 | Icon 14 | 15 | # Thumbnails 16 | ._* 17 | 18 | # Files that might appear in the root of a volume 19 | .DocumentRevisions-V100 20 | .fseventsd 21 | .Spotlight-V100 22 | .TemporaryItems 23 | .Trashes 24 | .VolumeIcon.icns 25 | .com.apple.timemachine.donotpresent 26 | 27 | # Directories potentially created on remote AFP share 28 | .AppleDB 29 | .AppleDesktop 30 | Network Trash Folder 31 | Temporary Items 32 | .apdisk 33 | 34 | # Android/IntelliJ 35 | build/ 36 | .idea 37 | .gradle 38 | **/.gradle 39 | local.properties 40 | *.iml 41 | 42 | # node.js 43 | node_modules/ 44 | npm-debug.log 45 | yarn-error.log 46 | google-services.json 47 | GoogleService-Info.plist -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Tealium React Native 2 | 3 | This repository contains the necessary assets for exposing Tealium's native [Android](https://docs.tealium.com/platforms/android-kotlin/) and [iOS](https://docs.tealium.com/platforms/ios-swift/) mobile libraries to the JavaScript code in your React Native project. This includes code for exposing the native APIs for both platforms through React Native's bridging system, and a basic helper class in JavaScript to create a single cross platform API. 4 | 5 | You can also find a example application demonstrating how everything is put together and how the API gets called in JavaScript. 6 | 7 | ### Example App Instructions 8 | 9 | In order to run the example application, follow these steps using [yarn](https://yarnpkg.com/package/react-native): 10 | 11 | `$ cd example` 12 | 13 | `$ yarn add ../npm-package` 14 | 15 | #### iOS 16 | 17 | `$ cd ios && pod install && cd ..` 18 | 19 | `$ react-native start` 20 | 21 | In a separate terminal tab (but still in the example app directory): 22 | 23 | `$ yarn ios` 24 | 25 | #### Android 26 | 27 | `$ react-native start` 28 | 29 | In a separate terminal tab (but still in the example app directory): 30 | 31 | `$ yarn android` 32 | 33 | ## Documentation 34 | For full documentation, please see the Tealium Developer Docs website: 35 | 36 | [Tealium React Native Documentation](https://docs.tealium.com/platforms/react-native/install/) 37 | 38 | ## License 39 | 40 | Use of this software is subject to the terms and conditions of the license agreement contained in the file titled "LICENSE.txt". Please read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement. 41 | 42 | 43 | --- 44 | Copyright (C) 2012-2022, Tealium Inc. -------------------------------------------------------------------------------- /example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native', 4 | }; 5 | -------------------------------------------------------------------------------- /example/.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 | **/.xcode.env.local 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 33 | .cxx/ 34 | *.keystore 35 | !debug.keystore 36 | .kotlin/ 37 | 38 | # node.js 39 | # 40 | node_modules/ 41 | npm-debug.log 42 | yarn-error.log 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 | **/fastlane/test_output 55 | 56 | # Bundle artifact 57 | *.jsbundle 58 | 59 | # Ruby / CocoaPods 60 | **/Pods/ 61 | /vendor/bundle/ 62 | 63 | # Temporary files created by Metro to check the health of the file watcher 64 | .metro-health-check* 65 | 66 | # testing 67 | /coverage 68 | 69 | # Yarn 70 | .yarn/* 71 | !.yarn/patches 72 | !.yarn/plugins 73 | !.yarn/releases 74 | !.yarn/sdks 75 | !.yarn/versions 76 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby ">= 2.6.10" 5 | 6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures. 7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' 8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' 9 | gem 'xcodeproj', '< 1.26.0' 10 | gem 'concurrent-ruby', '< 1.3.4' 11 | -------------------------------------------------------------------------------- /example/Utils.android.js: -------------------------------------------------------------------------------- 1 | import { PermissionsAndroid } from 'react-native'; 2 | 3 | const checkAndRequestPermissions = async () => { 4 | try { 5 | const granted = await PermissionsAndroid.request( 6 | PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, 7 | { 8 | 'title': 'Example App', 9 | 'message': 'Example App access to your location ' 10 | }) 11 | 12 | if (granted === PermissionsAndroid.RESULTS.GRANTED) { 13 | console.log("Location permission is granted.") 14 | } else { 15 | console.log("location permission denied") 16 | alert("Location permission denied"); 17 | } 18 | return granted; 19 | } catch (err) { 20 | console.warn(err) 21 | return false; 22 | } 23 | } 24 | 25 | module.exports = { 26 | checkAndRequestPermissions 27 | } -------------------------------------------------------------------------------- /example/Utils.ios.js: -------------------------------------------------------------------------------- 1 | // import { } from 'react-native'; 2 | import { request, PERMISSIONS, RESULTS } from "react-native-permissions"; 3 | 4 | const checkAndRequestPermissions = async () => { 5 | const granted = await request( 6 | PERMISSIONS.IOS.LOCATION_WHEN_IN_USE, 7 | { 8 | title: 'Example App', 9 | message: 'Example App would like to access your location ', 10 | } 11 | ).catch(); 12 | 13 | return granted === RESULTS.GRANTED; 14 | } 15 | 16 | module.exports = { 17 | checkAndRequestPermissions 18 | } -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 15 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /example/android/app/src/main/assets/adjust.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "api_token": "YOUR_API_TOKEN", 4 | "sandbox": true, 5 | "settings": { 6 | "log_level": "verbose", 7 | "url_strategy" : "", 8 | "coppa_compliant": true, 9 | "play_store_kids_enabled": true 10 | } 11 | }, 12 | "mappings": { 13 | "event_token": "event_token", 14 | "push_token": "push_token", 15 | "order_total": "revenue", 16 | "order_currency": "currency", 17 | "order_id": "order_id", 18 | "deduplication_id": "deduplication_id", 19 | "callback_id": "callback_id", 20 | "source": "ad_revenue_source", 21 | "payload": "ad_revenue_payload", 22 | "ad_revenue_amount": "ad_revenue_payload.amount", 23 | "ad_revenue_currency": "ad_revenue_payload.currency", 24 | "deeplink_url": "deeplink_open_url", 25 | "sku": "sku", 26 | "signature": "signature", 27 | "purchase_token": "purchase_token", 28 | "event_param_1": "callback.param1", 29 | "event_param_2": "callback.param2", 30 | "partner_param_1": "partner.param1", 31 | "partner_param_2": "partner.param2", 32 | "global_param_1": "global_callback.param1", 33 | "global_param_2": "global_callback.param2", 34 | "global_callback_params": "global_callback", 35 | "partner_global_param_1": "global_partner.param1", 36 | "partner_global_param_2": "global_partner.param2", 37 | "global_partner_params": "global_partner", 38 | "consent_granted": "measurement_consent,third_party_sharing_enabled", 39 | "consent_opts": "third_party_sharing_options", 40 | "enabled": "enabled,offline" 41 | }, 42 | "commands": { 43 | "launch": "initialize", 44 | "purchase": "trackevent", 45 | "event": "trackevent", 46 | "track_deeplink": "appwillopenurl", 47 | "ad_revenue": "trackadrevenue", 48 | "subscribe": "tracksubscription", 49 | "push_token": "setpushtoken", 50 | "add_global_callback": "addglobalcallbackparams", 51 | "add_global_partner": "addglobalpartnerparams", 52 | "contact": "trackevent", 53 | "consent_revoked": "gdprforgetme,trackmeasurementconsent,setthirdpartysharing", 54 | "consent_granted": "trackmeasurementconsent,setthirdpartysharing", 55 | "disable": "setenabled", 56 | "offline": "setofflinemode" 57 | } 58 | } -------------------------------------------------------------------------------- /example/android/app/src/main/assets/appsflyer.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "app_id": "YOUR_APP_ID", 4 | "app_dev_key": "YOUR_DEV_KEY", 5 | "settings": { 6 | "custom_data": {"custom_key": "custom_value"}, 7 | "debug": true, 8 | "disable_ad_tracking": false, 9 | "disable_apple_ad_tracking": false, 10 | "time_between_sessions": 30, 11 | "anonymize_user": false, 12 | "collect_device_name": false 13 | } 14 | }, 15 | "mappings": { 16 | "latitude": "event.af_lat", 17 | "longitude": "event.af_long", 18 | "customer_email": "customer_emails", 19 | "currency_code": "af_currency", 20 | "customer_id": "af_customer_user_id", 21 | "signup_method": "event.signup_method", 22 | "achievement_id": "event.achievement_id", 23 | "checkout_option": "event.checkout_option", 24 | "checkout_step": "event.checkout_step", 25 | "content": "event.content", 26 | "content_type": "event.content_type", 27 | "coupon": "event.coupon", 28 | "product_brand": "event.product_brand", 29 | "product_category": "event.product_category", 30 | "product_id": "event.af_content_id", 31 | "product_list": "event.product_list", 32 | "product_location_id": "event.product_location_id", 33 | "product_name": "event.product_name", 34 | "product_variant": "event.product_variant", 35 | "product_unit_price": "event.af_price", 36 | "product_quantity": "event.af_quantity", 37 | "current_level": "event.level", 38 | "score": "event.score", 39 | "search_keyword": "event.search_keyword", 40 | "order_shipping_amount": "event.order_shipping", 41 | "order_tax_amount": "event.order_tax", 42 | "order_id": "event.af_order_id", 43 | "order_total": "event.af_revenue", 44 | "currency_type": "af_currency" 45 | }, 46 | "commands": { 47 | "launch": "initialize", 48 | "track_location": "tracklocation", 49 | "user_login": "login", 50 | "user_register": "setuseremails,setcustomerid,completeregistration", 51 | "show_offers": "adclick", 52 | "cart_add": "addtocart", 53 | "wishlist_add": "addtowishlist", 54 | "payment": "addpaymentinfo", 55 | "unlock_achievement": "achievementunlocked", 56 | "level_up": "levelachieved,customersegment", 57 | "email_signup": "subscribe", 58 | "product": "contentview", 59 | "share": "share", 60 | "rate": "rate", 61 | "search": "search", 62 | "invite": "invite", 63 | "checkout": "initiatecheckout", 64 | "order": "purchase", 65 | "listview": "listview", 66 | "home_screen": "screen_view", 67 | "set_currency": "setcurrencycode", 68 | "set_host": "sethost", 69 | "custom_event": "custom_event" 70 | } 71 | } -------------------------------------------------------------------------------- /example/android/app/src/main/assets/facebook.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "applicationid": "YOUR_APP_ID", 4 | "clienttoken": "YOUR_CLIENT_TOKEN", 5 | "accesstoken": "YOUR_ACCESS_TOKEN", 6 | "userid": "YOUR_USER_ID", 7 | "auto_log_events_enabled": true, 8 | "auto_init_enabled": true, 9 | "advertiser_id_collection_enabled": true, 10 | "debug": true 11 | }, 12 | "mappings": { 13 | "achievement_type": "event.fb_description", 14 | "level": "event.fb_level", 15 | "order_id": "fb_purchase_parameters.fb_order_id", 16 | "registration_method": "event.fb_registration_method", 17 | "customer_email": "user.em", 18 | "customer_first_name": "user.fn", 19 | "customer_last_name": "user.ln", 20 | "customer_phone": "user.ph", 21 | "customer_dob": "user.dob", 22 | "customer_gender": "user.ge", 23 | "customer_city": "user.ct", 24 | "customer_state": "user.st", 25 | "customer_zip": "user.zp", 26 | "customer_country": "user.country", 27 | "customer_id": "fb_user_id", 28 | "customer_update_value": "fb_user_value", 29 | "customer_update_key": "fb_user_key", 30 | "product_id": "product_item.fb_product_item_id,event.fb_content_id", 31 | "product_availability": "product_item.fb_product_availability", 32 | "product_condition": "product_item.fb_product_condition", 33 | "product_description": "product_item.fb_product_description,event.fb_product_description", 34 | "product_image_url": "product_item.fb_product_image_link", 35 | "product_url": "product_item.fb_product_link", 36 | "product_name": "product_item.fb_product_title", 37 | "product_gtin": "product_item.fb_product_gtin", 38 | "product_brand": "product_item.fb_product_brand", 39 | "product_unit_price": "product_item.fb_product_price_amount,_valueToSum", 40 | "currency": "product_item.fb_product_price_currency,purchase.fb_purchase_currency,event.fb_currency", 41 | "order_subtotal": "purchase.fb_purchase_amount", 42 | "bulk_discount": "fb_purchase_parameters.bulk_discount,fb_product_parameters.bulk_discount", 43 | "online_store_id": "fb_purchase_parameters.online_store_id,fb_product_parameters.online_store_id", 44 | "push_action": "push.fb_push_action", 45 | "push_payload": "push.fb_push_payload" 46 | }, 47 | "commands": { 48 | "launch": "initialize,setautologappeventsenabled,setautoinitenabled,enableadvertiseridcollection", 49 | "setuser": "setuser", 50 | "setuserid": "setuserid", 51 | "updateuservalue": "updateuservalue", 52 | "achievelevel": "achievedlevel", 53 | "completedregistration": "completedregistration", 54 | "unlockachievement": "unlockedachievement", 55 | "addtocart": "addedtocart", 56 | "logproductitem": "logproductitem", 57 | "logpurchase": "logpurchase", 58 | "flush": "flush", 59 | "customfbevent": "customfbevent" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import com.facebook.react.ReactActivity 4 | import com.facebook.react.ReactActivityDelegate 5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled 6 | import com.facebook.react.defaults.DefaultReactActivityDelegate 7 | 8 | class MainActivity : ReactActivity() { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. This is used to schedule 12 | * rendering of the component. 13 | */ 14 | override fun getMainComponentName(): String = "example" 15 | 16 | /** 17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] 18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] 19 | */ 20 | override fun createReactActivityDelegate(): ReactActivityDelegate = 21 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) 22 | } 23 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import android.app.Application 4 | import com.facebook.react.PackageList 5 | import com.facebook.react.ReactApplication 6 | import com.facebook.react.ReactHost 7 | import com.facebook.react.ReactNativeHost 8 | import com.facebook.react.ReactPackage 9 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load 10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost 11 | import com.facebook.react.defaults.DefaultReactNativeHost 12 | import com.facebook.react.soloader.OpenSourceMergedSoMapping 13 | import com.facebook.soloader.SoLoader 14 | 15 | class MainApplication : Application(), ReactApplication { 16 | 17 | override val reactNativeHost: ReactNativeHost = 18 | object : DefaultReactNativeHost(this) { 19 | override fun getPackages(): List = 20 | PackageList(this).packages.apply { 21 | // Packages that cannot be autolinked yet can be added manually here, for example: 22 | // add(MyReactNativePackage()) 23 | } 24 | 25 | override fun getJSMainModuleName(): String = "index" 26 | 27 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG 28 | 29 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED 30 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED 31 | } 32 | 33 | override val reactHost: ReactHost 34 | get() = getDefaultReactHost(applicationContext, reactNativeHost) 35 | 36 | override fun onCreate() { 37 | super.onCreate() 38 | SoLoader.init(this, OpenSourceMergedSoMapping) 39 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 40 | // If you opted-in for the New Architecture, we load the native entry point for this app. 41 | load() 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | buildToolsVersion = "35.0.0" 4 | minSdkVersion = 24 5 | compileSdkVersion = 35 6 | targetSdkVersion = 35 7 | ndkVersion = "27.1.12297006" 8 | kotlinVersion = "2.0.21" 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle") 16 | classpath("com.facebook.react:react-native-gradle-plugin") 17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") 18 | } 19 | } 20 | 21 | allprojects { 22 | repositories { 23 | maven { 24 | url "https://maven.tealiumiq.com/android/releases/" 25 | } 26 | } 27 | } 28 | 29 | apply plugin: "com.facebook.react.rootproject" 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | 25 | # Use this property to specify which architecture you want to build. 26 | # You can also override it from the CLI using 27 | # ./gradlew -PreactNativeArchitectures=x86_64 28 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 29 | 30 | # Use this property to enable support to the new architecture. 31 | # This will allow you to use TurboModules and the Fabric render in 32 | # your application. You should enable this flag either if you want 33 | # to write custom TurboModules/Fabric components OR use libraries that 34 | # are providing them. 35 | newArchEnabled=true 36 | 37 | # Use this property to enable or disable the Hermes JS engine. 38 | # If set to false, you will be using JSC instead. 39 | hermesEnabled=true 40 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } 2 | plugins { id("com.facebook.react.settings") } 3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } 4 | rootProject.name = 'com.example' 5 | include ':app' 6 | includeBuild('../node_modules/@react-native/gradle-plugin') 7 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:@react-native/babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /example/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Resolve react_native_pods.rb with node to allow for hoisting 2 | require Pod::Executable.execute_command('node', ['-p', 3 | 'require.resolve( 4 | "react-native/scripts/react_native_pods.rb", 5 | {paths: [process.argv[1]]}, 6 | )', __dir__]).strip 7 | 8 | platform :ios, min_ios_version_supported 9 | prepare_react_native_project! 10 | 11 | linkage = ENV['USE_FRAMEWORKS'] 12 | if linkage != nil 13 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 14 | use_frameworks! :linkage => linkage.to_sym 15 | end 16 | 17 | target 'example' do 18 | use_frameworks! :linkage => :static 19 | config = use_native_modules! 20 | 21 | pre_install do |installer| 22 | Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} 23 | 24 | installer.pod_targets.each do |pod| 25 | if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-') 26 | def pod.build_type; 27 | Pod::BuildType.static_library # >= 1.9 28 | end 29 | end 30 | end 31 | end 32 | 33 | use_react_native!( 34 | :path => config[:reactNativePath], 35 | # An absolute path to your application root. 36 | :app_path => "#{Pod::Config.instance.installation_root}/.." 37 | ) 38 | 39 | permissions_path = '../node_modules/react-native-permissions/ios' 40 | pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy" 41 | pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways" 42 | pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse" 43 | post_install do |installer| 44 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 45 | react_native_post_install( 46 | installer, 47 | config[:reactNativePath], 48 | :mac_catalyst_enabled => false, 49 | # :ccache_enabled => true 50 | ) 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /example/ios/adjust.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "api_token": "YOUR_API_TOKEN", 4 | "sandbox": true, 5 | "settings": { 6 | "log_level": "verbose", 7 | "allow_iad": true, 8 | "allow_ad_services": true, 9 | "allow_idfa": true, 10 | "event_buffering_enabled": false, 11 | "send_in_background": true, 12 | "url_strategy": "" 13 | } 14 | }, 15 | "mappings": { 16 | "event_token": "event_token", 17 | "order_total": "revenue", 18 | "order_total_string": "callback.orderTotal", 19 | "order_currency": "currency", 20 | "order_id": "order_id,callback.order_id,deduplication_id,callback.deduplication_id", 21 | "conversion_value": "conversion_value", 22 | "sales_region": "sales_region", 23 | "callback_id": "callback_id", 24 | "ad_revenue_source": "ad_revenue_source", 25 | "ad_revenue_amount": "ad_revenue_payload.amount", 26 | "ad_revenue_currency": "ad_revenue_payload.currency", 27 | "purchase_timestamp": "purchase_time", 28 | "deeplink_url": "deeplink_open_url", 29 | "push_token": "push_token", 30 | "favorite_color": "callback.color,global_callback.color", 31 | "num_of_pets": "partner.pets,global_partner.pets", 32 | "customer_id": "callback.customerId", 33 | "customer_is_member": "partner.isMember", 34 | "global_params": "global_callback,global_partner", 35 | "remove_global_params": "remove_global_callback_params,remove_global_partner_params", 36 | "reset_global_params": "reset_global_callback_params,reset_global_partner_params", 37 | "consent_granted": "measurement_consent", 38 | "enabled": "enabled", 39 | "sharing_options": "third_party_sharing_options" 40 | }, 41 | "commands": { 42 | "launch": "initialize", 43 | "track_deeplink": "appwillopenurl", 44 | "purchase": "trackevent,updateconversionvalue", 45 | "event": "trackevent", 46 | "contact": "trackevent,addglobalcallbackparams,addglobalpartnerparams", 47 | "ad_revenue": "trackadrevenue", 48 | "subscribe": "trackevent,tracksubscription", 49 | "received_push_token": "setpushtoken", 50 | "add_global_parameters": "addglobalcallbackparams,addglobalpartnerparams", 51 | "remove_global_parameters": "removeglobalcallbackparams,removeglobalpartnerparams", 52 | "reset_global_parameters": "resetglobalcallbackparams,resetglobalpartnerparams", 53 | "consent_revoked": "gdprforgetme,trackmeasurementconsent", 54 | "consent_granted": "trackmeasurementconsent", 55 | "set_enabled": "setenabled", 56 | "offline": "setofflinemode", 57 | "third_party_sharing": "setthirdpartysharing" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import React 3 | import React_RCTAppDelegate 4 | import ReactAppDependencyProvider 5 | 6 | @main 7 | class AppDelegate: RCTAppDelegate { 8 | override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 9 | self.moduleName = "example" 10 | self.dependencyProvider = RCTAppDependencyProvider() 11 | 12 | // You can add your custom initial props in the dictionary below. 13 | // They will be passed down to the ViewController used by React Native. 14 | self.initialProps = [:] 15 | 16 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 17 | } 18 | 19 | override func sourceURL(for bridge: RCTBridge) -> URL? { 20 | self.bundleURL() 21 | } 22 | 23 | override func bundleURL() -> URL? { 24 | #if DEBUG 25 | RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") 26 | #else 27 | Bundle.main.url(forResource: "main", withExtension: "jsbundle") 28 | #endif 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSAllowsLocalNetworking 32 | 33 | 34 | NSLocationWhenInUseUsageDescription 35 | 36 | RCTNewArchEnabled 37 | 38 | UILaunchStoryboardName 39 | LaunchScreen 40 | UIRequiredDeviceCapabilities 41 | 42 | arm64 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /example/ios/example/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryUserDefaults 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | CA92.1 13 | 1C8F.1 14 | C56D.1 15 | 16 | 17 | 18 | NSPrivacyAccessedAPIType 19 | NSPrivacyAccessedAPICategoryFileTimestamp 20 | NSPrivacyAccessedAPITypeReasons 21 | 22 | C617.1 23 | 24 | 25 | 26 | NSPrivacyAccessedAPIType 27 | NSPrivacyAccessedAPICategoryDiskSpace 28 | NSPrivacyAccessedAPITypeReasons 29 | 30 | E174.1 31 | 32 | 33 | 34 | NSPrivacyAccessedAPIType 35 | NSPrivacyAccessedAPICategorySystemBootTime 36 | NSPrivacyAccessedAPITypeReasons 37 | 38 | 35F9.1 39 | 40 | 41 | 42 | NSPrivacyCollectedDataTypes 43 | 44 | NSPrivacyTracking 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/example/adjust.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "api_token": "YOUR_API_TOKEN", 4 | "sandbox": true, 5 | "settings": { 6 | "log_level": "verbose", 7 | "allow_iad": true, 8 | "allow_ad_services": true, 9 | "allow_idfa": true, 10 | "event_buffering_enabled": false, 11 | "send_in_background": true, 12 | "url_strategy": "" 13 | } 14 | }, 15 | "mappings": { 16 | "event_token": "event_token", 17 | "order_total": "revenue", 18 | "order_total_string": "callback.orderTotal", 19 | "order_currency": "currency", 20 | "order_id": "order_id,callback.order_id,deduplication_id,callback.deduplication_id", 21 | "conversion_value": "conversion_value", 22 | "sales_region": "sales_region", 23 | "callback_id": "callback_id", 24 | "ad_revenue_source": "ad_revenue_source", 25 | "ad_revenue_amount": "ad_revenue_payload.amount", 26 | "ad_revenue_currency": "ad_revenue_payload.currency", 27 | "purchase_timestamp": "purchase_time", 28 | "deeplink_url": "deeplink_open_url", 29 | "push_token": "push_token", 30 | "favorite_color": "callback.color,global_callback.color", 31 | "num_of_pets": "partner.pets,global_partner.pets", 32 | "customer_id": "callback.customerId", 33 | "customer_is_member": "partner.isMember", 34 | "global_params": "global_callback,global_partner", 35 | "remove_global_params": "remove_global_callback_params,remove_global_partner_params", 36 | "reset_global_params": "reset_global_callback_params,reset_global_partner_params", 37 | "consent_granted": "measurement_consent", 38 | "enabled": "enabled", 39 | "sharing_options": "third_party_sharing_options" 40 | }, 41 | "commands": { 42 | "launch": "initialize", 43 | "track_deeplink": "appwillopenurl", 44 | "purchase": "trackevent,updateconversionvalue", 45 | "event": "trackevent", 46 | "contact": "trackevent,addglobalcallbackparams,addglobalpartnerparams", 47 | "ad_revenue": "trackadrevenue", 48 | "subscribe": "trackevent,tracksubscription", 49 | "received_push_token": "setpushtoken", 50 | "add_global_parameters": "addglobalcallbackparams,addglobalpartnerparams", 51 | "remove_global_parameters": "removeglobalcallbackparams,removeglobalpartnerparams", 52 | "reset_global_parameters": "resetglobalcallbackparams,resetglobalpartnerparams", 53 | "consent_revoked": "gdprforgetme,trackmeasurementconsent", 54 | "consent_granted": "trackmeasurementconsent", 55 | "set_enabled": "setenabled", 56 | "offline": "setofflinemode", 57 | "third_party_sharing": "setthirdpartysharing" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /example/ios/example/facebook.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "applicationid": "YOUR_APP_ID", 4 | "clienttoken": "YOUR_CLIENT_TOKEN", 5 | "accesstoken": "YOUR_ACCESS_TOKEN", 6 | "userid": "YOUR_USER_ID", 7 | "auto_log_events_enabled": true, 8 | "auto_init_enabled": true, 9 | "advertiser_id_collection_enabled": true, 10 | "debug": true 11 | }, 12 | "mappings": { 13 | "achievement_type": "event.fb_description", 14 | "level": "event.fb_level", 15 | "order_id": "fb_purchase_parameters.fb_order_id", 16 | "registration_method": "event.fb_registration_method", 17 | "customer_email": "user.em", 18 | "customer_first_name": "user.fn", 19 | "customer_last_name": "user.ln", 20 | "customer_phone": "user.ph", 21 | "customer_dob": "user.dob", 22 | "customer_gender": "user.ge", 23 | "customer_city": "user.ct", 24 | "customer_state": "user.st", 25 | "customer_zip": "user.zp", 26 | "customer_country": "user.country", 27 | "customer_id": "fb_user_id", 28 | "customer_update_value": "fb_user_value", 29 | "customer_update_key": "fb_user_key", 30 | "product_id": "product_item.fb_product_item_id,event.fb_content_id", 31 | "product_availability": "product_item.fb_product_availability", 32 | "product_condition": "product_item.fb_product_condition", 33 | "product_description": "product_item.fb_product_description,event.fb_product_description", 34 | "product_image_url": "product_item.fb_product_image_link", 35 | "product_url": "product_item.fb_product_link", 36 | "product_name": "product_item.fb_product_title", 37 | "product_gtin": "product_item.fb_product_gtin", 38 | "product_brand": "product_item.fb_product_brand", 39 | "product_unit_price": "product_item.fb_product_price_amount,fb_value_to_sum", 40 | "currency": "product_item.fb_product_price_currency,purchase.fb_purchase_currency", 41 | "order_subtotal": "purchase.fb_purchase_amount", 42 | "bulk_discount": "fb_purchase_parameters.bulk_discount,fb_product_parameters.bulk_discount", 43 | "online_store_id": "fb_purchase_parameters.online_store_id,fb_product_parameters.online_store_id", 44 | "push_action": "push.fb_push_action", 45 | "push_payload": "push.fb_push_payload" 46 | }, 47 | "commands": { 48 | "launch": "initialize,setautologappeventsenabled,setautoinitenabled,enableadvertiseridcollection", 49 | "setuser": "setuser", 50 | "setuserid": "setuserid", 51 | "updateuservalue": "updateuservalue", 52 | "achievelevel": "achievedlevel", 53 | "completedregistration": "completedregistration", 54 | "unlockachievement": "unlockedachievement", 55 | "addtocart": "addedtocart", 56 | "logproductitem": "logproductitem", 57 | "logpurchase": "logpurchase", 58 | "flush": "flush", 59 | "customfbevent": "customfbevent" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /example/ios/facebook.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "applicationid": "YOUR_APP_ID", 4 | "clienttoken": "YOUR_CLIENT_TOKEN", 5 | "accesstoken": "YOUR_ACCESS_TOKEN", 6 | "userid": "YOUR_USER_ID", 7 | "auto_log_events_enabled": true, 8 | "auto_init_enabled": true, 9 | "advertiser_id_collection_enabled": true, 10 | "debug": true 11 | }, 12 | "mappings": { 13 | "achievement_type": "event.fb_description", 14 | "level": "event.fb_level", 15 | "order_id": "fb_purchase_parameters.fb_order_id", 16 | "registration_method": "event.fb_registration_method", 17 | "customer_email": "user.em", 18 | "customer_first_name": "user.fn", 19 | "customer_last_name": "user.ln", 20 | "customer_phone": "user.ph", 21 | "customer_dob": "user.dob", 22 | "customer_gender": "user.ge", 23 | "customer_city": "user.ct", 24 | "customer_state": "user.st", 25 | "customer_zip": "user.zp", 26 | "customer_country": "user.country", 27 | "customer_id": "fb_user_id", 28 | "customer_update_value": "fb_user_value", 29 | "customer_update_key": "fb_user_key", 30 | "product_id": "product_item.fb_product_item_id,event.fb_content_id", 31 | "product_availability": "product_item.fb_product_availability", 32 | "product_condition": "product_item.fb_product_condition", 33 | "product_description": "product_item.fb_product_description,event.fb_product_description", 34 | "product_image_url": "product_item.fb_product_image_link", 35 | "product_url": "product_item.fb_product_link", 36 | "product_name": "product_item.fb_product_title", 37 | "product_gtin": "product_item.fb_product_gtin", 38 | "product_brand": "product_item.fb_product_brand", 39 | "product_unit_price": "product_item.fb_product_price_amount,fb_value_to_sum", 40 | "currency": "product_item.fb_product_price_currency,purchase.fb_purchase_currency", 41 | "order_subtotal": "purchase.fb_purchase_amount", 42 | "bulk_discount": "fb_purchase_parameters.bulk_discount,fb_product_parameters.bulk_discount", 43 | "online_store_id": "fb_purchase_parameters.online_store_id,fb_product_parameters.online_store_id", 44 | "push_action": "push.fb_push_action", 45 | "push_payload": "push.fb_push_payload" 46 | }, 47 | "commands": { 48 | "launch": "initialize,setautologappeventsenabled,setautoinitenabled,enableadvertiseridcollection", 49 | "setuser": "setuser", 50 | "setuserid": "setuserid", 51 | "updateuservalue": "updateuservalue", 52 | "achievelevel": "achievedlevel", 53 | "completedregistration": "completedregistration", 54 | "unlockachievement": "unlockedachievement", 55 | "addtocart": "addedtocart", 56 | "logproductitem": "logproductitem", 57 | "logpurchase": "logpurchase", 58 | "flush": "flush", 59 | "customfbevent": "customfbevent" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /example/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'react-native', 3 | }; 4 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://metrobundler.dev/docs/configuration 4 | * 5 | * @format 6 | */ 7 | const path = require('path'); 8 | 9 | const extraNodeModules = { 10 | 'tealium-react-native': path.resolve(__dirname, '..', 'npm-package'), 11 | 'tealium-react-native-adobe-visitor': path.resolve(__dirname, '..', 'modules', 'adobe-visitor'), 12 | 'tealium-react-native-attribution': path.resolve(__dirname, '..', 'modules', 'attribution'), 13 | 'tealium-react-native-crash-reporter': path.resolve(__dirname, '..', 'modules', 'crash-reporter'), 14 | 'tealium-react-native-location': path.resolve(__dirname, '..', 'modules', 'location'), 15 | 'tealium-react-native-moments-api': path.resolve(__dirname, '..', 'modules', 'moments-api'), 16 | 'tealium-react-adjust': path.resolve(__dirname, '..', 'remotecommands', 'tealium-react-adjust'), 17 | 'tealium-react-appsflyer': path.resolve(__dirname, '..', 'remotecommands', 'tealium-react-appsflyer'), 18 | 'tealium-react-braze': path.resolve(__dirname, '..', 'remotecommands', 'tealium-react-braze'), 19 | 'tealium-react-firebase': path.resolve(__dirname, '..', 'remotecommands', 'tealium-react-firebase'), 20 | 'tealium-react-facebook': path.resolve(__dirname, '..', 'remotecommands', 'tealium-react-facebook'), 21 | }; 22 | const watchFolders = [ 23 | path.resolve(__dirname, '..', 'npm-package'), 24 | path.resolve(__dirname, '..', 'modules'), 25 | path.resolve(__dirname, '..', 'remotecommands'), 26 | ]; 27 | 28 | const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); 29 | 30 | const defaultConfig = getDefaultConfig(__dirname); 31 | 32 | const { 33 | resolver: { sourceExts, assetExts }, 34 | } = getDefaultConfig(__dirname); 35 | 36 | const config = { 37 | watchFolders, 38 | transformer: { 39 | getTransformOptions: async () => ({ 40 | transform: { 41 | experimentalImportSupport: false, 42 | inlineRequires: true, 43 | }, 44 | }), 45 | babelTransformerPath: require.resolve('react-native-svg-transformer'), 46 | }, 47 | resolver: { 48 | nodeModulesPaths: [path.resolve(__dirname, 'node_modules')], 49 | extraNodeModules, 50 | assetExts: assetExts.filter(ext => ext !== 'svg'), 51 | sourceExts: [...sourceExts, 'svg'], 52 | }, 53 | }; 54 | 55 | module.exports = mergeConfig(defaultConfig, config); -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.example", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "lint": "eslint .", 9 | "start": "react-native start", 10 | "test": "jest" 11 | }, 12 | "dependencies": { 13 | "react": "19.1.1", 14 | "react-native": "^0.82.0", 15 | "react-native-permissions": "^3.6.1", 16 | "react-native-svg-transformer": "^1.5.0", 17 | "tealium-react-adjust": "../remotecommands/tealium-react-adjust", 18 | "tealium-react-appsflyer": "../remotecommands/tealium-react-appsflyer", 19 | "tealium-react-braze": "../remotecommands/tealium-react-braze", 20 | "tealium-react-facebook": "../remotecommands/tealium-react-facebook", 21 | "tealium-react-firebase": "../remotecommands/tealium-react-firebase", 22 | "tealium-react-native": "../npm-package", 23 | "tealium-react-native-attribution": "../modules/attribution", 24 | "tealium-react-native-crash-reporter": "../modules/crash-reporter", 25 | "tealium-react-native-location": "../modules/location", 26 | "tealium-react-native-moments-api": "../modules/moments-api" 27 | }, 28 | "devDependencies": { 29 | "@babel/core": "^7.25.2", 30 | "@babel/preset-env": "^7.25.3", 31 | "@babel/runtime": "^7.25.0", 32 | "@react-native-community/cli": "^20.0.0", 33 | "@react-native-community/cli-platform-android": "^20.0.0", 34 | "@react-native-community/cli-platform-ios": "^20.0.0", 35 | "@react-native/babel-preset": "^0.82.0", 36 | "@react-native/eslint-config": "0.78.0", 37 | "@react-native/metro-config": "^0.82.0", 38 | "@react-native/typescript-config": "0.78.0", 39 | "@types/jest": "^29.5.13", 40 | "@types/react": "^19.0.0", 41 | "@types/react-test-renderer": "^19.0.0", 42 | "eslint": "^8.19.0", 43 | "jest": "^29.2.1", 44 | "prettier": "2.8.8", 45 | "react-test-renderer": "19.1.1", 46 | "typescript": "5.0.4" 47 | }, 48 | "engines": { 49 | "node": ">=18" 50 | }, 51 | "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" 52 | } 53 | -------------------------------------------------------------------------------- /example/react-native.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | dependencies: { 3 | 'react-native-permissions': { 4 | platforms: { 5 | android: null, 6 | ios: {} 7 | }, 8 | }, 9 | }, 10 | }; -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@react-native/typescript-config/tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /modules/adobe-visitor/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # node.js 6 | # 7 | node_modules/ 8 | npm-debug.log 9 | yarn-error.log 10 | 11 | # Xcode 12 | # 13 | build/ 14 | *.pbxuser 15 | !default.pbxuser 16 | *.mode1v3 17 | !default.mode1v3 18 | *.mode2v3 19 | !default.mode2v3 20 | *.perspectivev3 21 | !default.perspectivev3 22 | xcuserdata 23 | *.xccheckout 24 | *.moved-aside 25 | DerivedData 26 | *.hmap 27 | *.ipa 28 | *.xcuserstate 29 | project.xcworkspace 30 | 31 | # Android/IntelliJ 32 | # 33 | build/ 34 | .idea 35 | .gradle 36 | local.properties 37 | *.iml 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | -------------------------------------------------------------------------------- /modules/adobe-visitor/README.md: -------------------------------------------------------------------------------- 1 | ## Tealium React Native 2 | 3 | This repository contains the necessary assets for exposing Tealium's native [Android](https://docs.tealium.com/platforms/android-kotlin/) and [iOS](https://docs.tealium.com/platforms/ios-swift/) mobile libraries to the JavaScript code in your React Native project. This includes code for exposing the native APIs for both platforms through React Native's bridging system, and a basic helper class in JavaScript to create a single cross platform API. 4 | 5 | You can also find a example application demonstrating how everything is put together and how the API gets called in JavaScript. 6 | 7 | ## Documentation 8 | For full documentation, please see the Tealium Developer Docs website: 9 | 10 | [Tealium React Native Documentation](https://docs.tealium.com/platforms/react-native/install/) 11 | 12 | ## License 13 | 14 | Use of this software is subject to the terms and conditions of the license agreement contained in the file titled "LICENSE.txt". Please read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement. 15 | 16 | 17 | --- 18 | Copyright (C) 2012-2023, Tealium Inc. -------------------------------------------------------------------------------- /modules/adobe-visitor/android/build.gradle: -------------------------------------------------------------------------------- 1 | def DEFAULT_COMPILE_SDK_VERSION = 31 2 | def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2' 3 | def DEFAULT_MIN_SDK_VERSION = 21 4 | def DEFAULT_TARGET_SDK_VERSION = 31 5 | 6 | def safeExtGet(prop, fallback) { 7 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 8 | } 9 | 10 | apply plugin: 'com.android.library' 11 | apply plugin: 'kotlin-android' 12 | 13 | buildscript { 14 | ext { 15 | kotlinVersion = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.0' 16 | } 17 | 18 | if (project == rootProject) { 19 | repositories { 20 | google() 21 | mavenCentral() 22 | maven { 23 | url "https://maven.tealiumiq.com/android/releases/" 24 | } 25 | } 26 | dependencies { 27 | classpath 'com.android.tools.build:gradle:4.2.2' 28 | } 29 | } 30 | 31 | repositories { 32 | mavenCentral() 33 | } 34 | dependencies { 35 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}" 36 | } 37 | } 38 | 39 | version = "1.2.1" 40 | 41 | android { 42 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 43 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 44 | 45 | defaultConfig { 46 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 47 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 48 | 49 | buildConfigField "String", "TAG", "\"Tealium-React-Adobe-Visitor-$version\"" 50 | } 51 | 52 | lintOptions { 53 | disable 'GradleCompatible' 54 | } 55 | 56 | def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() 57 | if(agpVersion < 8) { 58 | compileOptions { 59 | sourceCompatibility JavaVersion.VERSION_11 60 | targetCompatibility JavaVersion.VERSION_11 61 | } 62 | 63 | kotlinOptions { 64 | jvmTarget = JavaVersion.VERSION_11 65 | } 66 | } 67 | } 68 | 69 | repositories { 70 | // ref: https://www.baeldung.com/maven-local-repository 71 | mavenLocal() 72 | maven { 73 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 74 | url "$rootDir/../node_modules/react-native/android" 75 | } 76 | 77 | maven { 78 | // Android JSC is installed from npm 79 | url "$rootDir/../node_modules/jsc-android/dist" 80 | } 81 | 82 | maven { 83 | url "https://maven.tealiumiq.com/android/releases/" 84 | } 85 | 86 | google() 87 | mavenCentral() 88 | } 89 | 90 | 91 | dependencies { 92 | // noinspection GradleDynamicVersion 93 | implementation 'com.facebook.react:react-native:+' 94 | 95 | // Tealium React Native 96 | implementation project(":tealium-react-native") 97 | 98 | // Tealium 99 | implementation 'com.tealium:kotlin-core:1.9.1' 100 | implementation 'com.tealium:kotlin-adobe-visitor:1.1.2' 101 | 102 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${project.ext.kotlinVersion}" 103 | } 104 | -------------------------------------------------------------------------------- /modules/adobe-visitor/android/gradle.properties: -------------------------------------------------------------------------------- 1 | TealiumReactAdobeVisitor_kotlinVersion=1.7.0 2 | TealiumReactAdobeVisitor_minSdkVersion=21 3 | TealiumReactAdobeVisitor_targetSdkVersion=31 4 | TealiumReactAdobeVisitor_compileSdkVersion=31 5 | TealiumReactAdobeVisitor_ndkversion=21.4.7075529 6 | android.useAndroidX=true 7 | android.enableJetifier=false 8 | -------------------------------------------------------------------------------- /modules/adobe-visitor/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/modules/adobe-visitor/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /modules/adobe-visitor/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /modules/adobe-visitor/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /modules/adobe-visitor/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /modules/adobe-visitor/android/src/main/java/com/tealium/react/adobevisitor/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.adobevisitor 2 | 3 | import com.facebook.react.bridge.Arguments 4 | import com.facebook.react.bridge.ReadableMap 5 | import com.tealium.adobe.api.AdobeVisitor 6 | 7 | fun AdobeVisitor.toReadableMap(): ReadableMap { 8 | val map = Arguments.createMap() 9 | map.putString("experienceCloudId", this.experienceCloudId) 10 | map.putInt("idSyncTtl", this.idSyncTTL) 11 | map.putInt("region", this.region) 12 | map.putString("blob", this.blob) 13 | map.putDouble("nextRefresh", this.nextRefresh.time.toDouble()) 14 | return map 15 | } -------------------------------------------------------------------------------- /modules/adobe-visitor/common.ts: -------------------------------------------------------------------------------- 1 | export enum AuthState { 2 | undefined = -1, 3 | unknown = 0, 4 | authenticated = 1, 5 | loggedOut = 2 6 | } 7 | 8 | export interface TealiumAdobeVisitorConfig { 9 | adobeVisitorOrgId : string; 10 | adobeVisitorExistingEcid ?: string; 11 | adobeVisitorRetries ?: number; 12 | adobeVisitorAuthState ?: AuthState; 13 | adobeVisitorDataProviderId ?: string; 14 | adobeVisitorCustomVisitorId ?: string; 15 | } 16 | 17 | export class TealiumAdobeVisitorCommon {} -------------------------------------------------------------------------------- /modules/adobe-visitor/index.d.ts: -------------------------------------------------------------------------------- 1 | import { TealiumAdobeVisitorConfig, TealiumAdobeVisitorCommon, AuthState} from './common'; 2 | 3 | declare module 'tealium-react-native-adobe-visitor' { 4 | export default TealiumAdobeVisitor; 5 | class TealiumAdobeVisitor extends TealiumAdobeVisitorCommon { 6 | 7 | /** 8 | * Configures the Tealium Adobe Visitor module 9 | * @param config configuration properties for Adobe Visitor module 10 | */ 11 | public static configure(config: TealiumAdobeVisitorConfig): void; 12 | 13 | /** 14 | * Sets an existing ECID for a known visitor 15 | */ 16 | public static linkEcidToKnownIdentifier(knownId: String, adobeDataProviderId: String, authState?: AuthState | number, callback?:(response: any) => void): void; 17 | 18 | /** 19 | * Fetch Adobe Visitor 20 | */ 21 | public static getAdobeVisitor(callback:(response: String) => void): void; 22 | 23 | /** 24 | * Resets current visitor 25 | */ 26 | public static resetVisitor(): void; 27 | 28 | /** 29 | * Decorates url with ECID visitor data 30 | */ 31 | public static decorateUrl(url: String, callback:(response: String) => void): void; 32 | 33 | /** 34 | * Retrieves URL parameters to be manually appended to a URL for special URL schemes (e.g. Angular) 35 | */ 36 | public static getUrlParameters(callback:(response: any) => void): void; 37 | } 38 | } -------------------------------------------------------------------------------- /modules/adobe-visitor/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules } from 'react-native'; 2 | import { AuthState } from './common'; 3 | const { TealiumReactAdobeVisitor } = NativeModules; 4 | 5 | export default class TealiumAdobeVisitor { 6 | 7 | static configure(config) { 8 | TealiumReactAdobeVisitor.configure(config) 9 | } 10 | 11 | static linkEcidToKnownIdentifier(knownId, adobeDataProviderId, authState, callback) { 12 | if(authState == undefined) { 13 | TealiumReactAdobeVisitor.linkEcidToKnownIdentifier(knownId, adobeDataProviderId, -1, callback) 14 | } else { 15 | TealiumReactAdobeVisitor.linkEcidToKnownIdentifier(knownId, adobeDataProviderId, authState, callback) 16 | } 17 | } 18 | 19 | static getAdobeVisitor(callback) { 20 | TealiumReactAdobeVisitor.getCurrentAdobeVisitor(callback) 21 | } 22 | 23 | static resetVisitor() { 24 | TealiumReactAdobeVisitor.resetVisitor() 25 | } 26 | 27 | static decorateUrl(url, callback) { 28 | TealiumReactAdobeVisitor.decorateUrl(url, callback) 29 | } 30 | 31 | static getUrlParameters(callback) { 32 | TealiumReactAdobeVisitor.getUrlParameters(callback) 33 | } 34 | } -------------------------------------------------------------------------------- /modules/adobe-visitor/ios/TealiumReactAdobeExtensions.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TealiumAdobeVisitorAPI 3 | 4 | 5 | extension AdobeVisitor { 6 | func asDictionary() -> [String: Any]? { 7 | guard let idSyncTTL = self.idSyncTTL, let idSyncTTL = Int(idSyncTTL), 8 | let dcsRegion = self.dcsRegion, let dcsRegion = Int(dcsRegion), 9 | let blob = self.blob, 10 | let nextRefresh = self.nextRefresh, let nextRefresh = Int(nextRefresh.unixTimeMilliseconds) 11 | else { 12 | return nil 13 | } 14 | return [ 15 | "experienceCloudId": self.experienceCloudID, 16 | "idSyncTtl": idSyncTTL, 17 | "region": dcsRegion, 18 | "blob": blob, 19 | "nextRefresh": nextRefresh, 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /modules/adobe-visitor/ios/TealiumReactAdobeVisitor-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | -------------------------------------------------------------------------------- /modules/adobe-visitor/ios/TealiumReactAdobeVisitor.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RCT_EXTERN_MODULE(TealiumReactAdobeVisitor, NSObject) 4 | RCT_EXTERN_METHOD(configure:(NSDictionary *)config) 5 | RCT_EXTERN_METHOD(getCurrentAdobeVisitor:(RCTResponseSenderBlock)callback) 6 | RCT_EXTERN_METHOD(linkEcidToKnownIdentifier:(NSString)knownId adobeDataProviderId: (NSString)adobeDataProviderId authState: (nonnull NSNumber*)authState callback: (RCTResponseSenderBlock*)callback) 7 | RCT_EXTERN_METHOD(resetVisitor) 8 | RCT_EXTERN_METHOD(decorateUrl:(NSString)url callback: (RCTResponseSenderBlock)) 9 | RCT_EXTERN_METHOD(getUrlParameters:(RCTResponseSenderBlock)callback) 10 | @end 11 | -------------------------------------------------------------------------------- /modules/adobe-visitor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-native-adobe-visitor", 3 | "title": "Tealium React Native Adobe Visitor Service", 4 | "version": "1.2.1", 5 | "description": "A native module for using Tealium's Adobe Visitor Service module for Kotlin and Swift libraries.", 6 | "main": "index.js", 7 | "types": "*.ts", 8 | "homepage": "https://github.com/Tealium/tealium-react-native", 9 | "bugs": "https://github.com/Tealium/tealium-react-native/issues", 10 | "files": [ 11 | "README.md", 12 | "LICENSE", 13 | "android", 14 | "!android/build", 15 | "common.ts", 16 | "index.js", 17 | "index.d.ts", 18 | "ios", 19 | "tealium-react-adobe-visitor.podspec" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 24 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 25 | }, 26 | "keywords": [ 27 | "react-native", 28 | "tealium" 29 | ], 30 | "author": { 31 | "name": "Tealium" 32 | }, 33 | "contributors": [ 34 | "Karen Tamayo" 35 | ], 36 | "license": "Commercial", 37 | "licenseFilename": "LICENSE", 38 | "readmeFilename": "README.md", 39 | "peerDependencies": { 40 | "react": ">=16.8.1 || < 19.0.0", 41 | "react-native": ">=0.60.0-rc.0 <1.0.x" 42 | }, 43 | "devDependencies": { 44 | "react": "^17.0.2", 45 | "react-native": "^0.67.1" 46 | }, 47 | "dependencies": { 48 | "tealium-react-native": "^2.6.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /modules/adobe-visitor/tealium-react-adobe-visitor.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "tealium-react-adobe-visitor" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | Tealium React Native Adobe Plugin 11 | DESC 12 | s.homepage = "https://github.com/Tealium/tealium-react-native/modules/adobe-visitor" 13 | s.license = { :type => "Commercial", :file => "LICENSE" } 14 | s.authors = { "Tyler Rister" => "tyler.rister@tealium.com" } 15 | s.platforms = { :ios => "12.0" } 16 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 17 | s.source_files = "ios/**/*.{h,c,m,swift}" 18 | s.requires_arc = true 19 | s.swift_version = "5.0" 20 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 21 | 22 | s.dependency "React-Core" 23 | s.dependency "tealium-react-native", "~> 2.6" 24 | s.dependency "TealiumAdobeVisitorAPI", "~> 1.2" 25 | s.dependency "tealium-swift/Core", "~> 2.18" 26 | 27 | end 28 | -------------------------------------------------------------------------------- /modules/attribution/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .classpath 35 | .cxx 36 | .gradle 37 | .idea 38 | .project 39 | .settings 40 | local.properties 41 | android.iml 42 | 43 | # Cocoapods 44 | # 45 | example/ios/Pods 46 | 47 | # Ruby 48 | example/vendor/ 49 | 50 | # node.js 51 | # 52 | node_modules/ 53 | npm-debug.log 54 | yarn-debug.log 55 | yarn-error.log 56 | 57 | # BUCK 58 | buck-out/ 59 | \.buckd/ 60 | android/app/libs 61 | android/keystores/debug.keystore 62 | 63 | # Yarn 64 | .yarn/* 65 | !.yarn/patches 66 | !.yarn/plugins 67 | !.yarn/releases 68 | !.yarn/sdks 69 | !.yarn/versions 70 | 71 | # Expo 72 | .expo/ 73 | 74 | # Turborepo 75 | .turbo/ 76 | 77 | # generated by bob 78 | lib/ 79 | -------------------------------------------------------------------------------- /modules/attribution/README.md: -------------------------------------------------------------------------------- 1 | ## Tealium React Native 2 | 3 | This repository contains the necessary assets for exposing Tealium's native [Android](https://docs.tealium.com/platforms/android-kotlin/) and [iOS](https://docs.tealium.com/platforms/ios-swift/) mobile libraries to the JavaScript code in your React Native project. This includes code for exposing the native APIs for both platforms through React Native's bridging system, and a basic helper class in JavaScript to create a single cross platform API. 4 | 5 | You can also find a example application demonstrating how everything is put together and how the API gets called in JavaScript. 6 | 7 | ## Documentation 8 | For full documentation, please see the Tealium Developer Docs website: 9 | 10 | [Tealium React Native Documentation](https://docs.tealium.com/platforms/react-native/install/) 11 | 12 | ## License 13 | 14 | Use of this software is subject to the terms and conditions of the license agreement contained in the file titled "LICENSE.txt". Please read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement. 15 | 16 | 17 | --- 18 | Copyright (C) 2012-2024, Tealium Inc. -------------------------------------------------------------------------------- /modules/attribution/android/build.gradle: -------------------------------------------------------------------------------- 1 | def DEFAULT_COMPILE_SDK_VERSION = 31 2 | def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2' 3 | def DEFAULT_MIN_SDK_VERSION = 21 4 | def DEFAULT_TARGET_SDK_VERSION = 31 5 | 6 | def safeExtGet(prop, fallback) { 7 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 8 | } 9 | 10 | apply plugin: 'com.android.library' 11 | apply plugin: 'kotlin-android' 12 | 13 | buildscript { 14 | ext { 15 | kotlinVersion = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.0' 16 | } 17 | 18 | if (project == rootProject) { 19 | repositories { 20 | google() 21 | mavenCentral() 22 | maven { 23 | url "https://maven.tealiumiq.com/android/releases/" 24 | } 25 | } 26 | dependencies { 27 | classpath 'com.android.tools.build:gradle:4.2.2' 28 | } 29 | } 30 | 31 | repositories { 32 | mavenCentral() 33 | } 34 | dependencies { 35 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}" 36 | } 37 | } 38 | 39 | version = "1.1.1" 40 | 41 | android { 42 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 43 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 44 | 45 | defaultConfig { 46 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 47 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 48 | 49 | buildConfigField "String", "TAG", "\"Tealium-React-Attribution-$version\"" 50 | } 51 | 52 | lintOptions { 53 | disable 'GradleCompatible' 54 | } 55 | 56 | def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() 57 | if(agpVersion < 8) { 58 | compileOptions { 59 | sourceCompatibility JavaVersion.VERSION_11 60 | targetCompatibility JavaVersion.VERSION_11 61 | } 62 | 63 | kotlinOptions { 64 | jvmTarget = JavaVersion.VERSION_11 65 | } 66 | } 67 | } 68 | 69 | repositories { 70 | // ref: https://www.baeldung.com/maven-local-repository 71 | mavenLocal() 72 | maven { 73 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 74 | url "$rootDir/../node_modules/react-native/android" 75 | } 76 | 77 | maven { 78 | // Android JSC is installed from npm 79 | url "$rootDir/../node_modules/jsc-android/dist" 80 | } 81 | 82 | maven { 83 | url "https://maven.tealiumiq.com/android/releases/" 84 | } 85 | 86 | google() 87 | mavenCentral() 88 | } 89 | 90 | 91 | dependencies { 92 | // noinspection GradleDynamicVersion 93 | implementation 'com.facebook.react:react-native:+' 94 | 95 | // Tealium React Native 96 | implementation project(":tealium-react-native") 97 | 98 | // Tealium Install Referrer 99 | implementation 'com.tealium:kotlin-install-referrer:1.1.1' 100 | implementation 'com.tealium:kotlin-ad-identifier:1.1.2' 101 | 102 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${project.ext.kotlinVersion}" 103 | } 104 | -------------------------------------------------------------------------------- /modules/attribution/android/gradle.properties: -------------------------------------------------------------------------------- 1 | TealiumReactNativeAttribution_kotlinVersion=1.7.0 2 | TealiumReactNativeAttribution_minSdkVersion=21 3 | TealiumReactNativeAttribution_targetSdkVersion=31 4 | TealiumReactNativeAttribution_compileSdkVersion=31 5 | TealiumReactNativeAttribution_ndkversion=21.4.7075529 6 | -------------------------------------------------------------------------------- /modules/attribution/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /modules/attribution/common.ts: -------------------------------------------------------------------------------- 1 | export interface AttributionConfig { 2 | androidInstallReferrerEnabled?: boolean; 3 | androidAdIdentifierEnabled?: boolean; 4 | iosSearchAdsEnabled?: boolean; 5 | iosSkAdAttributionEnabled?: boolean; 6 | iosSkAdConversionKeys?: { [key: string]: string }; 7 | } 8 | 9 | export class TealiumAttributionCommon{} -------------------------------------------------------------------------------- /modules/attribution/index.d.ts: -------------------------------------------------------------------------------- 1 | import { AttributionConfig, TealiumAttributionCommon } from "./common"; 2 | 3 | declare module 'tealium-react-native-attribution'{ 4 | export default TealiumAttribution; 5 | class TealiumAttribution extends TealiumAttributionCommon { 6 | 7 | /** 8 | * Configures Tealium Attrubtion module. 9 | * @param config Configuration properties for Attribution modile 10 | */ 11 | public static configure(config?: AttributionConfig): void; 12 | 13 | /** 14 | * Android only. Clears values and removes ad information from 15 | * the data layer related to Ad Identifier module in Tealium 16 | * Android library. 17 | */ 18 | public static removeAdInfo(): void; 19 | 20 | /** 21 | * Android only. Clears values and removes app set ID from 22 | * the data layer related to Ad Identifier modules in Tealium 23 | * Android library. 24 | */ 25 | public static removeAppSetIdInfo(): void; 26 | } 27 | } -------------------------------------------------------------------------------- /modules/attribution/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | const { TealiumReactAttribution } = NativeModules; 3 | 4 | export default class TealiumAttribution { 5 | 6 | /** 7 | * Configures the Tealium Attrubtion module. 8 | * @param config configuration properties for Attribution modile 9 | */ 10 | static configure(config) { 11 | TealiumReactAttribution.configure(config || {}) 12 | } 13 | 14 | /** 15 | * Android only. Clears values and removes ad information from 16 | * the data layer related to Ad Identifier module in Tealium 17 | * Android library. 18 | */ 19 | static removeAdInfo() { 20 | if (Platform.OS === 'android') { 21 | TealiumReactAttribution.removeAdInfo() 22 | } 23 | } 24 | 25 | /** 26 | * Android only. Clears values and removes app set ID from 27 | * the data layer related to Ad Identifier modules in Tealium 28 | * Android library. 29 | */ 30 | static removeAppSetIdInfo() { 31 | if (Platform.OS === 'android') { 32 | TealiumReactAttribution.removeAppSetIdInfo() 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /modules/attribution/ios/TealiumReactAttribution-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | -------------------------------------------------------------------------------- /modules/attribution/ios/TealiumReactAttribution.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RCT_EXTERN_MODULE(TealiumReactAttribution, NSObject) 4 | 5 | RCT_EXTERN_METHOD(configure:(NSDictionary *)config) 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /modules/attribution/ios/TealiumReactAttribution.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import tealium_react_native 3 | import TealiumSwift 4 | 5 | @objc(TealiumReactAttribution) 6 | class TealiumReactAttribution: NSObject, RCTBridgeModule { 7 | static func moduleName() -> String! { 8 | return "TealiumReactAttribution" 9 | } 10 | 11 | private let KEY_ATTRIBUTION_SEARCH_ADS_ENABLED = "iosSearchAdsEnabled" 12 | private let KEY_ATTRIBUTION_SKAD_ATTRIBUTION_ENABLED = "iosSkAdAttributionEnabled" 13 | private let KEY_ATTRIBUTION_SKAD_CONVERSION_KEYS = "iosSkAdConversionKeys" 14 | let module = TealiumReactAttributionModule() 15 | 16 | @objc 17 | static func requiresMainQueueSetup() -> Bool { 18 | return false 19 | } 20 | 21 | override init() { 22 | super.init() 23 | TealiumReactNative.registerOptionalModule(module) 24 | } 25 | 26 | @objc(configure:) 27 | public func configure(_ config: [String: Any]) { 28 | if let searchAds = config[KEY_ATTRIBUTION_SEARCH_ADS_ENABLED] as? Bool { 29 | module.setSearchAdsEnabled(enabled: searchAds) 30 | } 31 | 32 | if let skAdAttribution = config[KEY_ATTRIBUTION_SKAD_ATTRIBUTION_ENABLED] as? Bool { 33 | module.setSkAdAttributionEnabled(enabled: skAdAttribution) 34 | } 35 | 36 | if let skAdKeys = config[KEY_ATTRIBUTION_SKAD_CONVERSION_KEYS] as? [String: String] { 37 | module.setSkAdConversionKeys(keys: skAdKeys) 38 | } 39 | } 40 | } 41 | 42 | @objc class TealiumReactAttributionModule: NSObject, OptionalModule { 43 | private var searchAdsEnabled: Bool? = nil 44 | private var skAdAttributionEnabled: Bool? = nil 45 | private var skAdConversionKeys: [String: String]? = nil 46 | 47 | func configure(config: TealiumConfig) { 48 | config.collectors?.append(Collectors.Attribution) 49 | 50 | if let searchAds = searchAdsEnabled { 51 | config.searchAdsEnabled = searchAds 52 | } 53 | 54 | if let skAdAttrubution = skAdAttributionEnabled { 55 | config.skAdAttributionEnabled = skAdAttrubution 56 | } 57 | 58 | if let conversionKeys = skAdConversionKeys { 59 | config.skAdConversionKeys = conversionKeys 60 | } 61 | } 62 | 63 | func setSearchAdsEnabled(enabled: Bool) { 64 | searchAdsEnabled = enabled 65 | } 66 | 67 | func setSkAdAttributionEnabled(enabled: Bool) { 68 | skAdAttributionEnabled = enabled 69 | } 70 | 71 | func setSkAdConversionKeys(keys: [String: String]) { 72 | skAdConversionKeys = keys 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /modules/attribution/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-native-attribution", 3 | "title": "Tealium React Native Attribution Module", 4 | "version": "1.1.1", 5 | "description": "A native module for using Tealium's Install Referrer and Ad Identifier for Kotlin library, as well as Attribution for Swift library.", 6 | "main": "index.js", 7 | "types": "*.ts", 8 | "homepage": "https://github.com/Tealium/tealium-react-native", 9 | "bugs": "https://github.com/Tealium/tealium-react-native/issues", 10 | "files": [ 11 | "README.md", 12 | "LICENSE", 13 | "android", 14 | "!android/build", 15 | "common.ts", 16 | "index.js", 17 | "index.d.ts", 18 | "ios", 19 | "tealium-react-attribution.podspec" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 24 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 25 | }, 26 | "keywords": [ 27 | "react-native", 28 | "tealium" 29 | ], 30 | "author": { 31 | "name": "Tealium" 32 | }, 33 | "contributors": [ 34 | "Karen Tamayo" 35 | ], 36 | "license": "Commercial", 37 | "licenseFilename": "LICENSE", 38 | "readmeFilename": "README.md", 39 | "peerDependencies": { 40 | "react": ">=16.8.1 || < 19.0.0", 41 | "react-native": ">=0.60.0-rc.0 <1.0.x" 42 | }, 43 | "devDependencies": { 44 | "react": "^17.0.2", 45 | "react-native": "^0.67.1" 46 | }, 47 | "dependencies": { 48 | "tealium-react-native": "^2.6.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /modules/attribution/tealium-react-attribution.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "tealium-react-attribution" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | Tealium React Native Attribution Plugin 11 | DESC 12 | s.homepage = "https://github.com/Tealium/tealium-react-native/modules" 13 | s.license = { :type => "Commercial", :file => "LICENSE" } 14 | s.authors = { "Tealium" => "mobile-dev@tealium.com" } 15 | s.platforms = { :ios => "12.0" } 16 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 17 | s.source_files = "ios/**/*.{h,c,m,swift}" 18 | s.requires_arc = true 19 | s.swift_version = "5.0" 20 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 21 | 22 | s.dependency "React-Core" 23 | s.dependency "tealium-react-native", "~> 2.6" 24 | s.dependency "tealium-swift/Core", "~> 2.18" 25 | s.dependency "tealium-swift/Attribution", "~> 2.18" 26 | 27 | end 28 | -------------------------------------------------------------------------------- /modules/crash-reporter/README.md: -------------------------------------------------------------------------------- 1 | ## Tealium React Native 2 | 3 | This repository contains the necessary assets for exposing Tealium's native [Android](https://docs.tealium.com/platforms/android-kotlin/) and [iOS](https://docs.tealium.com/platforms/ios-swift/) mobile libraries to the JavaScript code in your React Native project. This includes code for exposing the native APIs for both platforms through React Native's bridging system, and a basic helper class in JavaScript to create a single cross platform API. 4 | 5 | You can also find a example application demonstrating how everything is put together and how the API gets called in JavaScript. 6 | 7 | ## Documentation 8 | For full documentation, please see the Tealium Developer Docs website: 9 | 10 | [Tealium React Native Documentation](https://docs.tealium.com/platforms/react-native/install/) 11 | 12 | ## License 13 | 14 | Use of this software is subject to the terms and conditions of the license agreement contained in the file titled "LICENSE.txt". Please read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement. 15 | 16 | 17 | --- 18 | Copyright (C) 2012-2023, Tealium Inc. -------------------------------------------------------------------------------- /modules/crash-reporter/android/build.gradle: -------------------------------------------------------------------------------- 1 | def DEFAULT_COMPILE_SDK_VERSION = 33 2 | def DEFAULT_BUILD_TOOLS_VERSION = '30.0.3' 3 | def DEFAULT_MIN_SDK_VERSION = 21 4 | def DEFAULT_TARGET_SDK_VERSION = 33 5 | 6 | def safeExtGet(prop, fallback) { 7 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 8 | } 9 | 10 | apply plugin: 'com.android.library' 11 | apply plugin: 'kotlin-android' 12 | 13 | buildscript { 14 | ext { 15 | kotlinVersion = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.0' 16 | } 17 | 18 | if (project == rootProject) { 19 | repositories { 20 | google() 21 | mavenCentral() 22 | maven { 23 | url "https://maven.tealiumiq.com/android/releases/" 24 | } 25 | } 26 | dependencies { 27 | classpath 'com.android.tools.build:gradle:4.2.2' 28 | } 29 | } 30 | 31 | repositories { 32 | mavenCentral() 33 | } 34 | dependencies { 35 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}" 36 | } 37 | } 38 | 39 | version = "1.2.2" 40 | 41 | android { 42 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 43 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 44 | 45 | defaultConfig { 46 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 47 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 48 | 49 | buildConfigField "String", "TAG", "\"Tealium-React-Adobe-Visitor-$version\"" 50 | } 51 | 52 | lintOptions { 53 | disable 'GradleCompatible' 54 | } 55 | 56 | def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() 57 | if(agpVersion < 8) { 58 | compileOptions { 59 | sourceCompatibility JavaVersion.VERSION_11 60 | targetCompatibility JavaVersion.VERSION_11 61 | } 62 | 63 | kotlinOptions { 64 | jvmTarget = JavaVersion.VERSION_11 65 | } 66 | } 67 | } 68 | 69 | repositories { 70 | // ref: https://www.baeldung.com/maven-local-repository 71 | mavenLocal() 72 | maven { 73 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 74 | url "$rootDir/../node_modules/react-native/android" 75 | } 76 | 77 | maven { 78 | // Android JSC is installed from npm 79 | url "$rootDir/../node_modules/jsc-android/dist" 80 | } 81 | 82 | maven { 83 | url "https://maven.tealiumiq.com/android/releases/" 84 | } 85 | 86 | google() 87 | mavenCentral() 88 | } 89 | 90 | 91 | dependencies { 92 | // noinspection GradleDynamicVersion 93 | implementation 'com.facebook.react:react-native:+' 94 | 95 | // Tealium React Native 96 | implementation project(":tealium-react-native") 97 | 98 | // Tealium 99 | implementation 'com.tealium:kotlin-core:1.9.1' 100 | implementation 'com.tealium:kotlin-crash-reporter:1.1.0' 101 | 102 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${project.ext.kotlinVersion}" 103 | } 104 | -------------------------------------------------------------------------------- /modules/crash-reporter/android/gradle.properties: -------------------------------------------------------------------------------- 1 | TealiumReactCrashReporter_kotlinVersion=1.7.0 2 | TealiumReactCrashReporter_minSdkVersion=21 3 | TealiumReactCrashReporter_targetSdkVersion=31 4 | TealiumReactCrashReporter_compileSdkVersion=31 5 | TealiumReactCrashReporter_ndkversion=21.4.7075529 6 | -------------------------------------------------------------------------------- /modules/crash-reporter/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /modules/crash-reporter/android/src/main/java/com/tealium/react/crashreporter/TealiumReactCrashReporter.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.crashreporter 2 | 3 | import android.view.View 4 | import com.facebook.react.ReactPackage 5 | import com.facebook.react.bridge.NativeModule 6 | import com.facebook.react.bridge.ReactApplicationContext 7 | import com.facebook.react.bridge.ReactContextBaseJavaModule 8 | import com.facebook.react.bridge.ReactMethod 9 | import com.facebook.react.uimanager.ReactShadowNode 10 | import com.facebook.react.uimanager.ViewManager 11 | import com.tealium.core.Modules 12 | import com.tealium.core.TealiumConfig 13 | import com.tealium.crashreporter.CrashReporter 14 | import com.tealium.crashreporter.truncateCrashReporterStackTraces 15 | import com.tealium.react.OptionalModule 16 | import com.tealium.react.TealiumReact 17 | 18 | class TealiumReactCrashReporterPackage : ReactPackage { 19 | override fun createNativeModules(reactContext: ReactApplicationContext): MutableList { 20 | return mutableListOf(TealiumReactCrashReporter(reactContext)) 21 | } 22 | 23 | override fun createViewManagers(reactContext: ReactApplicationContext): MutableList>> { 24 | return mutableListOf() 25 | } 26 | } 27 | 28 | class TealiumReactCrashReporter(private val reactContext: ReactApplicationContext) : 29 | ReactContextBaseJavaModule(reactContext), 30 | OptionalModule { 31 | 32 | private var _truncateStackTraces: Boolean = false 33 | 34 | @ReactMethod 35 | fun initialize(truncateStackTrace: Boolean) { 36 | _truncateStackTraces = truncateStackTrace 37 | } 38 | 39 | override fun initialize() { 40 | super.initialize() 41 | reactContext.getNativeModule(TealiumReact::class.java)?.registerOptionalModule(this) 42 | } 43 | 44 | override fun configure(config: TealiumConfig) { 45 | config.modules.add(Modules.CrashReporter) 46 | config.truncateCrashReporterStackTraces = _truncateStackTraces 47 | } 48 | 49 | override fun getName(): String { 50 | return MODULE_NAME 51 | } 52 | 53 | companion object { 54 | const val MODULE_NAME = "TealiumReactCrashReporter" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /modules/crash-reporter/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'tealium-react-native-crash-reporter' { 2 | export default TealiumCrashReporter; 3 | class TealiumCrashReporter { 4 | public static initialize(truncateStackTrack?: boolean): void; 5 | } 6 | } -------------------------------------------------------------------------------- /modules/crash-reporter/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | 3 | const { TealiumReactCrashReporter } = NativeModules; 4 | 5 | export default class TealiumCrashReporter { 6 | 7 | /** 8 | * Initializes the Tealium Crash Reporter module 9 | * @param truncateStackTrack Android only. Option to truncate the Crash Reporter's stack trace 10 | */ 11 | static initialize(truncateStackTrack) { 12 | if (Platform.OS == 'ios') { 13 | TealiumReactCrashReporter.initialize(); 14 | } else { 15 | if(truncateStackTrack == undefined) { 16 | TealiumReactCrashReporter.initialize(false); 17 | } else { 18 | TealiumReactCrashReporter.initialize(truncateStackTrack); 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /modules/crash-reporter/ios/TealiumReactCrashReporter-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | -------------------------------------------------------------------------------- /modules/crash-reporter/ios/TealiumReactCrashReporter.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RCT_EXTERN_MODULE(TealiumReactCrashReporter, NSObject) 4 | RCT_EXTERN_METHOD(initialize) 5 | @end 6 | -------------------------------------------------------------------------------- /modules/crash-reporter/ios/TealiumReactCrashReporter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import tealium_react_native 3 | import TealiumSwift 4 | import TealiumCrashModule 5 | 6 | @objc(TealiumReactCrashReporter) 7 | class TealiumReactCrashReporter: NSObject, RCTBridgeModule { 8 | static func moduleName() -> String! { 9 | return "TealiumReactCrashReporter" 10 | } 11 | let module = TealiumReactCrashReporterModule() 12 | 13 | @objc 14 | static func requiresMainQueueSetup() -> Bool { 15 | return false 16 | } 17 | 18 | override init() { 19 | super.init() 20 | TealiumReactNative.registerOptionalModule(module) 21 | } 22 | 23 | @objc(initialize) 24 | public func initialize() { 25 | TealiumReactNative.registerOptionalModule(module) 26 | } 27 | } 28 | 29 | class TealiumReactCrashReporterModule: NSObject, OptionalModule { 30 | func configure(config: TealiumConfig) { 31 | config.collectors?.append(Collectors.Crash) 32 | } 33 | } -------------------------------------------------------------------------------- /modules/crash-reporter/ios/TealiumReactCrashReporter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /modules/crash-reporter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-native-crash-reporter", 3 | "title": "Tealium React Native Crash Reporter", 4 | "version": "1.2.2", 5 | "description": "A native module for using Tealium's Crash Reporter Module for Kotlin and Swift libraries.", 6 | "main": "index.js", 7 | "types": "*.ts", 8 | "homepage": "https://github.com/Tealium/tealium-react-native", 9 | "bugs": "https://github.com/Tealium/tealium-react-native/issues", 10 | "files": [ 11 | "README.md", 12 | "LICENSE", 13 | "android", 14 | "!android/build", 15 | "common.ts", 16 | "index.js", 17 | "index.d.ts", 18 | "ios", 19 | "tealium-react-native-crash-reporter.podspec" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 24 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 25 | }, 26 | "keywords": [ 27 | "react-native", 28 | "tealium" 29 | ], 30 | "author": { 31 | "name": "Tealium" 32 | }, 33 | "contributors": [ 34 | "Karen Tamayo" 35 | ], 36 | "license": "Commercial", 37 | "licenseFilename": "LICENSE", 38 | "readmeFilename": "README.md", 39 | "peerDependencies": { 40 | "react": ">=16.8.1 || < 19.0.0", 41 | "react-native": ">=0.60.0-rc.0 <1.0.x", 42 | "tealium-react-native": "^2.6.0" 43 | }, 44 | "devDependencies": { 45 | "react": "^17.0.2", 46 | "react-native": "^0.67.1" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /modules/crash-reporter/tealium-react-native-crash-reporter.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "tealium-react-native-crash-reporter" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | Tealium React Native Crash Reporter Plugin 11 | DESC 12 | s.homepage = "https://github.com/Tealium/tealium-react-native/modules/crash-reporter" 13 | s.license = { :type => "Commercial", :file => "LICENSE" } 14 | s.authors = { "James Keith" => "james.keith@tealium.com" } 15 | s.platforms = { :ios => "12.0" } 16 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 17 | s.source_files = "ios/**/*.{h,c,m,swift}" 18 | s.requires_arc = true 19 | s.swift_version = "5.0" 20 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 21 | 22 | s.dependency "React-Core" 23 | s.dependency "tealium-react-native", "~> 2.6" 24 | s.dependency "tealium-swift/Core", "~> 2.18" 25 | s.dependency "TealiumCrashModule", "~> 2.5" 26 | 27 | end 28 | -------------------------------------------------------------------------------- /modules/location/README.md: -------------------------------------------------------------------------------- 1 | ## Tealium React Native 2 | 3 | This repository contains the necessary assets for exposing Tealium's native [Android](https://docs.tealium.com/platforms/android-kotlin/) and [iOS](https://docs.tealium.com/platforms/ios-swift/) mobile libraries to the JavaScript code in your React Native project. This includes code for exposing the native APIs for both platforms through React Native's bridging system, and a basic helper class in JavaScript to create a single cross platform API. 4 | 5 | You can also find a example application demonstrating how everything is put together and how the API gets called in JavaScript. 6 | 7 | ## Documentation 8 | For full documentation, please see the Tealium Developer Docs website: 9 | 10 | [Tealium React Native Documentation](https://docs.tealium.com/platforms/react-native/install/) 11 | 12 | ## License 13 | 14 | Use of this software is subject to the terms and conditions of the license agreement contained in the file titled "LICENSE.txt". Please read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement. 15 | 16 | 17 | --- 18 | Copyright (C) 2012-2021, Tealium Inc. -------------------------------------------------------------------------------- /modules/location/android/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /modules/location/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /modules/location/android/jacoco.exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/modules/location/android/jacoco.exec -------------------------------------------------------------------------------- /modules/location/android/src/androidTest/java/com/tealium/react/location/InstrumentedTests.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.location -------------------------------------------------------------------------------- /modules/location/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /modules/location/common.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Specifies accuracy level 3 | */ 4 | export enum Accuracy { 5 | high = "high", 6 | low = "low" 7 | } 8 | 9 | /** 10 | * Holder for Latitude and Longitude coordinates 11 | */ 12 | export interface LocationData { 13 | lat: string; 14 | lng: string; 15 | } 16 | 17 | /** 18 | * Applicable to iOS Only 19 | */ 20 | export enum DesiredAccuracy { 21 | bestForNavigation = "bestForNavigation", 22 | best = "best", 23 | nearestTenMeters = "nearestTenMeters", 24 | nearestHundredMeters = "nearestHundredMeters", 25 | reduced = "reduced", 26 | withinOneKilometer = "withinOneKilometer", 27 | withinThreeKilometers = "withinThreeKilometers" 28 | } 29 | 30 | export interface TealiumLocationConfig { 31 | /** 32 | * Specifies the URL of the file containing 33 | * the geofence specifications 34 | */ 35 | geofenceUrl ?: string; 36 | 37 | /** 38 | * Specifies the local path to the file containing 39 | * the geofence specifications 40 | */ 41 | geofenceFile ?: string; 42 | 43 | /** 44 | * Specifies the accuracy to use when tracking location 45 | */ 46 | accuracy ?: Accuracy | Boolean; 47 | 48 | /** 49 | * Android only: Specifies the time in ms used to request 50 | * location updates. 51 | */ 52 | interval ?: number; 53 | 54 | /** 55 | * iOS only: Enables or disables tracking geofence events 56 | */ 57 | geofenceEnabled ?: string 58 | 59 | /** 60 | * iOS only: Specifies the distance interval in meters 61 | * to use for location updates 62 | * Should only be used when combined with high accuracy 63 | */ 64 | updateDistance ?: number 65 | 66 | /** 67 | * iOS Only: Specifies the extended desired accuracy 68 | */ 69 | desiredAccuracy ?: DesiredAccuracy 70 | 71 | } 72 | 73 | export class TealiumLocationCommon {} -------------------------------------------------------------------------------- /modules/location/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocationData, TealiumLocationConfig, TealiumLocationCommon, Accuracy, DesiredAccuracy } from './common'; 2 | 3 | declare module 'tealium-react-native-location' { 4 | export default TealiumLocation; 5 | class TealiumLocation extends TealiumLocationCommon { 6 | 7 | /** 8 | * Configures the Tealium Location module 9 | * @param config configuration properties for Location module 10 | */ 11 | public static configure(config: TealiumLocationConfig): void; 12 | 13 | /** 14 | * Sets the accuracy of the Location tracking feature 15 | * @param accuracy High or Low accuracy 16 | */ 17 | public static setAccuracy(accuracy: Accuracy): void; 18 | 19 | /** 20 | * Sets the Url to use when fetching the Gecofence configuration file 21 | * @param url Url pointing to a file containing geofence configuration 22 | */ 23 | public static setGeofenceUrl(url: String): void; 24 | 25 | /** 26 | * Sets the location path to use when fetching the Gecofence configuration file 27 | * @param path local path pointing to a file containing geofence configuration 28 | */ 29 | public static setGeofenceFile(path: String): void; 30 | 31 | /** 32 | * Android Only: Specifies the time in ms used to request 33 | * location updates. 34 | * @param interval time in ms to request location updates 35 | */ 36 | public static setInterval(interval: Number): void; 37 | 38 | /** 39 | * iOS only: Enables or disables tracking geofence events 40 | * @param enabled true for enabled, else false 41 | */ 42 | public static setGeofenceTrackingEnabled(enabled: Boolean): void; 43 | 44 | /** 45 | * iOS only: Specifies the distance interval in meters 46 | * to use for location updates 47 | * Should only be used when combined with high accuracy 48 | * @param distance distance in meters to receive location updates 49 | */ 50 | public static setUpdateDistance(distance: Number): void; 51 | 52 | /** 53 | * iOS Only: Specifies the extended desired accuracy 54 | * @param accuracy extended accuracy value 55 | */ 56 | public static setDesiredAccuracy(accuracy: DesiredAccuracy): void; 57 | 58 | /** 59 | * Fetches the last known location, if there is one. 60 | * @param callback function to receive the last known location if available, else null 61 | */ 62 | public static lastLocation(callback: (response: LocationData) => void): void; 63 | 64 | /** 65 | * Starts Location Tracking 66 | */ 67 | public static startLocationTracking(): void; 68 | 69 | /** 70 | * Stops Location Tracking 71 | */ 72 | public static stopLocationTracking(): void; 73 | } 74 | } -------------------------------------------------------------------------------- /modules/location/ios/TealiumReactNativeLocation-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | -------------------------------------------------------------------------------- /modules/location/ios/TealiumReactNativeLocation.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RCT_EXTERN_MODULE(TealiumReactLocation, NSObject) 4 | 5 | RCT_EXTERN_METHOD(configure:(NSDictionary *)config) 6 | RCT_EXTERN_METHOD(setAccuracyBoolean:(Bool *)isHighAccuracy) 7 | RCT_EXTERN_METHOD(setAccuracyString:(String *)isHighAccuracy) 8 | RCT_EXTERN_METHOD(setGeofenceUrl:(String *)url) 9 | RCT_EXTERN_METHOD(setGeofenceFile:(String *)path) 10 | RCT_EXTERN_METHOD(setGeofenceTrackingEnabled:(Bool *)enabled) 11 | RCT_EXTERN_METHOD(setUpdateDistance:(Double *)distance) 12 | RCT_EXTERN_METHOD(setDesiredAccuracy:(String *)accuracy) 13 | 14 | RCT_EXTERN_METHOD(lastLocation:(RCTResponseSenderBlock)callback) 15 | RCT_EXTERN_METHOD(startLocationTracking) 16 | RCT_EXTERN_METHOD(stopLocationTracking) 17 | @end 18 | -------------------------------------------------------------------------------- /modules/location/ios/TealiumReactNativeLocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /modules/location/ios/TealiumReactNativeLocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /modules/location/ios/TealiumReactNativeLocation.xcodeproj/xcuserdata/jameskeith.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TealiumReactNativeLocation.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /modules/location/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-native-location", 3 | "title": "Tealium React Native Location", 4 | "version": "1.2.1", 5 | "description": "A native module for using Tealium's Location Module for Kotlin and Swift libraries.", 6 | "main": "index.js", 7 | "types": "*.ts", 8 | "homepage": "https://github.com/Tealium/tealium-react-native", 9 | "bugs": "https://github.com/Tealium/tealium-react-native/issues", 10 | "files": [ 11 | "README.md", 12 | "LICENSE", 13 | "android", 14 | "!android/build", 15 | "common.ts", 16 | "index.js", 17 | "index.d.ts", 18 | "ios", 19 | "tealium-react-native.podspec" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 24 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 25 | }, 26 | "keywords": [ 27 | "react-native", 28 | "tealium" 29 | ], 30 | "author": { 31 | "name": "Tealium" 32 | }, 33 | "contributors": [ 34 | "James Keith" 35 | ], 36 | "license": "Commercial", 37 | "licenseFilename": "LICENSE", 38 | "readmeFilename": "README.md", 39 | "peerDependencies": { 40 | "react": ">=16.8.1 || < 19.0.0", 41 | "react-native": ">=0.60.0-rc.0 <1.0.x", 42 | "tealium-react-native": "^2.6.0" 43 | }, 44 | "devDependencies": { 45 | "react": "^17.0.2", 46 | "react-native": "^0.67.1" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /modules/location/tealium-react-native-location.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "tealium-react-native-location" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | Tealium React Native Location Plugin 11 | DESC 12 | s.homepage = "https://github.com/Tealium/tealium-react-native/modules/location" 13 | s.license = { :type => "Commercial", :file => "LICENSE" } 14 | s.authors = { "James Keith" => "james.keith@tealium.com" } 15 | s.platforms = { :ios => "12.0" } 16 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 17 | s.source_files = "ios/**/*.{h,c,m,swift}" 18 | s.requires_arc = true 19 | s.swift_version = "5.0" 20 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 21 | 22 | s.dependency "React-Core" 23 | s.dependency "tealium-react-native", "~> 2.6" 24 | s.dependency "tealium-swift/Core", "~> 2.18" 25 | s.dependency "tealium-swift/Location", "~> 2.18" 26 | 27 | end 28 | -------------------------------------------------------------------------------- /modules/moments-api/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .classpath 35 | .cxx 36 | .gradle 37 | .idea 38 | .project 39 | .settings 40 | local.properties 41 | android.iml 42 | 43 | # Cocoapods 44 | # 45 | example/ios/Pods 46 | 47 | # Ruby 48 | example/vendor/ 49 | 50 | # node.js 51 | # 52 | node_modules/ 53 | npm-debug.log 54 | yarn-debug.log 55 | yarn-error.log 56 | 57 | # BUCK 58 | buck-out/ 59 | \.buckd/ 60 | android/app/libs 61 | android/keystores/debug.keystore 62 | 63 | # Yarn 64 | .yarn/* 65 | !.yarn/patches 66 | !.yarn/plugins 67 | !.yarn/releases 68 | !.yarn/sdks 69 | !.yarn/versions 70 | 71 | # Expo 72 | .expo/ 73 | 74 | # Turborepo 75 | .turbo/ 76 | 77 | # generated by bob 78 | lib/ 79 | 80 | # React Native Codegen 81 | ios/generated 82 | android/generated 83 | -------------------------------------------------------------------------------- /modules/moments-api/README.md: -------------------------------------------------------------------------------- 1 | ## Tealium React Native 2 | 3 | This repository contains the necessary assets for exposing Tealium's native [Android](https://docs.tealium.com/platforms/android-kotlin/) and [iOS](https://docs.tealium.com/platforms/ios-swift/) mobile libraries to the JavaScript code in your React Native project. This includes code for exposing the native APIs for both platforms through React Native's bridging system, and a basic helper class in JavaScript to create a single cross platform API. 4 | 5 | You can also find a example application demonstrating how everything is put together and how the API gets called in JavaScript. 6 | 7 | ## Documentation 8 | For full documentation, please see the Tealium Developer Docs website: 9 | 10 | [Tealium React Native Documentation](https://docs.tealium.com/platforms/react-native/install/) 11 | 12 | ## License 13 | 14 | Use of this software is subject to the terms and conditions of the license agreement contained in the file titled "LICENSE.txt". Please read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement. 15 | 16 | 17 | --- 18 | Copyright (C) 2012-2024, Tealium Inc. -------------------------------------------------------------------------------- /modules/moments-api/android/build.gradle: -------------------------------------------------------------------------------- 1 | def DEFAULT_COMPILE_SDK_VERSION = 31 2 | def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2' 3 | def DEFAULT_MIN_SDK_VERSION = 21 4 | def DEFAULT_TARGET_SDK_VERSION = 31 5 | 6 | def safeExtGet(prop, fallback) { 7 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 8 | } 9 | 10 | apply plugin: 'com.android.library' 11 | apply plugin: 'kotlin-android' 12 | 13 | buildscript { 14 | ext { 15 | kotlinVersion = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.0' 16 | } 17 | 18 | if (project == rootProject) { 19 | repositories { 20 | google() 21 | mavenCentral() 22 | maven { 23 | url "https://maven.tealiumiq.com/android/releases/" 24 | } 25 | } 26 | dependencies { 27 | classpath 'com.android.tools.build:gradle:4.2.2' 28 | } 29 | } 30 | 31 | repositories { 32 | mavenCentral() 33 | } 34 | dependencies { 35 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}" 36 | } 37 | } 38 | 39 | version = "1.1.1" 40 | 41 | android { 42 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 43 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 44 | 45 | defaultConfig { 46 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 47 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 48 | 49 | buildConfigField "String", "TAG", "\"Tealium-React-MomentsAPI-$version\"" 50 | } 51 | 52 | lintOptions { 53 | disable 'GradleCompatible' 54 | } 55 | 56 | if (project.android.hasProperty("namespace")) { 57 | namespace "com.tealium.react.momentsapi" 58 | } 59 | 60 | def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() 61 | if(agpVersion < 8) { 62 | compileOptions { 63 | sourceCompatibility JavaVersion.VERSION_11 64 | targetCompatibility JavaVersion.VERSION_11 65 | } 66 | 67 | kotlinOptions { 68 | jvmTarget = JavaVersion.VERSION_11 69 | } 70 | } 71 | } 72 | 73 | repositories { 74 | // ref: https://www.baeldung.com/maven-local-repository 75 | maven { 76 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 77 | url "$rootDir/../node_modules/react-native/android" 78 | } 79 | 80 | maven { 81 | // Android JSC is installed from npm 82 | url "$rootDir/../node_modules/jsc-android/dist" 83 | } 84 | 85 | maven { 86 | url "https://maven.tealiumiq.com/android/releases/" 87 | } 88 | 89 | google() 90 | mavenCentral() 91 | } 92 | 93 | 94 | dependencies { 95 | // noinspection GradleDynamicVersion 96 | implementation 'com.facebook.react:react-native:+' 97 | 98 | // Tealium React Native 99 | implementation project(":tealium-react-native") 100 | 101 | // Tealium Moments API 102 | implementation 'com.tealium:kotlin-momentsapi:1.0.2' 103 | 104 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${project.ext.kotlinVersion}" 105 | } 106 | -------------------------------------------------------------------------------- /modules/moments-api/android/gradle.properties: -------------------------------------------------------------------------------- 1 | TealiumReactNativeMomentsApi_kotlinVersion=1.7.0 2 | TealiumReactNativeMomentsApi_minSdkVersion=21 3 | TealiumReactNativeMomentsApi_targetSdkVersion=31 4 | TealiumReactNativeMomentsApi_compileSdkVersion=31 5 | TealiumReactNativeMomentsApi_ndkversion=21.4.7075529 6 | -------------------------------------------------------------------------------- /modules/moments-api/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /modules/moments-api/android/src/main/java/com/tealium/react/momentsapi/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.momentsapi 2 | 3 | import com.facebook.react.bridge.WritableMap 4 | import com.tealium.momentsapi.EngineResponse 5 | import com.tealium.momentsapi.MomentsApiRegion 6 | import com.tealium.react.toWritableMap 7 | import org.json.JSONObject 8 | 9 | fun EngineResponse.toWritableMap(): WritableMap? { 10 | return EngineResponse.toFriendlyJson(this).toWritableMap() 11 | } 12 | 13 | fun regionFromString(region: String): MomentsApiRegion { 14 | return when (region.lowercase()) { 15 | "germany" -> MomentsApiRegion.Germany 16 | "us_east" -> MomentsApiRegion.UsEast 17 | "sydney" -> MomentsApiRegion.Sydney 18 | "oregon" -> MomentsApiRegion.Oregon 19 | "tokyo" -> MomentsApiRegion.Tokyo 20 | "hong_kong" -> MomentsApiRegion.HongKong 21 | else -> MomentsApiRegion.Custom(region) 22 | } 23 | } 24 | 25 | private val engineResponseFriendlyNames = mapOf( 26 | "flags" to "booleans", 27 | "metrics" to "numbers", 28 | "properties" to "strings", 29 | ) 30 | 31 | internal fun EngineResponse.Companion.toFriendlyJson(engineResponse: EngineResponse): JSONObject { 32 | return toJson(engineResponse).let { engineJson -> 33 | engineJson.apply { 34 | // Rename the top level keys 35 | this.renameAll(engineResponseFriendlyNames) 36 | } 37 | } 38 | } 39 | 40 | internal fun JSONObject.renameAll(names: Map) { 41 | names.entries.forEach { entry -> 42 | this.rename(entry.key, entry.value) 43 | } 44 | } 45 | 46 | internal fun JSONObject.rename(oldKey: String, newKey: String) { 47 | this.opt(oldKey)?.let { 48 | this.put(newKey, it) 49 | this.remove(oldKey) 50 | } 51 | } -------------------------------------------------------------------------------- /modules/moments-api/common.ts: -------------------------------------------------------------------------------- 1 | export enum MomentsApiRegion { 2 | Germany = 'germany', 3 | UsEast = 'us_east', 4 | Sydney = 'sydney', 5 | Oregon = 'oregon', 6 | Tokyo = 'tokyo', 7 | HongKong = 'hong_kong', 8 | } 9 | 10 | export interface MomentsApiConfig { 11 | momentsApiRegion : MomentsApiRegion | string; 12 | momentsApiReferrer ?: string; 13 | } 14 | 15 | export interface EngineResponse { 16 | audiences ?: string[]; 17 | badges ?: string[]; 18 | strings ?: { [key: string]: string}; 19 | booleans ?: { [key: string]: boolean}; 20 | dates ?: { [key: string]: number}; 21 | numbers ?: { [key: string]: number}; 22 | } 23 | 24 | export class TealiumMomentsApiCommon {} -------------------------------------------------------------------------------- /modules/moments-api/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MomentsApiConfig, EngineResponse, TealiumMomentsApiCommon} from './common'; 2 | 3 | declare module 'tealium-react-native-moments-api' { 4 | export default TealiumMomentsApi; 5 | class TealiumMomentsApi extends TealiumMomentsApiCommon { 6 | 7 | /** 8 | * Configures the Tealium Moments API module 9 | * @param config configuration properties for Moments API module 10 | */ 11 | public static configure(config: MomentsApiConfig): void; 12 | 13 | /** 14 | * Retrieves the engine response for the given engine ID. 15 | * @param engineId The ID of the engine to fetch the response for. 16 | * @param callback The callback to recieve the engine response. 17 | */ 18 | public static fetchEngineResponse(engineId: String, callback:(response: EngineResponse | String) => void): void; 19 | } 20 | } -------------------------------------------------------------------------------- /modules/moments-api/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | const { TealiumReactMomentsApi } = NativeModules; 3 | 4 | export default class TealiumMomentsApi { 5 | 6 | static configure(config) { 7 | TealiumReactMomentsApi.configure(config) 8 | } 9 | 10 | static fetchEngineResponse(engineId, callback) { 11 | TealiumReactMomentsApi.fetchEngineResponse(engineId, response => { 12 | if (Platform.OS == 'android' && typeof response === 'object') { 13 | if (response.dates) { 14 | response.dates = Object.fromEntries( 15 | Object.entries(response.dates).map(([key, value]) => [ 16 | key, 17 | Number(value) 18 | ]) 19 | ); 20 | } 21 | } 22 | 23 | callback(response); 24 | }) 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /modules/moments-api/ios/TealiumReactMomentsApi-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | -------------------------------------------------------------------------------- /modules/moments-api/ios/TealiumReactMomentsApi.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RCT_EXTERN_MODULE(TealiumReactMomentsApi, NSObject) 4 | 5 | RCT_EXTERN_METHOD(configure:(NSDictionary *)config) 6 | 7 | RCT_EXTERN_METHOD(fetchEngineResponse:(NSString)engineId callback: (RCTResponseSenderBlock*)callback) 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /modules/moments-api/ios/TealiumReactMomentsApi.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import tealium_react_native 3 | import TealiumSwift 4 | 5 | @objc(TealiumReactMomentsApi) 6 | class TealiumReactMomentsApi: NSObject, RCTBridgeModule { 7 | 8 | static func moduleName() -> String! { 9 | return "TealiumReactMomentsApi" 10 | } 11 | 12 | private let KEY_MOMENTS_API_REGION = "momentsApiRegion" 13 | private let KEY_MOMENTS_API_REFERRER = "momentsApiReferrer" 14 | 15 | let module = TealiumReactMomentsAPIModule() 16 | 17 | @objc 18 | static func requiresMainQueueSetup() -> Bool { 19 | return false 20 | } 21 | 22 | override init() { 23 | super.init() 24 | TealiumReactNative.registerOptionalModule(module) 25 | } 26 | 27 | @objc(configure:) 28 | public func configure(_ config: [String: Any]) { 29 | if let region = config[KEY_MOMENTS_API_REGION] as? String { 30 | module.setMomentsRegion(region: region) 31 | } 32 | 33 | if let referrer = config[KEY_MOMENTS_API_REFERRER] as? String { 34 | module.setMomentsReferrer(referrer: referrer) 35 | } 36 | } 37 | 38 | @objc(fetchEngineResponse:callback:) 39 | func fetchEngineResponse(engineId: String, callback: @escaping RCTResponseSenderBlock) { 40 | module.fetchEngineResponse(engineId: engineId, callback: callback) 41 | } 42 | 43 | } 44 | 45 | @objc class TealiumReactMomentsAPIModule: NSObject, OptionalModule { 46 | private var momentsRegion: String? = nil 47 | private var momentsReferrer: String? = nil 48 | 49 | func configure(config: TealiumConfig) { 50 | config.collectors?.append(Collectors.MomentsAPI) 51 | 52 | if let region = momentsRegion { 53 | config.momentsAPIRegion = .regionFrom(region: region) 54 | } 55 | 56 | if let referrer = momentsReferrer { 57 | config.momentsAPIReferrer = referrer 58 | } 59 | } 60 | 61 | func fetchEngineResponse(engineId: String, callback: @escaping RCTResponseSenderBlock) { 62 | guard let instance = TealiumReactNative.instance, let momentsAPI = instance.momentsAPI else { 63 | callback(["Unable to retrieve MomentsAPI module. Please check your configuration."]) 64 | return 65 | } 66 | 67 | momentsAPI.fetchEngineResponse(engineID: engineId) { engineResponse in 68 | switch engineResponse { 69 | case .success(let response): 70 | callback([response.asDictionary()]) 71 | case .failure(let error): 72 | callback(["Failed to fetch engine response with error code: \(error.localizedDescription)"]) 73 | } 74 | } 75 | } 76 | 77 | func setMomentsRegion(region: String) { 78 | momentsRegion = region 79 | } 80 | 81 | func setMomentsReferrer(referrer: String) { 82 | momentsReferrer = referrer 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /modules/moments-api/ios/TealiumReactMomentsExtensions.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TealiumSwift 3 | 4 | 5 | extension EngineResponse { 6 | func asDictionary() -> [String: Any] { 7 | var dict = [String: Any]() 8 | if let badges = self.badges { 9 | dict["badges"] = badges 10 | } 11 | 12 | if let audiences = self.audiences { 13 | dict["audiences"] = audiences 14 | } 15 | 16 | if let strings = self.strings { 17 | dict["strings"] = strings 18 | } 19 | 20 | if let booleans = self.booleans { 21 | dict["booleans"] = booleans 22 | } 23 | 24 | if let dateAttributes = self.dates { 25 | dict["dates"] = dateAttributes 26 | } 27 | 28 | if let numbers = self.numbers { 29 | dict["numbers"] = numbers 30 | } 31 | 32 | return dict 33 | } 34 | } 35 | 36 | extension MomentsAPIRegion { 37 | static func regionFrom(region: String) -> MomentsAPIRegion { 38 | switch region.lowercased() { 39 | case "germany": 40 | return .germany 41 | case "us_east": 42 | return .us_east 43 | case "sydney": 44 | return .sydney 45 | case "oregon": 46 | return .oregon 47 | case "tokyo": 48 | return .tokyo 49 | case "hong_kong": 50 | return .hong_kong 51 | default: 52 | return .custom(region) 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /modules/moments-api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-native-moments-api", 3 | "title": "Tealium React Native Moments API Module", 4 | "version": "1.1.1", 5 | "description": "A native module for using Tealium's Moments API module for Kotlin and Swift libraries.", 6 | "main": "index.js", 7 | "types": "*.ts", 8 | "homepage": "https://github.com/Tealium/tealium-react-native", 9 | "bugs": "https://github.com/Tealium/tealium-react-native/issues", 10 | "files": [ 11 | "README.md", 12 | "LICENSE", 13 | "android", 14 | "!android/build", 15 | "common.ts", 16 | "index.js", 17 | "index.d.ts", 18 | "ios", 19 | "tealium-react-moments-api.podspec" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 24 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 25 | }, 26 | "keywords": [ 27 | "react-native", 28 | "tealium" 29 | ], 30 | "author": { 31 | "name": "Tealium" 32 | }, 33 | "contributors": [ 34 | "Karen Tamayo" 35 | ], 36 | "license": "Commercial", 37 | "licenseFilename": "LICENSE", 38 | "readmeFilename": "README.md", 39 | "peerDependencies": { 40 | "react": ">=16.8.1 || < 19.0.0", 41 | "react-native": ">=0.60.0-rc.0 <1.0.x" 42 | }, 43 | "devDependencies": { 44 | "react": "^17.0.2", 45 | "react-native": "^0.71.0" 46 | }, 47 | "dependencies": { 48 | "tealium-react-native": "^2.6.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /modules/moments-api/tealium-react-moments-api.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "tealium-react-moments-api" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | Tealium React Native Moments API Plugin 11 | DESC 12 | s.homepage = "https://github.com/Tealium/tealium-react-native/modules" 13 | s.license = { :type => "Commercial", :file => "LICENSE" } 14 | s.authors = { "Tealium" => "mobile-dev@tealium.com" } 15 | s.platforms = { :ios => "12.0" } 16 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 17 | s.source_files = "ios/**/*.{h,c,m,swift}" 18 | s.requires_arc = true 19 | s.swift_version = "5.0" 20 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 21 | 22 | s.dependency "React-Core" 23 | s.dependency "tealium-react-native", "~> 2.6" 24 | s.dependency "tealium-swift/Core", "~> 2.18" 25 | s.dependency "tealium-swift/MomentsAPI", "~> 2.18" 26 | 27 | end 28 | -------------------------------------------------------------------------------- /npm-package/README.md: -------------------------------------------------------------------------------- 1 | ## Tealium React Native 2 | 3 | This repository contains the necessary assets for exposing Tealium's native [Android](https://docs.tealium.com/platforms/android-kotlin/) and [iOS](https://docs.tealium.com/platforms/ios-swift/) mobile libraries to the JavaScript code in your React Native project. This includes code for exposing the native APIs for both platforms through React Native's bridging system, and a basic helper class in JavaScript to create a single cross platform API. 4 | 5 | You can also find a example application demonstrating how everything is put together and how the API gets called in JavaScript. 6 | 7 | ## Documentation 8 | For full documentation, please see the Tealium Developer Docs website: 9 | 10 | [Tealium React Native Documentation](https://docs.tealium.com/platforms/react-native/install/) 11 | 12 | ## License 13 | 14 | Use of this software is subject to the terms and conditions of the license agreement contained in the file titled "LICENSE.txt". Please read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement. 15 | 16 | 17 | --- 18 | Copyright (C) 2012-2021, Tealium Inc. -------------------------------------------------------------------------------- /npm-package/android/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /npm-package/android/gradle.properties: -------------------------------------------------------------------------------- 1 | ## For more details on how to configure your build environment visit 2 | # http://www.gradle.org/docs/current/userguide/build_environment.html 3 | # 4 | # Specifies the JVM arguments used for the daemon process. 5 | # The setting is particularly useful for tweaking memory settings. 6 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 7 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 8 | # 9 | # When configured, Gradle will run in incubating parallel mode. 10 | # This option should only be used with decoupled projects. More details, visit 11 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 12 | # org.gradle.parallel=true 13 | #Fri May 27 08:42:46 MST 2022 14 | android.useAndroidX=true 15 | android.enableJetifier=false 16 | -------------------------------------------------------------------------------- /npm-package/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /npm-package/android/src/androidTest/java/com/tealium/react/InstrumentedTests.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react -------------------------------------------------------------------------------- /npm-package/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /npm-package/android/src/main/java/com/tealium/react/Listeners.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react 2 | 3 | import com.facebook.react.bridge.Arguments 4 | import com.facebook.react.bridge.ReactApplicationContext 5 | import com.facebook.react.modules.core.DeviceEventManagerModule 6 | import com.tealium.core.Logger 7 | import com.tealium.core.consent.ConsentManagementPolicy 8 | import com.tealium.core.consent.ConsentStatus 9 | import com.tealium.core.consent.UserConsentPreferences 10 | import com.tealium.core.messaging.UserConsentPreferencesUpdatedListener 11 | import com.tealium.core.messaging.VisitorIdUpdatedListener 12 | import com.tealium.remotecommands.RemoteCommand 13 | import com.tealium.visitorservice.VisitorProfile 14 | import com.tealium.visitorservice.VisitorUpdatedListener 15 | import org.json.JSONException 16 | 17 | class EmitterListeners(private val reactContext: ReactApplicationContext) : VisitorUpdatedListener, 18 | UserConsentPreferencesUpdatedListener, VisitorIdUpdatedListener { 19 | 20 | override fun onVisitorUpdated(visitorProfile: VisitorProfile) { 21 | try { 22 | VisitorProfile.toFriendlyJson(visitorProfile).toWritableMap()?.let { 23 | reactContext 24 | .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java) 25 | .emit(EVENT_EMITTERS_VISITOR, it) 26 | } 27 | } catch (jex: JSONException) { 28 | Logger.qa(BuildConfig.TAG, "Error converting VisitorProfile to WritableMap.") 29 | Logger.qa(BuildConfig.TAG, "${jex.message}") 30 | } 31 | } 32 | 33 | override fun onUserConsentPreferencesUpdated( 34 | userConsentPreferences: UserConsentPreferences, 35 | policy: ConsentManagementPolicy 36 | ) { 37 | if (userConsentPreferences.consentStatus != ConsentStatus.UNKNOWN) return 38 | 39 | reactContext 40 | .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java) 41 | .emit(EVENT_EMITTERS_CONSENT_EXPIRED, Arguments.createMap()) 42 | } 43 | 44 | override fun onVisitorIdUpdated(visitorId: String) { 45 | reactContext 46 | .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java) 47 | .emit(EVENT_EMITTERS_VISITOR_ID_UPDATED, visitorId) 48 | } 49 | } 50 | 51 | class RemoteCommandListener( 52 | private val reactContext: ReactApplicationContext, 53 | id: String, 54 | description: String = id 55 | ) : RemoteCommand(id, description) { 56 | public override fun onInvoke(response: Response) { 57 | response.requestPayload.put("command_id", commandName) 58 | try { 59 | response.requestPayload.toWritableMap()?.let { 60 | reactContext 61 | .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java) 62 | .emit(EVENT_EMITTERS_REMOTE_COMMAND, it) 63 | } 64 | } catch (jex: JSONException) { 65 | Logger.qa(BuildConfig.TAG, "Error converting Payload to WritableMap.") 66 | Logger.qa(BuildConfig.TAG, "${jex.message}") 67 | } 68 | response.send() 69 | } 70 | } -------------------------------------------------------------------------------- /npm-package/android/src/main/java/com/tealium/react/OptionalModule.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react 2 | 3 | import com.tealium.core.TealiumConfig 4 | 5 | interface OptionalModule { 6 | 7 | /** 8 | * Delegates configuration to the sub-module. OptionalModules are passed the config 9 | * instance prior to the Tealium instance creation 10 | */ 11 | fun configure(config: TealiumConfig) 12 | } -------------------------------------------------------------------------------- /npm-package/android/src/main/java/com/tealium/react/RemoteCommandFactory.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react 2 | 3 | import com.tealium.remotecommands.RemoteCommand 4 | 5 | interface RemoteCommandFactory { 6 | val name: String 7 | fun create(): RemoteCommand 8 | } -------------------------------------------------------------------------------- /npm-package/ios/EventEmitter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EventEmitter.swift 3 | // TealiumReactNative 4 | // 5 | // Created by Christina S on 12/11/20. 6 | // Copyright © 2020 Facebook. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class EventEmitter { 12 | 13 | public static var shared = EventEmitter() 14 | private static var eventEmitter: TealiumReactNative? 15 | 16 | private init() {} 17 | 18 | lazy var allEvents: [String] = { 19 | TealiumReactConstants.Events.allCases.map { $0.rawValue } 20 | }() 21 | 22 | func registerEventEmitter(eventEmitter: TealiumReactNative) { 23 | EventEmitter.eventEmitter = eventEmitter 24 | } 25 | 26 | func dispatch(name: String, body: Any?) { 27 | EventEmitter.eventEmitter?.sendEvent(withName: name, body: body) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /npm-package/ios/OptionalModule.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OptionalModule.swift 3 | // tealium-react-native 4 | // 5 | // Created by James Keith on 22/12/2021. 6 | // 7 | 8 | import Foundation 9 | import TealiumSwift 10 | 11 | public protocol OptionalModule { 12 | func configure(config: TealiumConfig) -> Void 13 | } 14 | -------------------------------------------------------------------------------- /npm-package/ios/RemoteCommandFactory.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RemoteCommandFactory.swift 3 | // tealium-react-native 4 | // 5 | // Created by James Keith on 08/04/2021. 6 | // 7 | 8 | import Foundation 9 | import TealiumSwift 10 | 11 | public protocol RemoteCommandFactory { 12 | var name: String { get } 13 | func create() -> RemoteCommand 14 | } 15 | -------------------------------------------------------------------------------- /npm-package/ios/TealiumReactNative-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | #import 5 | #import 6 | -------------------------------------------------------------------------------- /npm-package/ios/TealiumReactNative.m: -------------------------------------------------------------------------------- 1 | 2 | #import "React/RCTBridgeModule.h" 3 | #import "React/RCTEventEmitter.h" 4 | 5 | @interface RCT_EXTERN_MODULE(TealiumWrapper, NSObject) 6 | 7 | RCT_EXTERN_METHOD(initialize:(NSDictionary *)config callback:(RCTResponseSenderBlock)callback) 8 | 9 | RCT_EXTERN_METHOD(track:(NSDictionary *)dispatch) 10 | 11 | RCT_EXTERN_METHOD(terminateInstance) 12 | 13 | RCT_EXTERN_METHOD(getConsentStatus:(RCTResponseSenderBlock)callback) 14 | 15 | RCT_EXTERN_METHOD(setConsentStatus:(NSString *)status) 16 | 17 | RCT_EXTERN_METHOD(getConsentCategories:(RCTResponseSenderBlock)callback) 18 | 19 | RCT_EXTERN_METHOD(setConsentCategories:(NSArray *)status) 20 | 21 | RCT_EXTERN_METHOD(addToDataLayer:(NSDictionary *)data expiry:(NSString *)expiry) 22 | 23 | RCT_EXTERN_METHOD(getFromDataLayer:(NSString *)key callback:(RCTResponseSenderBlock)callback) 24 | 25 | RCT_EXTERN_METHOD(removeFromDataLayer:(NSArray *)keys) 26 | 27 | RCT_EXTERN_METHOD(deleteFromDataLayer:(NSArray *)keys) 28 | 29 | RCT_EXTERN_METHOD(gatherTrackData:(RCTResponseSenderBlock)callback) 30 | 31 | RCT_EXTERN_METHOD(addRemoteCommand:(NSString *)commandId) 32 | 33 | RCT_EXTERN_METHOD(removeRemoteCommand:(NSString *)commandId) 34 | 35 | RCT_EXTERN_METHOD(joinTrace:(NSString *)traceId) 36 | 37 | RCT_EXTERN_METHOD(leaveTrace) 38 | 39 | RCT_EXTERN_METHOD(getVisitorId:(RCTResponseSenderBlock)callback) 40 | 41 | RCT_EXTERN_METHOD(resetVisitorId) 42 | 43 | RCT_EXTERN_METHOD(clearStoredVisitorIds) 44 | 45 | RCT_EXTERN_METHOD(getSessionId:(RCTResponseSenderBlock)callback) 46 | 47 | @end 48 | 49 | @interface RCT_EXTERN_MODULE(TealiumReactNative, RCTEventEmitter) 50 | 51 | RCT_EXTERN_METHOD(supportedEvents) 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /npm-package/ios/TealiumReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /npm-package/ios/TealiumReactNative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /npm-package/ios/TealiumReactNative.xcodeproj/xcuserdata/christina.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TealiumReactNative.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /npm-package/ios/TealiumReactNative.xcodeproj/xcuserdata/karentamayo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TealiumReactNative.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 58B511DA1A9E6C8500147676 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /npm-package/ios/TealiumReactNative.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /npm-package/ios/TealiumReactNative.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /npm-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-native", 3 | "title": "Tealium React Native", 4 | "version": "2.6.2", 5 | "description": "A native module for using Tealium's Kotlin and Swift libraries.", 6 | "main": "index.js", 7 | "types": "*.ts", 8 | "homepage": "https://github.com/Tealium/tealium-react-native", 9 | "bugs": "https://github.com/Tealium/tealium-react-native/issues", 10 | "files": [ 11 | "README.md", 12 | "LICENSE", 13 | "android", 14 | "!android/build", 15 | "common.ts", 16 | "index.js", 17 | "index.d.ts", 18 | "ios", 19 | "tealium-react-native.podspec" 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 24 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 25 | }, 26 | "keywords": [ 27 | "react-native", 28 | "tealium" 29 | ], 30 | "author": { 31 | "name": "Tealium" 32 | }, 33 | "contributors": [ 34 | "James Keith", 35 | "Christina Sund" 36 | ], 37 | "license": "Commercial", 38 | "licenseFilename": "LICENSE", 39 | "readmeFilename": "README.md", 40 | "peerDependencies": { 41 | "react": ">=16.8.1 || < 19.0.0", 42 | "react-native": ">=0.60.0-rc.0 <1.0.x" 43 | }, 44 | "devDependencies": { 45 | "react": "^17.0.2", 46 | "react-native": "^0.67.1" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /npm-package/tealium-react-native.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "tealium-react-native" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | Tealium React Native Plugin 11 | DESC 12 | s.homepage = "https://github.com/Tealium/tealium-react-native" 13 | s.license = { :type => "Commercial", :file => "LICENSE" } 14 | s.authors = { "Christina Sund" => "christina.sund@tealium.com", "James Keith" => "james.keith@tealium.com" } 15 | s.platforms = { :ios => "12.0" } 16 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 17 | s.source_files = "ios/**/*.{h,c,m,swift}" 18 | s.requires_arc = true 19 | s.swift_version = "5.0" 20 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 21 | 22 | s.dependency "React-Core" 23 | s.dependency "tealium-swift/Core", "~> 2.18" 24 | s.dependency "tealium-swift/TagManagement", "~> 2.18" 25 | s.dependency "tealium-swift/Collect", "~> 2.18" 26 | s.dependency "tealium-swift/Lifecycle", "~> 2.18" 27 | s.dependency "tealium-swift/RemoteCommands", "~> 2.18" 28 | s.dependency "tealium-swift/VisitorService", "~> 2.18" 29 | 30 | end 31 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .classpath 35 | .cxx 36 | .gradle 37 | .idea 38 | .project 39 | .settings 40 | local.properties 41 | android.iml 42 | 43 | # Cocoapods 44 | # 45 | example/ios/Pods 46 | 47 | # node.js 48 | # 49 | node_modules/ 50 | npm-debug.log 51 | yarn-debug.log 52 | yarn-error.log 53 | 54 | # BUCK 55 | buck-out/ 56 | \.buckd/ 57 | android/app/libs 58 | android/keystores/debug.keystore 59 | 60 | # Expo 61 | .expo/* 62 | 63 | # generated by bob 64 | lib/ 65 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/README.md: -------------------------------------------------------------------------------- 1 | # tealium-react-adjust 2 | 3 | ## Getting started 4 | 5 | To install the package into your React Native app: 6 | `$ yarn add tealium-react-adjust` 7 | 8 | ### Mostly automatic installation 9 | 10 | For iOS only, 11 | `$ cd ios && pod install && cd ..` 12 | 13 | Setup the Adjust dependencies according to the standard guides for [iOS](https://help.adjust.com/en/article/get-started-ios-sdk) and [Android](https://help.adjust.com/en/article/get-started-android-sdk) to get all required config into you project. 14 | 15 | ## Usage 16 | ```javascript 17 | import AdjustRemoteCommand from 'tealium-react-adjust'; 18 | 19 | AdjustRemoteCommand.initialize(); 20 | 21 | let config = TealiumConfig { 22 | // ... 23 | remoteCommands: [{ 24 | id: AdjustRemoteCommand.name, 25 | // Optional - path to local JSON mappings 26 | // path: "adjust.json" 27 | // Optional - path to remote JSON mappings 28 | // url: "https://some.domain.com/adjust.json" 29 | }] 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/android/src/main/java/com/tealium/react/adjust/AdjustModule.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.adjust 2 | 3 | import android.app.Application 4 | import com.adjust.sdk.AdjustConfig 5 | import com.facebook.react.ReactPackage 6 | import com.facebook.react.bridge.* 7 | import com.facebook.react.uimanager.ViewManager 8 | import com.tealium.react.RemoteCommandFactory 9 | import com.tealium.react.TealiumReact 10 | import com.tealium.react.safeGetString 11 | import com.tealium.remotecommands.RemoteCommand 12 | import com.tealium.remotecommands.adjust.AdjustRemoteCommand 13 | 14 | open class AdjustPackage : ReactPackage { 15 | override fun createNativeModules(reactContext: ReactApplicationContext): List { 16 | return listOf(AdjustModule(reactContext)) 17 | } 18 | 19 | override fun createViewManagers(reactContext: ReactApplicationContext): List> { 20 | return emptyList() 21 | } 22 | } 23 | 24 | class AdjustModule(private val reactContext: ReactApplicationContext) : 25 | ReactContextBaseJavaModule(reactContext) { 26 | 27 | @ReactMethod 28 | fun initialize(config: ReadableMap?) { 29 | reactContext.getNativeModule(TealiumReact::class.java) 30 | ?.registerRemoteCommandFactory(AdjustRemoteCommandFactory(config?.toAdjustConfig())) 31 | } 32 | 33 | private fun ReadableMap.toAdjustConfig(): AdjustConfig { 34 | val appToken = getString(KEY_APP_TOKEN) 35 | val environment = 36 | if (safeGetString(KEY_ENVIRONMENT) == ENVIRONMENT_PRODUCTION_VALUE) AdjustConfig.ENVIRONMENT_PRODUCTION else AdjustConfig.ENVIRONMENT_SANDBOX 37 | val allowSuppressLogLevel = getBoolean(KEY_ALLOW_SUPPRESS_LOG_LEVEL) 38 | 39 | return AdjustConfig( 40 | reactContext.applicationContext, 41 | appToken, 42 | environment, 43 | allowSuppressLogLevel 44 | ) 45 | } 46 | 47 | private inner class AdjustRemoteCommandFactory(config: AdjustConfig? = null) : 48 | RemoteCommandFactory { 49 | override val name = "AdjustRemoteCommand" 50 | private val adjustRemoteCommand = config?.let { 51 | AdjustRemoteCommand( 52 | reactContext.applicationContext as Application, 53 | config 54 | ) 55 | } ?: AdjustRemoteCommand(reactContext.applicationContext as Application) 56 | 57 | override fun create(): RemoteCommand { 58 | return adjustRemoteCommand 59 | } 60 | } 61 | 62 | override fun getName(): String { 63 | return MODULE_NAME 64 | } 65 | 66 | companion object { 67 | private const val MODULE_NAME = "TealiumReactAdjust" 68 | const val KEY_APP_TOKEN = "appToken" 69 | const val KEY_ENVIRONMENT = "environment" 70 | const val KEY_ALLOW_SUPPRESS_LOG_LEVEL = "allowSuppressLogLevel" 71 | 72 | const val ENVIRONMENT_PRODUCTION_VALUE = "production" 73 | } 74 | } -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/common.ts: -------------------------------------------------------------------------------- 1 | export interface AdjustConfig { 2 | appToken: string; 3 | environment: AdjustEnvironemnt; 4 | allowSuppressLogLevel: boolean; 5 | } 6 | 7 | export enum AdjustEnvironemnt { 8 | sandbox = 'sandbox', 9 | production = 'production' 10 | } -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/index.d.ts: -------------------------------------------------------------------------------- 1 | import { AdjustConfig } from './common'; 2 | declare module 'tealium-react-adjust' { 3 | export default AdjustRemoteCommand; 4 | class AdjustRemoteCommand { 5 | public static name: String 6 | public static initialize(config?: AdjustConfig) 7 | } 8 | } -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | 3 | const { TealiumReactAdjust } = NativeModules; 4 | 5 | export default class AdjustRemoteCommand { 6 | static name = "AdjustRemoteCommand"; 7 | 8 | static initialize(config) { 9 | if (Platform.OS == 'ios') { 10 | TealiumReactAdjust.initialize(); 11 | } else { 12 | TealiumReactAdjust.initialize(config); 13 | } 14 | } 15 | }; -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/ios/AdjustRemoteCommandWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AdjustRemoteCommandWrapper.swift 3 | // TealiumReactAdjust 4 | // 5 | // 6 | 7 | import Foundation 8 | import TealiumSwift 9 | import TealiumAdjust 10 | import tealium_react_native 11 | 12 | class AdjustRemoteCommandWrapper: RemoteCommandFactory { 13 | var name: String = "AdjustRemoteCommand" 14 | 15 | func create() -> RemoteCommand { 16 | return AdjustRemoteCommand() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/ios/TealiumReactAdjust-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | //#import 2 | //#import 3 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/ios/TealiumReactAdjust.m: -------------------------------------------------------------------------------- 1 | // TealiumReactAdjust.m 2 | 3 | #import "React/RCTBridgeModule.h" 4 | 5 | 6 | @interface RCT_EXTERN_MODULE(TealiumReactAdjust, NSObject) 7 | 8 | RCT_EXTERN_METHOD(initialize) 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/ios/TealiumReactAdjust.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import React 3 | import tealium_react_native 4 | 5 | @objc(TealiumReactAdjust) 6 | class TealiumReactAdjust: NSObject, RCTBridgeModule { 7 | static func moduleName() -> String! { 8 | "TealiumReactAdjust" 9 | } 10 | let factory = AdjustRemoteCommandWrapper() 11 | 12 | @objc 13 | static func requiresMainQueueSetup() -> Bool { 14 | return false 15 | } 16 | 17 | override init() { 18 | super.init() 19 | TealiumReactNative.registerRemoteCommandFactory(factory) 20 | } 21 | 22 | @objc(initialize) 23 | public func initialize() { 24 | TealiumReactNative.registerRemoteCommandFactory(factory) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-adjust", 3 | "title": "Tealium React Adjust", 4 | "version": "1.2.2", 5 | "description": "Package to support the Tealium Adjust Remote Command", 6 | "main": "index.js", 7 | "files": [ 8 | "README.md", 9 | "android", 10 | "!android/build", 11 | "index.js", 12 | "ios", 13 | "tealium-react-adjust.podspec" 14 | ], 15 | "scripts": { 16 | "test": "echo \"Error: no test specified\" && exit 1" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 21 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 22 | }, 23 | "keywords": [ 24 | "react-native", 25 | "ios", 26 | "android" 27 | ], 28 | "author": { 29 | "name": "Tealium" 30 | }, 31 | "license": "Commercial", 32 | "licenseFilename": "LICENSE", 33 | "readmeFilename": "README.md", 34 | "peerDependencies": { 35 | "react": ">=16.8.1 || < 19.0.0", 36 | "react-native": ">=0.60.0-rc.0 <1.0.x", 37 | "tealium-react-native": "^2.6.0" 38 | }, 39 | "devDependencies": { 40 | "react": "^16.9.0", 41 | "react-native": "^0.61.5" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-adjust/tealium-react-adjust.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "tealium-react-adjust" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | tealium-react-adjust 11 | DESC 12 | s.homepage = "https://github.com/Tealium/tealium-react-native/remotecommands/tealium-react-adjust" 13 | s.license = { :type => "Commercial", :file => "LICENSE" } 14 | s.authors = { "Tealium" => "mobile-team@tealium.com" } 15 | s.platforms = { :ios => "12.0" } 16 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 17 | 18 | s.source_files = "ios/**/*.{h,c,m,swift}" 19 | s.requires_arc = true 20 | s.static_framework = true 21 | 22 | s.dependency "React-Core" 23 | s.dependency "tealium-react-native", "~> 2.6" 24 | s.dependency "tealium-swift/Core", "~> 2.18" 25 | s.dependency "TealiumAdjust", "~> 1.4" 26 | end 27 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .classpath 35 | .cxx 36 | .gradle 37 | .idea 38 | .project 39 | .settings 40 | local.properties 41 | android.iml 42 | 43 | # Cocoapods 44 | # 45 | example/ios/Pods 46 | 47 | # Ruby 48 | example/vendor/ 49 | 50 | # node.js 51 | # 52 | node_modules/ 53 | npm-debug.log 54 | yarn-debug.log 55 | yarn-error.log 56 | 57 | # BUCK 58 | buck-out/ 59 | \.buckd/ 60 | android/app/libs 61 | android/keystores/debug.keystore 62 | 63 | # Expo 64 | .expo/ 65 | 66 | # Turborepo 67 | .turbo/ 68 | 69 | # generated by bob 70 | lib/ 71 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/README.md: -------------------------------------------------------------------------------- 1 | # tealium-react-appsflyer 2 | 3 | ## Getting started 4 | 5 | To install the package into your React Native app: 6 | `$ yarn add tealium-react-appsflyer` 7 | 8 | ### Mostly automatic installation 9 | 10 | For iOS only, 11 | `$ cd ios && pod install && cd ..` 12 | 13 | Setup the Appsflyer dependencies according to the standard guides for [iOS](https://help.appsflyer.com/en/article/get-started-ios-sdk) and [Android](https://help.appsflyer.com/en/article/get-started-android-sdk) to get all required config into you project. 14 | 15 | ## Usage 16 | ```javascript 17 | import AppsflyerRemoteCommand from 'tealium-react-appsflyer'; 18 | 19 | AppsflyerRemoteCommand.initialize(); 20 | 21 | let config = TealiumConfig { 22 | // ... 23 | remoteCommands: [{ 24 | id: AppsflyerRemoteCommand.name, 25 | // Optional - path to local JSON mappings 26 | // path: "appsflyer.json" 27 | // Optional - path to remote JSON mappings 28 | // url: "https://some.domain.com/appsflyer.json" 29 | }] 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/android/build.gradle: -------------------------------------------------------------------------------- 1 | def DEFAULT_COMPILE_SDK_VERSION = 30 2 | def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2' 3 | def DEFAULT_MIN_SDK_VERSION = 21 4 | def DEFAULT_TARGET_SDK_VERSION = 30 5 | 6 | def safeExtGet(prop, fallback) { 7 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 8 | } 9 | 10 | apply plugin: 'com.android.library' 11 | apply plugin: 'kotlin-android' 12 | 13 | buildscript { 14 | 15 | ext { 16 | kotlinVersion = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.0' 17 | } 18 | 19 | if (project == rootProject) { 20 | repositories { 21 | google() 22 | mavenCentral() 23 | maven { 24 | url "https://maven.tealiumiq.com/android/releases/" 25 | } 26 | } 27 | dependencies { 28 | classpath "com.android.tools.build:gradle:7.2.1" 29 | } 30 | } 31 | 32 | repositories { 33 | mavenCentral() 34 | } 35 | dependencies { 36 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}" 37 | } 38 | } 39 | 40 | version = "1.2.2" 41 | android { 42 | compileSdkVersion safeExtGet("compileSdkVersion", DEFAULT_COMPILE_SDK_VERSION) 43 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 44 | defaultConfig { 45 | minSdkVersion safeExtGet("minSdkVersion", DEFAULT_MIN_SDK_VERSION) 46 | targetSdkVersion safeExtGet("targetSdkVersion", DEFAULT_TARGET_SDK_VERSION) 47 | 48 | buildConfigField "String", "TAG", "\"Tealium-React-Appsflyer-$version\"" 49 | 50 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 51 | } 52 | buildTypes { 53 | release { 54 | minifyEnabled false 55 | } 56 | } 57 | 58 | lintOptions { 59 | disable "GradleCompatible" 60 | } 61 | 62 | def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() 63 | if(agpVersion < 8) { 64 | compileOptions { 65 | sourceCompatibility JavaVersion.VERSION_11 66 | targetCompatibility JavaVersion.VERSION_11 67 | } 68 | 69 | kotlinOptions { 70 | jvmTarget = JavaVersion.VERSION_11 71 | } 72 | } 73 | } 74 | 75 | repositories { 76 | mavenCentral() 77 | google() 78 | } 79 | 80 | dependencies { 81 | // For < 0.71, this will be from the local maven repo 82 | // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin 83 | //noinspection GradleDynamicVersion 84 | implementation "com.facebook.react:react-native:+" 85 | 86 | implementation project(":tealium-react-native") 87 | implementation 'com.tealium.remotecommands:appsflyer:1.3.0' 88 | implementation 'com.tealium:remotecommands:1.0.2' 89 | 90 | implementation "org.jetbrains.kotlin:kotlin-stdlib:${project.ext.kotlinVersion}" 91 | } 92 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/android/gradle.properties: -------------------------------------------------------------------------------- 1 | TealiumReactAppsflyer_kotlinVersion=1.7.0 2 | TealiumReactAppsflyer_minSdkVersion=21 3 | TealiumReactAppsflyer_targetSdkVersion=31 4 | TealiumReactAppsflyer_compileSdkVersion=31 5 | TealiumReactAppsflyer_ndkversion=21.4.7075529 6 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/android/src/main/java/com/tealium/react/appsflyer/AppsFlyerModule.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.appsflyer 2 | 3 | import android.app.Application 4 | import com.facebook.react.ReactPackage 5 | import com.facebook.react.bridge.* 6 | import com.facebook.react.uimanager.ViewManager 7 | import com.tealium.react.RemoteCommandFactory 8 | import com.tealium.react.TealiumReact 9 | import com.tealium.remotecommands.RemoteCommand 10 | import com.tealium.remotecommands.appsflyer.AppsFlyerRemoteCommand 11 | 12 | class AppsFlyerPackage : ReactPackage { 13 | override fun createNativeModules(reactContext: ReactApplicationContext): List { 14 | return listOf(AppsFlyerModule(reactContext)) 15 | } 16 | 17 | override fun createViewManagers(reactContext: ReactApplicationContext): List> { 18 | return emptyList() 19 | } 20 | } 21 | 22 | class AppsFlyerModule(private val reactContext: ReactApplicationContext) : 23 | ReactContextBaseJavaModule(reactContext) { 24 | 25 | @ReactMethod 26 | fun initialize(devKey: String?) { 27 | reactContext.getNativeModule(TealiumReact::class.java) 28 | ?.registerRemoteCommandFactory(AppsFlyerRemoteCommandFactory(devKey)) 29 | } 30 | 31 | private inner class AppsFlyerRemoteCommandFactory(devKey: String?) : RemoteCommandFactory { 32 | override val name = "AppsFlyerRemoteCommand" 33 | private val appsFlyerRemoteCommand = 34 | AppsFlyerRemoteCommand(reactApplicationContext.applicationContext as Application, devKey) 35 | 36 | override fun create(): RemoteCommand { 37 | return appsFlyerRemoteCommand 38 | } 39 | } 40 | 41 | override fun getName(): String { 42 | return MODULE_NAME 43 | } 44 | 45 | companion object { 46 | const val MODULE_NAME = "TealiumReactAppsFlyer" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'tealium-react-appsflyer' { 2 | export default AppsFlyerRemoteCommand; 3 | class AppsFlyerRemoteCommand { 4 | public static name: String 5 | public static initialize(devKey?: string) 6 | } 7 | } -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | 3 | const { TealiumReactAppsFlyer } = NativeModules; 4 | 5 | export default class AppsFlyerRemoteCommand { 6 | static name = "AppsFlyerRemoteCommand"; 7 | 8 | static initialize(devKey) { 9 | if (Platform.OS == 'ios') { 10 | TealiumReactAppsFlyer.initialize(); 11 | } else { 12 | TealiumReactAppsFlyer.initialize(devKey); 13 | } 14 | 15 | } 16 | }; -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/ios/AppsFlyerRemoteCommandWrapper.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TealiumSwift 3 | import TealiumAppsFlyer 4 | import tealium_react_native 5 | 6 | class AppsFlyerRemoteCommandWrapper: RemoteCommandFactory { 7 | var name: String = "AppsFlyerRemoteCommand" 8 | 9 | func create() -> RemoteCommand { 10 | return AppsFlyerRemoteCommand() 11 | } 12 | } -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/ios/TealiumReactAppsFlyer-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/ios/TealiumReactAppsFlyer.m: -------------------------------------------------------------------------------- 1 | // TealiumReactAppsFlyer.m 2 | 3 | #import "React/RCTBridgeModule.h" 4 | 5 | 6 | @interface RCT_EXTERN_MODULE(TealiumReactAppsFlyer, NSObject) 7 | 8 | RCT_EXTERN_METHOD(initialize) 9 | 10 | @end -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/ios/TealiumReactAppsFlyer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import React 3 | import tealium_react_native 4 | 5 | @objc(TealiumReactAppsFlyer) 6 | class TealiumReactAppsflyer: NSObject, RCTBridgeModule { 7 | static func moduleName() -> String! { 8 | "TealiumReactAppsFlyer" 9 | } 10 | let factory = AppsFlyerRemoteCommandWrapper() 11 | 12 | @objc 13 | static func requiresMainQueueSetup() -> Bool { 14 | return false 15 | } 16 | 17 | override init() { 18 | super.init() 19 | TealiumReactNative.registerRemoteCommandFactory(factory) 20 | } 21 | 22 | @objc(initialize) 23 | public func initialize() { 24 | TealiumReactNative.registerRemoteCommandFactory(factory) 25 | } 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-appsflyer", 3 | "title": "Tealium React AppsFlyer", 4 | "version": "1.2.2", 5 | "description": "Package to support the Tealium AppsFlyer Remote Command", 6 | "main": "index.js", 7 | "files": [ 8 | "README.md", 9 | "android", 10 | "!android/build", 11 | "index.js", 12 | "ios", 13 | "tealium-react-appsflyer.podspec" 14 | ], 15 | "scripts": { 16 | "test": "echo \"Error: no test specified\" && exit 1" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 21 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 22 | }, 23 | "keywords": [ 24 | "react-native", 25 | "ios", 26 | "android" 27 | ], 28 | "author": { 29 | "name": "Tealium" 30 | }, 31 | "license": "Commercial", 32 | "licenseFilename": "LICENSE", 33 | "readmeFilename": "README.md", 34 | "peerDependencies": { 35 | "react": ">=16.8.1 || < 19.0.0", 36 | "react-native": ">=0.60.0-rc.0 <1.0.x", 37 | "tealium-react-native": "^2.6.0" 38 | }, 39 | "devDependencies": { 40 | "react": "^16.9.0", 41 | "react-native": "^0.61.5" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-appsflyer/tealium-react-appsflyer.podspec: -------------------------------------------------------------------------------- 1 | # tealium-react-appsflyer.podspec 2 | 3 | require "json" 4 | 5 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 6 | 7 | Pod::Spec.new do |s| 8 | s.name = "tealium-react-appsflyer" 9 | s.version = package["version"] 10 | s.summary = package["description"] 11 | s.description = <<-DESC 12 | tealium-react-appsflyer 13 | DESC 14 | s.homepage = "https://github.com/Tealium/tealium-react-native/remotecommands/tealium-react-appsflyer" 15 | s.license = { :type => "Commercial", :file => "LICENSE" } 16 | s.authors = { "Tealium" => "mobile-team@tealium.com" } 17 | s.platforms = { :ios => "12.0" } 18 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 19 | 20 | s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}" 21 | s.requires_arc = true 22 | 23 | s.dependency "React" 24 | s.dependency "tealium-react-native", "~> 2.6" 25 | s.dependency "tealium-swift/Core", "~> 2.18" 26 | s.dependency "TealiumAppsFlyer", "~> 3.0" 27 | end 28 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # node.js 6 | # 7 | node_modules/ 8 | npm-debug.log 9 | yarn-error.log 10 | 11 | # Xcode 12 | # 13 | build/ 14 | *.pbxuser 15 | !default.pbxuser 16 | *.mode1v3 17 | !default.mode1v3 18 | *.mode2v3 19 | !default.mode2v3 20 | *.perspectivev3 21 | !default.perspectivev3 22 | xcuserdata 23 | *.xccheckout 24 | *.moved-aside 25 | DerivedData 26 | *.hmap 27 | *.ipa 28 | *.xcuserstate 29 | project.xcworkspace 30 | 31 | # Android/IntelliJ 32 | # 33 | build/ 34 | .idea 35 | .gradle 36 | local.properties 37 | *.iml 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/README.md: -------------------------------------------------------------------------------- 1 | # tealium-react-braze 2 | 3 | ## Getting started 4 | 5 | To install the package into your React Native app: 6 | `$ yarn add tealium-react-braze` 7 | 8 | ### Mostly automatic installation 9 | 10 | For iOS only, 11 | `$ cd ios && pod install && cd ..` 12 | 13 | Setup the Braze dependencies according to the standard guides for [iOS](https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/initial_sdk_setup/completing_integration/) and [Android](https://www.braze.com/docs/developer_guide/platform_integration_guides/android/initial_sdk_setup/android_sdk_integration/#basic-integration) to get all required config into you project. 14 | 15 | ## Usage 16 | ```javascript 17 | import BrazeRemoteCommand from 'tealium-react-braze'; 18 | 19 | let config = TealiumConfig { 20 | // ... 21 | remoteCommands: [{ 22 | id: BrazeRemoteCommand.name, 23 | // Optional - path to local JSON mappings 24 | // path: "braze.json" 25 | // Optional - path to remote JSON mappings 26 | // url: "https://some.domain.com/braze.json" 27 | }] 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/android/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/android/build.gradle: -------------------------------------------------------------------------------- 1 | def DEFAULT_COMPILE_SDK_VERSION = 30 2 | def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2' 3 | def DEFAULT_MIN_SDK_VERSION = 21 4 | def DEFAULT_TARGET_SDK_VERSION = 30 5 | 6 | def safeExtGet(prop, fallback) { 7 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 8 | } 9 | 10 | apply plugin: 'com.android.library' 11 | apply plugin: 'kotlin-android' 12 | 13 | buildscript { 14 | 15 | ext { 16 | kotlinVersion = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.0' 17 | } 18 | // The Android Gradle plugin is only required when opening the android folder stand-alone. 19 | // This avoids unnecessary downloads and potential conflicts when the library is included as a 20 | // module dependency in an application project. 21 | // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dep$ 22 | if (project == rootProject) { 23 | repositories { 24 | google() 25 | mavenCentral() 26 | maven { 27 | url "https://maven.tealiumiq.com/android/releases/" 28 | } 29 | } 30 | dependencies { 31 | classpath 'com.android.tools.build:gradle:4.2.2' 32 | } 33 | } 34 | 35 | repositories { 36 | mavenCentral() 37 | } 38 | dependencies { 39 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}" 40 | } 41 | } 42 | 43 | version = "1.2.2" 44 | android { 45 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 46 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 47 | defaultConfig { 48 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 49 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 50 | 51 | buildConfigField "String", "TAG", "\"Tealium-React-Braze-$version\"" 52 | 53 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 54 | } 55 | lintOptions { 56 | abortOnError false 57 | } 58 | } 59 | 60 | repositories { 61 | // ref: https://www.baeldung.com/maven-local-repository 62 | mavenLocal() 63 | maven { 64 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 65 | url "$rootDir/../node_modules/react-native/android" 66 | } 67 | maven { 68 | // Android JSC is installed from npm 69 | url "$rootDir/../node_modules/jsc-android/dist" 70 | } 71 | 72 | maven { 73 | url "https://maven.tealiumiq.com/android/releases/" 74 | } 75 | google() 76 | mavenCentral() 77 | } 78 | 79 | dependencies { 80 | //noinspection GradleDynamicVersion 81 | implementation project(':tealium-react-native') 82 | 83 | implementation 'com.facebook.react:react-native:+' // From node_modules 84 | implementation 'com.tealium:remotecommands:1.0.2' 85 | implementation 'com.tealium.remotecommands:braze:3.0.0' 86 | } 87 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/android/src/main/java/com/tealium/react/braze/BrazeModule.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.braze 2 | 3 | import android.app.Application 4 | import com.facebook.react.ReactPackage 5 | import com.facebook.react.bridge.NativeModule 6 | import com.facebook.react.bridge.ReactApplicationContext 7 | import com.facebook.react.bridge.ReactContextBaseJavaModule 8 | import com.facebook.react.uimanager.ViewManager 9 | import com.tealium.react.RemoteCommandFactory 10 | import com.tealium.react.TealiumReact 11 | import com.tealium.remotecommands.RemoteCommand 12 | import com.tealium.remotecommands.braze.BrazeRemoteCommand 13 | import java.util.* 14 | 15 | open class BrazePackage : ReactPackage { 16 | override fun createNativeModules(reactContext: ReactApplicationContext): List { 17 | return Arrays.asList(BrazeModule(reactContext)) 18 | } 19 | 20 | override fun createViewManagers(reactContext: ReactApplicationContext): List> { 21 | return emptyList() 22 | } 23 | } 24 | 25 | class BrazeModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { 26 | override fun initialize() { 27 | super.initialize() 28 | reactContext.getNativeModule(TealiumReact::class.java)?.registerRemoteCommandFactory(BrazeRemoteCommandFactory()) 29 | } 30 | 31 | private inner class BrazeRemoteCommandFactory : RemoteCommandFactory { 32 | override val name = "BrazeRemoteCommand" 33 | 34 | override fun create(): RemoteCommand { 35 | return BrazeRemoteCommand(reactContext.applicationContext as Application) 36 | } 37 | } 38 | 39 | override fun getName(): String { 40 | return MODULE_NAME 41 | } 42 | 43 | companion object { 44 | private const val MODULE_NAME = "TealiumReactBraze" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'tealium-react-braze' { 2 | export default BrazeRemoteCommand; 3 | class BrazeRemoteCommand { 4 | public static name: String 5 | public static initialize() 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | 3 | const { TealiumReactBraze } = NativeModules; 4 | 5 | export default class BrazeRemoteCommand { 6 | static name = "BrazeRemoteCommand"; 7 | 8 | static initialize() { 9 | if (Platform.OS == 'ios') { 10 | TealiumReactBraze.initialize(); 11 | } 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/ios/BrazeRemoteCommandWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BrazeRemoteCommandWrapper.swift 3 | // tealium-react-braze 4 | // 5 | // Created by Tyler Rister on 03/25/2022. 6 | // 7 | 8 | import Foundation 9 | import TealiumSwift 10 | import TealiumBraze 11 | import tealium_react_native 12 | 13 | class BrazeRemoteCommandWrapper: RemoteCommandFactory { 14 | var name: String = "BrazeRemoteCommand" 15 | 16 | func create() -> RemoteCommand { 17 | return BrazeRemoteCommand() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/ios/TealiumReactBraze.m: -------------------------------------------------------------------------------- 1 | // TealiumReactBraze.m 2 | 3 | #import "React/RCTBridgeModule.h" 4 | 5 | 6 | @interface RCT_EXTERN_MODULE(TealiumReactBraze, NSObject) 7 | 8 | RCT_EXTERN_METHOD(initialize) 9 | 10 | @end 11 | 12 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/ios/TealiumReactBraze.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TealiumReactBraze.swift 3 | // tealium-react-braze 4 | // 5 | // Created by Tyler Rister on 03/25/2022. 6 | // 7 | 8 | import Foundation 9 | import React 10 | import tealium_react_native 11 | 12 | @objc(TealiumReactBraze) 13 | class TealiumReactBraze: NSObject, RCTBridgeModule { 14 | static func moduleName() -> String! { 15 | "TealiumReactBraze" 16 | } 17 | let factory = BrazeRemoteCommandWrapper() 18 | 19 | @objc 20 | static func requiresMainQueueSetup() -> Bool { 21 | return false 22 | } 23 | 24 | override init() { 25 | super.init() 26 | TealiumReactNative.registerRemoteCommandFactory(factory) 27 | } 28 | 29 | @objc(initialize) 30 | public func initialize() { 31 | TealiumReactNative.registerRemoteCommandFactory(factory) 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/ios/TealiumReactBraze.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-braze", 3 | "title": "Tealium React Braze", 4 | "version": "1.2.2", 5 | "description": "Package to support the Tealium Braze Remote Command integration", 6 | "main": "index.js", 7 | "files": [ 8 | "README.md", 9 | "android", 10 | "!android/build", 11 | "index.js", 12 | "ios", 13 | "tealium-react-braze.podspec" 14 | ], 15 | "scripts": { 16 | "test": "echo \"Error: no test specified\" && exit 1" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 21 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 22 | }, 23 | "keywords": [ 24 | "react-native" 25 | ], 26 | "author": { 27 | "name": "Tealium" 28 | }, 29 | "contributors": [ 30 | "Tyler Rister", 31 | "James Keith" 32 | ], 33 | "license": "Commercial", 34 | "licenseFilename": "LICENSE", 35 | "readmeFilename": "README.md", 36 | "peerDependencies": { 37 | "react": ">=16.8.1 || < 19.0.0", 38 | "react-native": ">=0.60.0-rc.0 <1.0.x", 39 | "tealium-react-native": "^2.6.0" 40 | }, 41 | "devDependencies": { 42 | "react": "^16.9.0", 43 | "react-native": "^0.61.5" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-braze/tealium-react-braze.podspec: -------------------------------------------------------------------------------- 1 | # tealium-react-braze.podspec 2 | 3 | require "json" 4 | 5 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 6 | 7 | Pod::Spec.new do |s| 8 | s.name = "tealium-react-braze" 9 | s.version = package["version"] 10 | s.summary = package["description"] 11 | s.description = <<-DESC 12 | tealium-react-braze 13 | DESC 14 | s.homepage = "https://github.com/Tealium/tealium-react-native/remotecommands/tealium-react-braze" 15 | s.license = { :type => "Commercial", :file => "LICENSE" } 16 | s.authors = { "Tyler Rister" => "tyler.rister@tealium.com" } 17 | s.platforms = { :ios => "12.0" } 18 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 19 | 20 | s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}" 21 | s.requires_arc = true 22 | 23 | s.dependency "React" 24 | s.dependency "tealium-react-native", "~> 2.6" 25 | s.dependency "tealium-swift/Core", "~> 2.18" 26 | s.dependency "TealiumBraze", "~> 3.5" 27 | end 28 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # node.js 6 | # 7 | node_modules/ 8 | npm-debug.log 9 | yarn-error.log 10 | 11 | # Xcode 12 | # 13 | build/ 14 | *.pbxuser 15 | !default.pbxuser 16 | *.mode1v3 17 | !default.mode1v3 18 | *.mode2v3 19 | !default.mode2v3 20 | *.perspectivev3 21 | !default.perspectivev3 22 | xcuserdata 23 | *.xccheckout 24 | *.moved-aside 25 | DerivedData 26 | *.hmap 27 | *.ipa 28 | *.xcuserstate 29 | project.xcworkspace 30 | 31 | # Android/IntelliJ 32 | # 33 | build/ 34 | .idea 35 | .gradle 36 | local.properties 37 | *.iml 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/README.md: -------------------------------------------------------------------------------- 1 | # tealium-react-facebook 2 | 3 | ## Getting started 4 | 5 | To install the package into your React Native app: 6 | `$ yarn add tealium-react-facebook` 7 | 8 | ### Mostly automatic installation 9 | 10 | For iOS only, 11 | `$ cd ios && pod install && cd ..` 12 | 13 | Setup the Facebook dependencies according to the standard guides for [iOS](https://developers.facebook.com/docs/ios/getting-started/) and [Android](https://developers.facebook.com/docs/android/getting-started/) to get all required config into you project. 14 | 15 | ## Usage 16 | ```javascript 17 | import FacebookRemoteCommand from 'tealium-react-facebook'; 18 | 19 | let config = TealiumConfig { 20 | // ... 21 | remoteCommands: [{ 22 | id: FacebookRemoteCommand.name, 23 | // Optional - path to local JSON mappings 24 | // path: "facebook.json" 25 | // Optional - path to remote JSON mappings 26 | // url: "https://some.domain.com/facebook.json" 27 | }] 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/android/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/android/build.gradle: -------------------------------------------------------------------------------- 1 | def DEFAULT_COMPILE_SDK_VERSION = 30 2 | def DEFAULT_BUILD_TOOLS_VERSION = '30.0.2' 3 | def DEFAULT_MIN_SDK_VERSION = 21 4 | def DEFAULT_TARGET_SDK_VERSION = 30 5 | 6 | def safeExtGet(prop, fallback) { 7 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 8 | } 9 | 10 | apply plugin: 'com.android.library' 11 | apply plugin: 'kotlin-android' 12 | 13 | buildscript { 14 | 15 | ext { 16 | kotlinVersion = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.0' 17 | } 18 | 19 | if (project == rootProject) { 20 | repositories { 21 | google() 22 | mavenCentral() 23 | maven { 24 | url "https://maven.tealiumiq.com/android/releases/" 25 | } 26 | } 27 | dependencies { 28 | classpath "com.android.tools.build:gradle:7.2.1" 29 | } 30 | } 31 | 32 | repositories { 33 | mavenCentral() 34 | } 35 | dependencies { 36 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.ext.kotlinVersion}" 37 | } 38 | } 39 | 40 | version = "1.0.1" 41 | android { 42 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 43 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 44 | defaultConfig { 45 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 46 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 47 | 48 | buildConfigField "String", "TAG", "\"Tealium-React-Facebook-$version\"" 49 | 50 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 51 | } 52 | 53 | buildTypes { 54 | release { 55 | minifyEnabled false 56 | } 57 | } 58 | 59 | lintOptions { 60 | disable "GradleCompatible" 61 | } 62 | 63 | def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() 64 | if(agpVersion < 8) { 65 | compileOptions { 66 | sourceCompatibility JavaVersion.VERSION_11 67 | targetCompatibility JavaVersion.VERSION_11 68 | } 69 | 70 | kotlinOptions { 71 | jvmTarget = JavaVersion.VERSION_11 72 | } 73 | } 74 | } 75 | 76 | repositories { 77 | mavenCentral() 78 | google() 79 | } 80 | 81 | dependencies { 82 | implementation 'com.facebook.react:react-native:+' 83 | implementation project(':tealium-react-native') 84 | implementation 'com.tealium.remotecommands:facebook:3.0.0' 85 | implementation 'com.tealium:remotecommands:1.0.3' 86 | } 87 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/android/src/main/java/com/tealium/react/facebook/FacebookModule.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.facebook 2 | 3 | import android.app.Application 4 | import com.facebook.react.ReactPackage 5 | import com.facebook.react.bridge.NativeModule 6 | import com.facebook.react.bridge.ReactApplicationContext 7 | import com.facebook.react.bridge.ReactContextBaseJavaModule 8 | import com.facebook.react.bridge.ReactMethod 9 | import com.facebook.react.uimanager.ViewManager 10 | import com.tealium.react.RemoteCommandFactory 11 | import com.tealium.react.TealiumReact 12 | import com.tealium.remotecommands.RemoteCommand 13 | import com.tealium.remotecommands.facebook.FacebookRemoteCommand 14 | import java.util.* 15 | 16 | open class FacebookPackage : ReactPackage { 17 | override fun createNativeModules(reactContext: ReactApplicationContext): List { 18 | return listOf(FacebookModule(reactContext)) 19 | } 20 | 21 | override fun createViewManagers(reactContext: ReactApplicationContext): List> { 22 | return emptyList() 23 | } 24 | } 25 | 26 | class FacebookModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { 27 | 28 | override fun initialize() { 29 | super.initialize() 30 | val factory = FacebookRemoteCommandFactory() 31 | reactContext.getNativeModule(TealiumReact::class.java)?.registerRemoteCommandFactory(factory) 32 | } 33 | 34 | private inner class FacebookRemoteCommandFactory() : RemoteCommandFactory { 35 | override val name = "FacebookRemoteCommand" 36 | 37 | override fun create(): RemoteCommand { 38 | return FacebookRemoteCommand( 39 | reactContext.applicationContext as Application, 40 | ) 41 | } 42 | } 43 | 44 | override fun getName(): String { 45 | return MODULE_NAME 46 | } 47 | 48 | companion object { 49 | private const val MODULE_NAME = "TealiumReactFacebook" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'tealium-react-facebook' { 2 | export default FacebookRemoteCommand; 3 | class FacebookRemoteCommand { 4 | public static name: String 5 | public static initialize() 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | 3 | const { TealiumReactFacebook } = NativeModules; 4 | 5 | export default class FacebookRemoteCommand { 6 | static name = "FacebookRemoteCommand"; 7 | 8 | static initialize() { 9 | if (Platform.OS == 'ios') { 10 | TealiumReactFacebook.initialize(); 11 | } 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/ios/FacebookRemoteCommandWrapper.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import TealiumSwift 3 | import TealiumFacebook 4 | import tealium_react_native 5 | 6 | class FacebookRemoteCommandWrapper: RemoteCommandFactory { 7 | var name: String = "FacebookRemoteCommand" 8 | 9 | func create() -> RemoteCommand { 10 | return FacebookRemoteCommand() 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/ios/TealiumReactFacebook.m: -------------------------------------------------------------------------------- 1 | // TealiumReactFacebook.m 2 | 3 | #import "React/RCTBridgeModule.h" 4 | 5 | 6 | @interface RCT_EXTERN_MODULE(TealiumReactFacebook, NSObject) 7 | 8 | RCT_EXTERN_METHOD(initialize) 9 | 10 | @end 11 | 12 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/ios/TealiumReactFacebook.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import React 3 | import tealium_react_native 4 | 5 | @objc(TealiumReactFacebook) 6 | class TealiumReactFacebook: NSObject, RCTBridgeModule { 7 | static func moduleName() -> String! { 8 | "TealiumReactFacebook" 9 | } 10 | let factory = FacebookRemoteCommandWrapper() 11 | 12 | @objc 13 | static func requiresMainQueueSetup() -> Bool { 14 | return false 15 | } 16 | 17 | override init() { 18 | super.init() 19 | TealiumReactNative.registerRemoteCommandFactory(factory) 20 | } 21 | 22 | @objc(initialize) 23 | public func initialize() { 24 | TealiumReactNative.registerRemoteCommandFactory(factory) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/ios/TealiumReactFacebook.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-facebook", 3 | "title": "Tealium React Facebook", 4 | "version": "1.0.1", 5 | "description": "Package to support the Tealium Facebook Remote Command integration", 6 | "main": "index.js", 7 | "files": [ 8 | "README.md", 9 | "android", 10 | "!android/build", 11 | "index.js", 12 | "ios", 13 | "tealium-react-facebook.podspec" 14 | ], 15 | "scripts": { 16 | "test": "echo \"Error: no test specified\" && exit 1" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 21 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 22 | }, 23 | "keywords": [ 24 | "react-native", 25 | "ios", 26 | "android" 27 | ], 28 | "author": { 29 | "name": "Tealium" 30 | }, 31 | "license": "Commercial", 32 | "licenseFilename": "LICENSE", 33 | "readmeFilename": "README.md", 34 | "peerDependencies": { 35 | "react": ">=16.8.1 || < 19.0.0", 36 | "react-native": ">=0.60.0-rc.0 <1.0.x", 37 | "tealium-react-native": "^2.6.0" 38 | }, 39 | "devDependencies": { 40 | "react": "^16.9.0", 41 | "react-native": "^0.61.5" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-facebook/tealium-react-facebook.podspec: -------------------------------------------------------------------------------- 1 | # tealium-react-facebook.podspec 2 | 3 | require "json" 4 | 5 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 6 | 7 | Pod::Spec.new do |s| 8 | s.name = "tealium-react-facebook" 9 | s.version = package["version"] 10 | s.summary = package["description"] 11 | s.description = <<-DESC 12 | tealium-react-facebook 13 | DESC 14 | s.homepage = "https://github.com/Tealium/tealium-react-native/remotecommands/tealium-react-facebook" 15 | s.license = { :type => "Commercial", :file => "LICENSE" } 16 | s.authors = { "Tealium" => "mobile-team@tealium.com" } 17 | s.platforms = { :ios => "12.0" } 18 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 19 | 20 | s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}" 21 | s.requires_arc = true 22 | 23 | s.dependency "React" 24 | s.dependency "tealium-react-native", "~> 2.6" 25 | s.dependency "tealium-swift/Core", "~> 2.18" 26 | s.dependency "TealiumFacebook", "~> 2.0" 27 | end 28 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # node.js 6 | # 7 | node_modules/ 8 | npm-debug.log 9 | yarn-error.log 10 | 11 | # Xcode 12 | # 13 | build/ 14 | *.pbxuser 15 | !default.pbxuser 16 | *.mode1v3 17 | !default.mode1v3 18 | *.mode2v3 19 | !default.mode2v3 20 | *.perspectivev3 21 | !default.perspectivev3 22 | xcuserdata 23 | *.xccheckout 24 | *.moved-aside 25 | DerivedData 26 | *.hmap 27 | *.ipa 28 | *.xcuserstate 29 | project.xcworkspace 30 | 31 | # Android/IntelliJ 32 | # 33 | build/ 34 | .idea 35 | .gradle 36 | local.properties 37 | *.iml 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": [ 3 | "node_modules" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/README.md: -------------------------------------------------------------------------------- 1 | # tealium-react-firebase 2 | 3 | ## Getting started 4 | 5 | To install the package into your React Native app: 6 | `$ yarn add tealium-react-firebase` 7 | 8 | ### Mostly automatic installation 9 | 10 | For iOS only, 11 | `$ cd ios && pod install && cd ..` 12 | 13 | Setup the Firebase dependencies according to the standard guides for [iOS](https://firebase.google.com/docs/ios/setup) and [Android](https://firebase.google.com/docs/android/setup) to get all required config into you project. 14 | 15 | ## Usage 16 | ```javascript 17 | import FirebaseRemoteCommand from 'tealium-react-firebase'; 18 | 19 | let config = TealiumConfig { 20 | // ... 21 | remoteCommands: [{ 22 | id: FirebaseRemoteCommand.name, 23 | // Optional - path to local JSON mappings 24 | // path: "firebase.json" 25 | // Optional - path to remote JSON mappings 26 | // url: "https://some.domain.com/firebase.json" 27 | }] 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/android/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tealium/tealium-react-native/0c9b65cf152420a3fb8b428d98c743911b9c4bef/remotecommands/tealium-react-firebase/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/android/src/main/java/com/tealium/react/firebase/FirebaseModule.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.firebase 2 | 3 | import android.app.Application 4 | import com.facebook.react.ReactPackage 5 | import com.facebook.react.bridge.NativeModule 6 | import com.facebook.react.bridge.ReactApplicationContext 7 | import com.facebook.react.bridge.ReactContextBaseJavaModule 8 | import com.facebook.react.uimanager.ViewManager 9 | import com.tealium.react.RemoteCommandFactory 10 | import com.tealium.react.TealiumReact 11 | import com.tealium.remotecommands.RemoteCommand 12 | import com.tealium.remotecommands.firebase.FirebaseRemoteCommand 13 | import java.util.* 14 | 15 | open class FirebasePackage : ReactPackage { 16 | override fun createNativeModules(reactContext: ReactApplicationContext): List { 17 | return Arrays.asList(FirebaseModule(reactContext)) 18 | } 19 | 20 | override fun createViewManagers(reactContext: ReactApplicationContext): List> { 21 | return emptyList() 22 | } 23 | } 24 | 25 | class FirebaseModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { 26 | override fun initialize() { 27 | super.initialize() 28 | reactContext.getNativeModule(TealiumReact::class.java)?.registerRemoteCommandFactory(FirebaseRemoteCommandFactory()) 29 | } 30 | 31 | private inner class FirebaseRemoteCommandFactory : RemoteCommandFactory { 32 | override val name = "FirebaseRemoteCommand" 33 | 34 | override fun create(): RemoteCommand { 35 | return FirebaseRemoteCommand(reactContext.applicationContext as Application) 36 | } 37 | } 38 | 39 | override fun getName(): String { 40 | return MODULE_NAME 41 | } 42 | 43 | companion object { 44 | private const val MODULE_NAME = "TealiumReactFirebase" 45 | } 46 | } -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/android/src/test/java/com/tealium/react/firebase/FirebaseModuleTests.kt: -------------------------------------------------------------------------------- 1 | package com.tealium.react.firebase 2 | 3 | import android.app.Application 4 | import com.facebook.react.bridge.ReactApplicationContext 5 | import com.google.firebase.analytics.FirebaseAnalytics 6 | import com.tealium.react.RemoteCommandFactory 7 | import com.tealium.react.TealiumReact 8 | import com.tealium.remotecommands.firebase.FirebaseRemoteCommand 9 | import io.mockk.* 10 | import io.mockk.impl.annotations.RelaxedMockK 11 | import org.junit.Assert.assertTrue 12 | import org.junit.Before 13 | import org.junit.Test 14 | import org.junit.runner.RunWith 15 | import org.robolectric.RobolectricTestRunner 16 | import org.robolectric.annotation.Config 17 | 18 | @RunWith(RobolectricTestRunner::class) 19 | @Config(sdk = [21, 28]) 20 | class FirebaseModuleTests { 21 | 22 | @RelaxedMockK 23 | lateinit var mockApplication: Application 24 | 25 | @RelaxedMockK 26 | lateinit var mockReactContext: ReactApplicationContext 27 | 28 | @RelaxedMockK 29 | lateinit var mockTealiumReact: TealiumReact 30 | 31 | @Before 32 | fun setUp() { 33 | MockKAnnotations.init(this) 34 | 35 | every { mockReactContext.getNativeModule(TealiumReact::class.java) } returns mockTealiumReact 36 | every { mockReactContext.applicationContext } returns mockApplication 37 | mockkStatic(FirebaseAnalytics::class) 38 | every { FirebaseAnalytics.getInstance(any()) } returns mockk() 39 | } 40 | 41 | @Test 42 | fun initialize_RegistersFactory() { 43 | FirebaseModule(mockReactContext).initialize() 44 | 45 | verify { 46 | mockTealiumReact.registerRemoteCommandFactory(any()) 47 | } 48 | } 49 | 50 | @Test 51 | fun factory_CreatesFirebaseRemoteCommandInstance() { 52 | val factorySlot = CapturingSlot() 53 | every { mockTealiumReact.registerRemoteCommandFactory(capture(factorySlot)) } returns Unit 54 | 55 | FirebaseModule(mockReactContext).initialize() 56 | val firebaseCommand = factorySlot.captured.create() 57 | assertTrue(firebaseCommand is FirebaseRemoteCommand) 58 | } 59 | } -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'tealium-react-firebase' { 2 | export default FirebaseRemoteCommand; 3 | class FirebaseRemoteCommand { 4 | public static name: String 5 | public static initialize() 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | 3 | const { TealiumReactFirebase } = NativeModules; 4 | 5 | export default class FirebaseRemoteCommand { 6 | static name = "FirebaseRemoteCommand"; 7 | 8 | static initialize() { 9 | if (Platform.OS == 'ios') { 10 | TealiumReactFirebase.initialize(); 11 | } 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/ios/Firebase.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/ios/FirebaseRemoteCommandWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirebaseRemoteCommandWrapper.swift 3 | // tealium-react-firebase 4 | // 5 | // Created by James Keith on 11/03/2021. 6 | // 7 | 8 | import Foundation 9 | import TealiumSwift 10 | import TealiumFirebase 11 | import tealium_react_native 12 | 13 | class FirebaseRemoteCommandWrapper: RemoteCommandFactory { 14 | var name: String = "FirebaseRemoteCommand" 15 | 16 | func create() -> RemoteCommand { 17 | return FirebaseRemoteCommand() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/ios/TealiumReactFirebase.m: -------------------------------------------------------------------------------- 1 | #import "React/RCTBridgeModule.h" 2 | 3 | @interface RCT_EXTERN_MODULE(TealiumReactFirebase, NSObject) 4 | 5 | RCT_EXTERN_METHOD(initialize) 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/ios/TealiumReactFirebase.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TealiumReactFirebase.swift 3 | // tealium-react-firebase 4 | // 5 | // Created by James Keith on 11/03/2021. 6 | // 7 | 8 | import Foundation 9 | import React 10 | import tealium_react_native 11 | 12 | @objc(TealiumReactFirebase) 13 | class TealiumReactFirebase: NSObject, RCTBridgeModule { 14 | static func moduleName() -> String! { 15 | "TealiumReactFirebase" 16 | } 17 | let factory = FirebaseRemoteCommandWrapper() 18 | 19 | @objc 20 | static func requiresMainQueueSetup() -> Bool { 21 | return false 22 | } 23 | 24 | override init() { 25 | super.init() 26 | TealiumReactNative.registerRemoteCommandFactory(factory) 27 | } 28 | 29 | @objc(initialize) 30 | public func initialize() { 31 | TealiumReactNative.registerRemoteCommandFactory(factory) 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/ios/tealium-react-firebase-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tealium-react-firebase", 3 | "title": "Tealium React Firebase", 4 | "version": "1.4.1", 5 | "description": "Package to support the Tealium Firebase Remote Command integration", 6 | "main": "index.js", 7 | "files": [ 8 | "README.md", 9 | "android", 10 | "!android/build", 11 | "index.js", 12 | "ios", 13 | "tealium-react-firebase.podspec" 14 | ], 15 | "scripts": { 16 | "test": "echo \"Error: no test specified\" && exit 1" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/Tealium/tealium-react-native.git", 21 | "baseUrl": "https://github.com/Tealium/tealium-react-native" 22 | }, 23 | "keywords": [ 24 | "react-native", 25 | "firebase" 26 | ], 27 | "author": { 28 | "name": "Tealium" 29 | }, 30 | "contributors": [ 31 | "James Keith", 32 | "Christina Sund" 33 | ], 34 | "license": "Commercial", 35 | "licenseFilename": "LICENSE", 36 | "readmeFilename": "README.md", 37 | "peerDependencies": { 38 | "react": ">=16.8.1 || < 19.0.0", 39 | "react-native": ">=0.60.0-rc.0 <1.0.x", 40 | "tealium-react-native": "^2.6.0" 41 | }, 42 | "devDependencies": { 43 | "react": "^16.9.0", 44 | "react-native": "^0.61.5" 45 | }, 46 | "dependencies": {} 47 | } 48 | -------------------------------------------------------------------------------- /remotecommands/tealium-react-firebase/tealium-react-firebase.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "tealium-react-firebase" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | tealium-react-firebase 11 | DESC 12 | s.homepage = "https://github.com/Tealium/tealium-react-native/remotecommands/tealium-react-firebase" 13 | s.license = { :type => "Commercial", :file => "LICENSE" } 14 | s.authors = { "Your Name" => "yourname@email.com" } 15 | s.platforms = { :ios => "12.0" } 16 | s.source = { :git => "https://github.com/Tealium/tealium-react-native.git", :tag => "#{s.version}" } 17 | 18 | s.source_files = "ios/**/*.{h,c,m,swift}" 19 | s.requires_arc = true 20 | s.static_framework = true 21 | 22 | s.dependency "React-Core" 23 | s.dependency "tealium-react-native", "~> 2.6" 24 | s.dependency "tealium-swift/Core", "~> 2.18" 25 | s.dependency "TealiumFirebase", "~> 4.0" 26 | end 27 | --------------------------------------------------------------------------------