invertase / react-native-google-mobile-ads

React Native Google Mobile Ads enables you to monetize your app with AdMob.
https://docs.page/invertase/react-native-google-mobile-ads
Other
625 stars 121 forks source link

[🐛] Bug consent form not loaded on Android on version 12.2.0 #553

Closed ivannzme closed 2 months ago

ivannzme commented 4 months ago

What happened?

When installed the npm package on version 12.2.0, the consent form is not loaded as the consentInfo object is always returning {"canRequestAds": true, "isConsentFormAvailable": false, "privacyOptionsRequirementStatus": "NOT_REQUIRED", "status": "NOT_REQUIRED"}

image

On iOS it is returning and showing the form without problems and the isConsentFormAvailable value is 1.

Java version that is used in our project: openjdk version "11.0.20.1" 2023-08-24 LTS OpenJDK Runtime Environment Zulu11.66+19-CA (build 11.0.20.1+1-LTS) OpenJDK 64-Bit Server VM Zulu11.66+19-CA (build 11.0.20.1+1-LTS, mixed mode)

Platforms

Only on Android

React Native Info

System:
  OS: macOS 13.5.2
  CPU: (8) arm64 Apple M1
  Memory: 804.83 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 16.20.2
    path: ~/.nvm/versions/node/v16.20.2/bin/node
  Yarn: Not Found
  npm:
    version: 8.19.4
    path: ~/.nvm/versions/node/v16.20.2/bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/jinghuatan/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.20.1
    path: /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/bin/javac
  Ruby:
    version: 3.1.3
    path: /Users/jinghuatan/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 17.0.2
    wanted: 17.0.2
  react-native:
    installed: 0.67.4
    wanted: 0.67.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: false
  newArchEnabled: false

info React Native v0.73.5 is now available (your project is running on v0.67.4).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.73.5
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.73.5
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Are your using Typescript?

package.json

{
  "name": "NZHReactNative",
  "version": "6.1.0",
  "private": true,
  "scripts": {
    "start": "react-native start",
    "postinstall": "patch-package && node utils/postinstall.js",
    "swagger": "node utils/swagger.js && eslint App/Utils/Api.js --fix",
    "android": "react-native run-android",
    "android-sit": "export ENVFILE=.env.sandbox && react-native run-android",
    "android-prod": "export ENVFILE=.env.live && react-native run-android",
    "ios": "react-native run-ios",
    "ios-sit": "export ENVFILE=.env.sandbox && react-native run-ios",
    "ios-prod": "export ENVFILE=.env.live && react-native run-ios",
    "clean": "react-native clean-project-auto",
    "run-iphone6": "react-native run-ios --simulator \"iPhone 6 Default\"",
    "android:fullbuild": "cd android && ./gradlew clean && ./gradlew assembleRelease &&  open app/build/outputs/apk/release/ && cd ../../../../../../",
    "test": "jest",
    "test-ci": "jest --ci --runInBand",
    "coverage": "jest --coverage --ci --runInBand",
    "lint": "eslint .",
    "preversion": "source ./npm-version/pre-version.sh",
    "version": "node ./npm-version/version-ios.js",
    "postversion": "source ./npm-version/post-version.sh",
    "create-beta-branch": "source ./npm-version/create-beta-branch.sh",
    "create-installation-packages": "source ./test_automation_utils/create-installation-packages",
    "prepare": "husky install"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.17.12",
    "@react-native-clipboard/clipboard": "^1.11.1",
    "@react-native-community/cli-platform-android": "^4.13.0",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/netinfo": "^9.4.1",
    "@react-native-cookies/cookies": "^6.2.1",
    "@react-native-firebase/analytics": "^14.9.1",
    "@react-native-firebase/app": "^14.9.1",
    "@react-native-firebase/crashlytics": "^14.9.1",
    "@react-native-firebase/installations": "^14.9.1",
    "@react-native-firebase/perf": "^14.9.1",
    "@react-native-firebase/remote-config": "^14.9.1",
    "@react-native-picker/picker": "^2.5.1",
    "@react-navigation/bottom-tabs": "^6.3.2",
    "@react-navigation/material-top-tabs": "^6.6.2",
    "@react-navigation/native": "^6.0.11",
    "@react-navigation/stack": "^6.2.2",
    "abortcontroller-polyfill": "^1.7.3",
    "compare-versions": "^3.5.1",
    "dotenv-parse-variables": "^0.2.3",
    "entities": "^2.0.0",
    "formik": "^2.2.9",
    "htmlparser2": "^4.0.0",
    "is-html": "^3.0.0",
    "jetifier": "^1.6.4",
    "lottie-ios": "3.2.3",
    "lottie-react-native": "4.0.3",
    "mobx": "^5.13.0",
    "mobx-react": "^6.1.3",
    "moment-timezone": "^0.5.34",
    "prop-types": "^15.7.2",
    "q": "^1.5.1",
    "ramda": "^0.29.0",
    "react": "17.0.2",
    "react-content-loader": "^6.2.1",
    "react-native": "0.67.4",
    "react-native-ad-manager": "https://github.com/NZME/react-native-ad-manager.git#feature/upgrade-to-support-newest-gma-sdk-possible",
    "react-native-android-image-polyfill": "https://github.com/NZME/react-native-android-image-polyfill.git",
    "react-native-app-intro-slider": "^4.0.4",
    "react-native-appboy-sdk": "^1.37.0",
    "react-native-autoheight-webview": "^1.6.5",
    "react-native-brightcove-ima-player": "https://github.com/NZME/react-native-brightcove-ima-player.git#feature/upgrade-to-support-newest-possible-gma-sdk",
    "react-native-can-make-payments": "0.0.3",
    "react-native-collapsible": "^1.6.0",
    "react-native-config": "^1.5.0",
    "react-native-crypto": "https://github.com/NZME/react-native-crypto.git",
    "react-native-crypto-js": "^1.0.0",
    "react-native-device-info": "^10.12.0",
    "react-native-draggable-flatlist": "^4.0.1",
    "react-native-fast-image": "^8.5.11",
    "react-native-gesture-handler": "^2.12.1",
    "react-native-google-mobile-ads": "12.2.0",
    "react-native-get-random-values": "^1.9.0",
    "react-native-iap": "10.1.3",
    "react-native-idfa": "https://github.com/ptomasroos/react-native-idfa.git",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-landmarksid": "1.1.2",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-modalize": "^2.0.12",
    "react-native-nielsen-nzme": "https://github.com/NZME/react-native-nielsen-nzme.git#lockNielsenSdkVersion9",
    "react-native-orientation-locker": "^1.4.0",
    "react-native-pager-view": "^6.2.0",
    "react-native-permissions": "^3.7.3",
    "react-native-picker-select": "^9.0.0",
    "react-native-rate": "^1.2.9",
    "react-native-ratings": "^7.2.0",
    "react-native-reanimated": "^3.4.2",
    "react-native-render-html": "^4.2.0",
    "react-native-safe-area-context": "^4.6.4",
    "react-native-screens": "3.23.0",
    "react-native-share": "^7.3.2",
    "react-native-svg": "^13.14.0",
    "react-native-swipe-list-view": "^2.0.3",
    "react-native-tab-view": "^3.5.1",
    "react-native-text-ticker": "^1.14.0",
    "react-native-vector-icons": "^7.1.0",
    "react-native-webp-support": "github:TGPSKI/react-native-webp-support",
    "react-native-webview": "^13.6.2",
    "yup": "^0.32.11"
  },
  "devDependencies": {
    "@babel/core": "7.21.0",
    "@babel/plugin-proposal-decorators": "^7.21.0",
    "@babel/runtime": "^7.21.0",
    "@react-native-community/eslint-config": "^3.2.0",
    "@testing-library/jest-native": "^4.0.5",
    "@testing-library/react-native": "^11.0.0",
    "@types/jest": "^27.0.3",
    "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
    "babel-jest": "^29.5.0",
    "babel-plugin-module-resolver": "^4.1.0",
    "enzyme": "^3.11.0",
    "eslint": "^8.20.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-jest": "^27.2.1",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-react": "^7.30.1",
    "husky": "^8.0.1",
    "jest": "^26.6.3",
    "jest-enzyme": "^7.1.2",
    "jest-extended": "^1.2.1",
    "jest-fetch-mock": "^3.0.3",
    "jsc-android": "^250230.2.1",
    "metro": "^0.66.2",
    "metro-config": "^0.66.2",
    "metro-minify-uglify": "^0.76.8",
    "metro-react-native-babel-preset": "^0.66.2",
    "metro-react-native-babel-transformer": "^0.77.0",
    "metro-transform-worker": "^0.80.5",
    "patch-package": "^8.0.0",
    "plist": "^3.0.4",
    "prettier": "^2.7.1",
    "react-dom": "17.0.2",
    "react-native-clean-project": "^3.6.7",
    "react-native-svg-transformer": "^1.1.0",
    "react-test-renderer": "17.0.2",
    "swagger-js-codegen": "^1.13.0"
  },
  "jest": {
    "preset": "react-native",
    "collectCoverageFrom": [
      "App/**/*.js"
    ],
    "coveragePathIgnorePatterns": [
      "<rootDir>/App/Unused/",
      "<rootDir>/App/Utils/Api",
      "<rootDir>/App/Screens/TestScreen",
      "<rootDir>/App/Components/ScrollableTabBar"
    ],
    "coverageReporters": [
      "text",
      "html",
      "cobertura"
    ],
    "testMatch": [
      "<rootDir>/__tests__/**/*.test.js?(x)",
      "<rootDir>/App/**/*.test.js"
    ],
    "moduleNameMapper": {
      "\\.svg": "<rootDir>/__mocks__/svgrMock.js"
    },
    "testPathIgnorePatterns": [
      "<rootDir>/ios/Pods"
    ],
    "transform": {
      "^.+\\.[t|j]sx?$": "babel-jest"
    },
    "transformIgnorePatterns": [
      "<rootDir>/node_modules/(?!react-native|@react-native|native-base|react-navigation|@react-navigation|@react-native-community|@testing-library)"
    ],
    "setupFiles": [
      "./enzyme.setup.js",
      "./jest.setup.js",
      "./node_modules/react-native-gesture-handler/jestSetup.js"
    ],
    "setupFilesAfterEnv": [
      "jest-extended/all",
      "@testing-library/jest-native/extend-expect"
    ]
  }
}

app.json

{
  "name": "NZHReactNative",
  "displayName": "NZ Herald",
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-5276995754775409~9391781936",
    "ios_app_id": "ca-app-pub-5276995754775409~3334910914",
    "delay_app_measurement_init": true
  }
}

ios/Podfile

No response

android/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

import groovy.json.JsonSlurper

def getNpmVersion() {
    def inputFile = new File(project.projectDir.toString() + "/../package.json")
    def packageJson = new JsonSlurper().parseText(inputFile.text)
    return packageJson["version"]
}

def getNpmVersionArray() { // major [0], minor [1], patch [2]
    def (major, minor, patch) = getNpmVersion().tokenize('.')
    return [Integer.parseInt(major), Integer.parseInt(minor), Integer.parseInt(patch)] as int[]
}

project.ext {
    excludeAppGlideModule = true
    glideVersion = "4.9.0"
}

buildscript {
    ext {
        buildToolsVersion = "30.0.3"
        minSdkVersion = 24
        compileSdkVersion = 33
        targetSdkVersion = 33
        supportLibVersion = "29.0.3"
        ndkVersion = "24.0.8215888"
        ext.kotlinVersion = '1.7.10'
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:4.2.2')
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2'
        classpath 'com.google.firebase:perf-plugin:1.4.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        exclusiveContent {
            // We get React Native's Android binaries exclusively through npm,
            // from a local Maven repo inside node_modules/react-native/.
            // (The use of exclusiveContent prevents looking elsewhere like Maven Central
            // and potentially getting a wrong version.)
            filter {
                includeGroup "com.facebook.react"
            }
            forRepository {
                maven {
                    url "$rootDir/../node_modules/react-native/android"
                }
            }
        }        
        google()
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven {
            url 'https://repo.brightcove.com/releases'
        }
        maven {
            url "https://appboy.github.io/appboy-android-sdk/sdk"
        }
        maven {
            url 'https://raw.githubusercontent.com/NielsenDigitalSDK/nielsenappsdk-android/master/'
        }
        maven {
            url "https://jitpack.io"
            credentials {
                username project.property("landmarkid_username")
            }
        }
    }
}

subprojects {
    ext {
        def npmVersion = getNpmVersionArray()
        versionMajor = npmVersion[0]
        versionMinor = npmVersion[1]
        versionPatch = npmVersion[2]
    }
}

android/app/build.gradle

buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
    }
}

apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf'

import com.android.build.OutputFile

/**
 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
 * and bundleReleaseJsAndAssets).
 * These basically call `react-native bundle` with the correct arguments during the Android build
 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
 * bundle directly from the development server. Below you can see all the possible configurations
 * and their defaults. If you decide to add a configuration block, make sure to add it before the
 * `apply from: "../../node_modules/react-native/react.gradle"` line.
 *
 * project.ext.react = [
 *   // the name of the generated asset file containing your JS bundle
 *   bundleAssetName: "index.android.bundle",
 *
 *   // the entry file for bundle generation
 *   entryFile: "index.android.js",
 *
 *   // whether to bundle JS and assets in debug mode
 *   bundleInDebug: false,
 *
 *   // whether to bundle JS and assets in release mode
 *   bundleInRelease: true,
 *
 *   // whether to bundle JS and assets in another build variant (if configured).
 *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
 *   // The configuration property can be in the following formats
 *   //         'bundleIn${productFlavor}${buildType}'
 *   //         'bundleIn${buildType}'
 *   // bundleInFreeDebug: true,
 *   // bundleInPaidRelease: true,
 *   // bundleInBeta: true,
 *
 *   // whether to disable dev mode in custom build variants (by default only disabled in release)
 *   // for example: to disable dev mode in the staging build type (if configured)
 *   devDisabledInStaging: true,
 *   // The configuration property can be in the following formats
 *   //         'devDisabledIn${productFlavor}${buildType}'
 *   //         'devDisabledIn${buildType}'
 *
 *   // the root of your project, i.e. where "package.json" lives
 *   root: "../../",
 *
 *   // where to put the JS bundle asset in debug mode
 *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
 *
 *   // where to put the JS bundle asset in release mode
 *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in debug mode
 *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in release mode
 *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
 *
 *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
 *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
 *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
 *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
 *   // for example, you might want to remove it from here.
 *   inputExcludes: ["android/**", "ios/**"],
 *
 *   // override which node gets called and with what additional arguments
 *   nodeExecutableAndArgs: ["node"],
 *
 *   // supply additional arguments to the packager
 *   extraPackagerArgs: []
 * ]
 */
project.ext.envConfigFiles = [
        debug: ".env",
        release: ".env",
        sitrelease: ".env.sandbox",
        prodrelease: ".env.live"
]

project.ext.react = [
    entryFile: "index.js",
    enableHermes: false,
]

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

apply from: "../../node_modules/react-native/react.gradle"

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    ndkVersion rootProject.ext.ndkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion
    compileSdkVersion rootProject.ext.compileSdkVersion

    ndkVersion rootProject.ext.ndkVersion

    def gitCommitCount = "git rev-list HEAD --count".execute(null, rootProject.projectDir).text.trim().toBigInteger()
    project.ext.set("versionCode", gitCommitCount)

    def prodReleaseVersionCode = versionMajor * 10000 + versionMinor * 100 + versionPatch + gitCommitCount

    // compileOptions {
    //     sourceCompatibility JavaVersion.VERSION_1_8
    //     targetCompatibility JavaVersion.VERSION_1_8
    // }

    packagingOptions {
        pickFirst '**/armeabi-v7a/libc++_shared.so'
        pickFirst '**/x86/libc++_shared.so'
        pickFirst '**/x86_64/libc++_shared.so'
        pickFirst '**/arm64-v8a/libc++_shared.so'
        pickFirst '**/libjsc.so'
    }

    defaultConfig {
        applicationId "com.nzherald.activities"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        renderscriptTargetApi rootProject.ext.compileSdkVersion
        renderscriptSupportModeEnabled true
        /**
         * versionCode and versionName are now based on npm version [<newversion> | major | minor | patch]
         * derived from package.json.
        */
        versionCode project.versionCode
        versionName "${versionMajor}.${versionMinor}.${versionPatch}"
        multiDexEnabled true

        testBuildType System.getProperty('testBuildType', 'debug')  // This will later be used to control the test apk build type
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        // react-native-iap: we only use the Google Play flavor
        missingDimensionStrategy 'store', 'play'
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    signingConfigs {
        release {
            // Load keystore
            def keystorePropertiesFile = rootProject.file("keystore.properties");
            def keystoreProperties = new Properties()
            if (keystorePropertiesFile.exists()) {
                keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
                storeFile file(keystoreProperties['NZH_RELEASE_STORE_FILE'])
                storePassword keystoreProperties['NZH_RELEASE_STORE_PASSWORD']
                keyAlias keystoreProperties['NZH_RELEASE_KEY_ALIAS']
                keyPassword keystoreProperties['NZH_RELEASE_KEY_PASSWORD']
            }
        }
        prodrelease {
            // Load keystore
            def keystorePropertiesFile = rootProject.file("keystore.properties");
            def keystoreProperties = new Properties()
            if (keystorePropertiesFile.exists()) {
                keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
                storeFile file(keystoreProperties['NZH_RELEASE_STORE_FILE'])
                storePassword keystoreProperties['NZH_RELEASE_STORE_PASSWORD']
                keyAlias keystoreProperties['NZH_RELEASE_KEY_ALIAS']
                keyPassword keystoreProperties['NZH_RELEASE_KEY_PASSWORD']
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
            // firebaseCrashlytics {
            //     nativeSymbolUploadEnabled true
            // }
        }
        sitrelease {
            initWith release
            matchingFallbacks = ['release']
        }
        prodrelease {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.prodrelease
            matchingFallbacks = ['release']
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
        if (variant.name == 'prodrelease') {
            variant.outputs.each { output ->
            output.versionCodeOverride = prodReleaseVersionCode
            }
        }
    }
}

repositories {
    jcenter()
}

def enableHermes = project.ext.react.get("enableHermes", false);

dependencies {
    implementation project(':react-native-iap')
    // Make sure to put android-jsc at the top
    implementation 'org.webkit:android-jsc:r250230'
    implementation project(':react-native-config')
    implementation project(':react-native-fast-image')
    implementation project(':react-native-orientation-locker')
    implementation project(':react-native-nielsen-nzme')
    implementation project(':@react-native-community_netinfo')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation ('com.google.android.gms:play-services-ads:20.2.0'){
        force = true;
    }

    // Import the Firebase BoM
    implementation platform('com.google.firebase:firebase-bom:30.4.0')

    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-perf'
    implementation 'com.google.firebase:firebase-messaging'

    implementation 'com.facebook.fresco:webpsupport:1.3.0'
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:0.67.4"  // From node_modules
    implementation "com.google.android.gms:play-services-tagmanager:17.0.0"
    implementation "androidx.lifecycle:lifecycle-extensions:2.1.0"
    implementation 'com.facebook.soloader:soloader:0.10.5'

    implementation 'com.google.code.gson:gson:2.8.9'
    implementation 'androidx.work:work-runtime:2.7.1'

    if (enableHermes) {
      // For RN 0.60.x
      // def hermesPath = "../../node_modules/hermesvm/android/";
      // for RN 0.61+
      def hermesPath = "../../node_modules/hermes-engine/android/";
      debugImplementation files(hermesPath + "hermes-debug.aar")
      releaseImplementation files(hermesPath + "hermes-release.aar")
    }
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.implementation
    into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

android/settings.gradle

rootProject.name = 'NZHReactNative'
include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
include ':react-native-appboy-sdk'
project(':react-native-appboy-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-appboy-sdk/android')
include ':react-native-orientation-locker'
project(':react-native-orientation-locker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-orientation-locker/android')
include ':react-native-fast-image'
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
include ':@react-native-community_netinfo'
project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/netinfo/android')

include ':react-native-nielsen-nzme'
project(':react-native-nielsen-nzme').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-nielsen-nzme/android')

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.nzherald.activities">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="com.android.vending.BILLING"/>
    <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>

    <application
            android:name=".MainApplication"
            android:label="@string/app_name"
            android:icon="@mipmap/ic_launcher"
            android:allowBackup="false"
            android:theme="@style/AppTheme"
            android:usesCleartextTraffic="true"
            tools:targetApi="28">
        <activity
                android:name=".MainActivity"
                android:label="@string/app_name"
                android:launchMode="singleTask"
                android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
                android:screenOrientation="portrait"
                android:exported="true"
                android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="nzherald"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- to match: /front-page-top-stories/news/article.cfm?c_id=698&objectid=12488960-->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/news/.*"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /nz/glen-eden-gang-stoush-handguns-machetes-in-head-hunter-comancheros-confrontation/4UHQCTODLIMSIEK6YUNWJVW35Y/ -->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/.*/.*/"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /viva/food-drink/your-summer-barbecue-doesnt-get-any-easier-than-this-boneless-lamb-leg-recipe/QSUWPXZKJJFTRORRPLPGHGOG5M/ -->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/.*/.*/.*/"/>
            </intent-filter>            
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /sport/motorsport/ -->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/.*/"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /sport/ -->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /front-page-top-stories/news/article.cfm?c_id=698&objectid=12488960-->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/news/.*"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /nz/glen-eden-gang-stoush-handguns-machetes-in-head-hunter-comancheros-confrontation/4UHQCTODLIMSIEK6YUNWJVW35Y/ -->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/.*/.*/"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /viva/food-drink/your-summer-barbecue-doesnt-get-any-easier-than-this-boneless-lamb-leg-recipe/QSUWPXZKJJFTRORRPLPGHGOG5M/ -->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/.*/.*/.*/"/>
            </intent-filter>

            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /sport/motorsport/ -->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/.*/"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- /sport/ -->
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/.*/"/>
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="www.nzherald.co.nz" android:pathPattern="/"/>
            </intent-filter>
        </activity>
        <meta-data
                android:name="com.google.android.gms.ads.AD_MANAGER_APP"
                android:value="true"
        />
        <service android:name="com.braze.push.BrazeFirebaseMessagingService" android:exported="true">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <service android:name="com.google.android.gms.analytics.AnalyticsService"
                 android:enabled="true"
                 android:exported="false"
        />
        <meta-data android:name="google_analytics_automatic_screen_reporting_enabled" android:value="false" tools:replace="android:value" />
    </application>

    <!-- LandmarksID Tracking related queries -->
    <queries>
        <package android:name="nz.co.aa.android" />
        <package android:name="nz.co.ami" />
        <package android:name="nz.govt.at.atmobile" />
        <package android:name="com.afterpaymobile" />
        <package android:name="com.agoda.mobile.consumer" />
        <package android:name="nz.co.airnz.mpass" />
        <package android:name="com.airbnb.android" />
        <package android:name="com.amazon.mshop.android.shopping" />
        <package android:name="com.amazon.avod.thirdpartyclient" />
        <package android:name="com.americanexpress.android.acctsvcs.nz" />
        <package android:name="com.emn8.mobilem8.nativeapp.bknz" />
        <package android:name="nz.co.barfoot.property" />
        <package android:name="com.booking" />
        <package android:name="com.buzzfeed.android" />
        <package android:name="com.disney.disneyplus" />
        <package android:name="au.com.dominos.olo.android.app.nz" />
        <package android:name="au.com.vero.driveclaims" />
        <package android:name="com.emirates.ek.android" />
        <package android:name="com.expedia.bookings" />
        <package android:name="com.facebook.katana" />
        <package android:name="com.fitbit.FitbitMobile" />
        <package android:name="com.google.android.apps.authenticator2" />
        <package android:name="com.google.earth" />
        <package android:name="com.google.android.apps.translate" />
        <package android:name="com.grabone.goapprn" />
        <package android:name="com.hawaiianairlines.app" />
        <package android:name="nz.co.hellpizza.order" />
        <package android:name="com.hellofresh.androidapp" />
        <package android:name="com.hcom.android" />
        <package android:name="com.hotelscombined.mobile" />
        <package android:name="com.indeed.android.jobsearch" />
        <package android:name="com.instagram.android" />
        <package android:name="com.ink.jetstar.mobile.app" />
        <package android:name="com.jora.android" />
        <package android:name="com.kayak.android" />
        <package android:name="com.kfcnz.orderserv" />
        <package android:name="nz.co.kiwibank.mobile" />
        <package android:name="mobile.latam.com.latamapp" />
        <package android:name="com.ladbrokes.android" />
        <package android:name="com.latitudefinancial.latitudeapp" />
        <package android:name="com.laybuy.laybuy" />
        <package android:name="managemyhealth.co.nz" />
        <package android:name="com.mcdonalds.mobileapp" />
        <package android:name="com.medium.reader" />
        <package android:name="nz.co.menulog.m" />
        <package android:name="com.azure.authenticator" />
        <package android:name="com.microsoft.teams" />
        <package android:name="com.satellitemedia.mixandmatch" />
        <package android:name="com.nzherald.activities" />
        <package android:name="com.nedsintl.neds" />
        <package android:name="nz.co.lightbox" />
        <package android:name="com.netflix.mediaclient" />
        <package android:name="nz.co.newworld.clubcard" />
        <package android:name="com.olacabs.customer" />
        <package android:name="com.nzme.oneroof" />
        <package android:name="com.paypal.android.p2pmobile" />
        <package android:name="com.pinterest" />
        <package android:name="nz.co.pizzahut" />
        <package android:name="Playup_MobileApp.Android" />
        <package android:name="com.Plus500" />
        <package android:name="nz.co.powershop.android.app" />
        <package android:name="au.com.qantas.qantas" />
        <package android:name="com.intuit.qbse" />
        <package android:name="nz.co.realestate.android" />
        <package android:name="nz.co.skytv.skyconrad" />
        <package android:name="com.altaine.subway" />
        <package android:name="au.com.seek" />
        <package android:name="com.snapchat.android" />
        <package android:name="nz.co.sparksport" />
        <package android:name="com.stake.stake" />
        <package android:name="nz.co.state" />
        <package android:name="com.vacationrentals.homeaway" />
        <package android:name="nz.co.stuff.android.news" />
        <package android:name="nz.co.tvnz.ondemand.phone.android" />
        <package android:name="com.aol.mobile.techcrunch" />
        <package android:name="nz.co.thewarehouse.wow" />
        <package android:name="com.themarket.cordova" />
        <package android:name="com.mediaworks.android" />
        <package android:name="com.zhiliaoapp.musically" />
        <package android:name="nz.co.trademe.jobs" />
        <package android:name="nz.co.trademe.property" />
        <package android:name="com.tripadvisor.tripadvisor" />
        <package android:name="tunein.player" />
        <package android:name="com.twitter.android" />
        <package android:name="com.ubercab" />
        <package android:name="com.ubercab.eats" />
        <package android:name="com.virginaustralia.vaapp" />
        <package android:name="com.tencent.mm" />
        <package android:name="au.com.webjet" />
        <package android:name="com.wotif.android" />
        <package android:name="com.xfr.xtrade" />
        <package android:name="co.zip" />
        <!-- <package android:name="No App" /> -->
        <package android:name="com.etoro.openbook" />
        <package android:name="nz.co.homes.android" />
        <package android:name="com.clearchannel.iheartradio.controller" />
        <package android:name="nz.co.countdown.android.pickup" />
        <package android:name="com.appgeneration.itunerfree" />
        <package android:name="com.mediaworks.therock" />
        <package android:name="com.cnn.mobile.android.phone" />
    </queries>

</manifest>
github-actions[bot] commented 3 months ago

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.