react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.12k stars 877 forks source link

AppStore Review Team blocked the release: Google Play references in the binary #1222

Closed kioltk closed 4 months ago

kioltk commented 7 months ago

Hey,

We got our application release blocked cause of 'Google Play references in the binary'. Upon further investigation we found that this library is the single place where "google" and "play" can be mentioned in one place, so its kinda confusing. Our next step was to remove the library temporary, and we passed the review.

I will investigate it further in order to understand what triggers their false positive binary verification and will update this issue.

Feel free to close this issue, the motivation behind reporting it was:

  1. Tracking the investigation
  2. Letting people know this might happen
  3. And for those who already struggling - try to remove this library until the issue has the solution Screenshot 2023-11-23 at 9 09 21 1
vonovak commented 7 months ago

Hello and thanks for reporting, this is an interesting finding. One thing that comes to my mind, could you try: replacing the IS_IOS constant in the code by Platform.OS === 'ios' (basically inline the expression)? This should be the only place that matters.

  async hasPlayServices(
    options: HasPlayServicesParams = { showPlayServicesUpdateDialog: true },
  ): Promise<boolean> {
    if (IS_IOS) {
      return true;
    } else {
      if (options && options.showPlayServicesUpdateDialog === undefined) {
        throw new Error(
          'RNGoogleSignin: Missing property `showPlayServicesUpdateDialog` in options object for `hasPlayServices`',
        );
      }
      return RNGoogleSignin.playServicesAvailable(options.showPlayServicesUpdateDialog);
    }
  }

Alternatively, you can try the version for sponsors which has this change included. I'm not saying it's the fix, but it could be.

edit: are you using metro bundler?

Thank you! :)

kioltk commented 7 months ago

I am using metro bundler, correct

Looking into the main.jsbundle after changing IS_IOS to Platform.os === 'ios', it does not emit the else block from the build, so I am not sure if this would help.

My current strategy is to remove js usage, but returning the package and pods dependencies, so I can be sure that the issue is with bundler and not with native binaries.

vonovak commented 7 months ago

Sounds good! But the "else" block should not be there for ios I think, if you bundle with production settings.

Edit: assuming when you said emit you meant omit

kioltk commented 7 months ago

Hey, updating on this

I removed all js implementation, only left the pods integration and AppStore Review Team approved it. So my assumption is that the issue was not about the native binary code, but the js bundled code.

Going to return the js code as it was and see if they say something about it

Makes no sense to me, but have to try it

About the omitting code, for some reason my bundler does not omit android code blocks when archiving production main.jsbundle. Sounds like it should, but does it really?

vonovak commented 7 months ago

yes, the android code should be removed in iOS prod bundle. This is how metro does it: https://github.com/facebook/metro/blob/main/packages/metro-transform-plugins/src/inline-plugin.js#L148-L152

vonovak commented 6 months ago

@kioltk hello I'm wondering, did you make some new discoveries in this regard? :)

thank you

vonovak commented 4 months ago

I'm going to close this as there's nothing to do really on my side. Please comment if there's some news.