Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
This repository was archived by the owner on May 20, 2025. It is now read-only.

How to load react-native-code-push after root node & app launch? #2557

@emclab

Description

@emclab

My React Native 0.70 app uses react-native-code-push 7.1.0. And the way it was integrated into the React Native app happens at the index.js:

/**
 * @format
 */
import 'react-native-gesture-handler';
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import codePush from "react-native-code-push";  //code push


AppRegistry.registerComponent(appName, () => codePush(App));

I was told by app reviewer that codePush is retrieving user's ANDROIDID (red flag) before his/her consent (as index.js is the first module loaded when app is launched). I was told that a popup window asking for users' consent before the code push is needed. There are 2 questions. 1. Does code push depends on user's ANDROIDID to work. 2. If it does, how to load the code push module later on after users' consent (After the app has checked if there is users' consent and will be a few components after index.js).

Here is the app call stack provided by the reviewer:

[com.microsoft.codepush.react.CodePushNativeModule.<init>(CodePushNativeModule.java:63),
 com.microsoft.codepush.react.CodePush.createNativeModules(CodePush.java:414),
 com.facebook.react.ReactPackageHelper.getNativeModuleIterator(ReactPackageHelper.java:42),
 com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:42),
 com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1456),
 com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1427),
 com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1338),
 com.facebook.react.ReactInstanceManager.access$1200(ReactInstanceManager.java:136),
 com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1108),
 java.lang.Thread.run(Thread.java:933)]

Environment

  • react-native-code-push version: 7.1.0
  • react-native version: 0.70
  • iOS/Android/Windows version: MacOS 13.x
  • Does this reproduce on a debug build or release build? yes
  • Does this reproduce on a simulator, or only on a physical device? yes

(The more info the faster we will be able to address it!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions