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

Using this library causes iOS app to be rejected from App Store #28

Closed
sunweiyang opened this issue Apr 17, 2018 · 12 comments
Closed

Using this library causes iOS app to be rejected from App Store #28

sunweiyang opened this issue Apr 17, 2018 · 12 comments

Comments

@sunweiyang
Copy link

I attempted to submit an app to the iOS App Store using react-native-system-setting and received this scary rejection:

Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.

Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.

Next Steps

To resolve this issue, please revise your app to provide the associated functionality using public APIs or remove the functionality using the "prefs:root" or "App-Prefs:root" URL scheme.

If there are no alternatives for providing the functionality your app requires, you can file an enhancement request.

The only place in my app that uses the "prefs:root=" non-public URL scheme is in react-native-system-setting, specifically in react-native-system-setting/ios/RTCSystemSetting.m starting at line 55:

-(void)initSetting{
    BOOL newSys = [UIDevice currentDevice].systemVersion.doubleValue >= 10.0;
    setting = @{@"wifi": (newSys?@"App-Prefs:root=WIFI" : @"prefs:root=WIFI"),
                @"location": (newSys?@"App-Prefs:root=Privacy&path=LOCATION" : @"prefs:root=Privacy&path=LOCATION"),
                @"bluetooth": (newSys?@"App-Prefs:root=Bluetooth" : @"prefs:root=Bluetooth"),
                @"airplane": (newSys?@"App-Prefs:root=AIRPLANE_MODE" : @"prefs:root=AIRPLANE_MODE")
                };
}

This package is fantastic, but this problem must be addressed, or users of this package simply can't submit to the iOS App Store.

@c19354837
Copy link
Owner

Thanks for your feedback.

Do you need these APIs which start with switch*? (eg: switchWifi())

@sunweiyang
Copy link
Author

I'm personally currently using react-native-system-setting only for reading and setting speaker volume. Other users may need these APIs.

@c19354837
Copy link
Owner

You can modify your codes to solve it as a temporary solution.

path: yourProject/node_modules/react-native-system-setting/ios/RTCSystemSetting.m

-(void)initSetting{
    setting = @{};
}

Now you can upload a new app to AppStore safely.

Of course, I'll provide a final solution for all people in the next few days.

@JobiJoba
Copy link

Funny,

I just got rejected also for that ... :<

Thanks for the workaround

@c19354837
Copy link
Owner

V1.4.0 is available.

Add new API for this issues: setAppStore().

You should call setAppStore(true) when your app will be submitted to App Store. It will disable these APIs which start with switch*. See App Store

Apple review the .ipa by some tools, so I encode the private entity by base64 to avoid these static checking. See How does Apple know you are using private API?

And I disable switch* function to avoid the potential runtime checking.

@SuhairZain
Copy link

SuhairZain commented Sep 19, 2018

@c19354837 Hi, I'm using this library (v1.2.4) only for listening to volume level changes and I got a rejection for the reason stated in this issue. Even though I'm not using the functionality for accessing the settings pages, I'm getting a rejection since the native code is there.

Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.
Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.

I checked the latest source code and the code does conceal the usage of the private APIs. Do you think this could potentially lead to a ban on the app if I upgrade the library?

@c19354837
Copy link
Owner

You have to upgrade to >= 1.4.0.

And I get an issues #55 about App Store.

@SuhairZain
Copy link

What about concealing the usage of private APIs as communicated by Apple team? Do you think it'd be an issue?

Regarding the issue with BT permission, I did get that as a reason for rejection for an earlier build. When I added a string for permission, it got solved.

@c19354837
Copy link
Owner

I did not receive any issues about the rejection from App Store since 1.4.0, so I think it works.

If you still get a rejection after upgrade to latest version, please let me know.

@c19354837
Copy link
Owner

V1.7.0 is available. These annoying codes are removing by preprocessor macros. See #58.

@SuhairZain
Copy link

@c19354837 It looks like a good fix. We're using a fork in which I removed those lines right now. We'll make another release in under a week and will let you know how it goes. Thanks.

@SuhairZain
Copy link

@c19354837 When I run nm __BUILD_DIR__/libRCTSystemSetting.a, I can no longer see the initSetting method. I believe this issue has been solved. Thanks for the excellent fix.

thehale added a commit to SpeedcuberOSS/speedcuber-timer that referenced this issue Dec 9, 2022
The package `react-native-system-setting` was the only one I found which
offered a method to check if a device's location services were enabled
(required for Android Bluetooth to work in API 23+). However, that
library maintainer also has a track record of choosing implementations
which violate Apple's policies, resulting in threats of termination of
Apple Developer Accounts. [1][2]

I don't need any of the other functionality in that library, and I
really don't want to expose myself to that author's implementation
whims. As such, I found it prudent to take this opportunity to learn how
to build a Native Module for React Native applications (at least for Android).

I largely followed the official guide [3], and the only hiccups I had
resulted from Android Studio selectively auto-saving files, causing
confusing, but temporary compilation errors.

[1] c19354837/react-native-system-setting#28
[2] c19354837/react-native-system-setting#58
[3] https://reactnative.dev/docs/native-modules-android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants