Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
emclab opened this issue Jul 27, 2023 · 2 comments
Closed

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

emclab opened this issue Jul 27, 2023 · 2 comments

Comments

@emclab
Copy link

emclab commented Jul 27, 2023

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!)

@emclab
Copy link
Author

emclab commented Jul 27, 2023

Here is the code line in CodePushNativeModule.java line 63:

mClientUniqueId = Settings.Secure.getString(reactContext.getContentResolver(), Settings.Secure.ANDROID_ID);

Is it retrieving the ANDROIDID?

@emclab emclab changed the title Does react-native-code-push retrieve user's ANDROIDID? How to load react-native-code-push after root node & app launch? Jul 28, 2023
@MikhailSuendukov
Copy link
Contributor

Hello @emclab and thanks for reaching out to us, the fact is that a fix for this problem has already been implemented, and it was released along with the 8.1.1 version of react-native-code-push, so I am closing this issue, but if you have any other questions feel free to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants