Reputation: 18441
I'm building a React Native app that will fetch data from both a local host and an internet (web) host.
The web app is a normal application with some analytics and configuration data. The local host ip will be configured on the web application:
At the web app:
Local host ip: 192.168.0.100
That configuration will be dowloaded to the app so that the local app knows where the local server is located at.
The local server will gather IoT data locally to be shown on the app. These IoT devices cannot be connected to the internet, and that is the reason I need to use a local host.
My question is, is it acceptable to fetch from my app to the local host, something like:
fetch('https://192.168.0.100/endpoint/', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
firstParam: 'yourValue',
secondParam: 'yourOtherValue',
}),
});
Naturally the app must be running in a device connected to my local network where I have the local server (192.168.0.100) and an internet connection.
Questions:
a. Will that work on both iOS and Android ?
b. When publishing the app on both Apple Store or Android Play Store will that violate any terms? Will I be able to publish my app?
Upvotes: 2
Views: 1978
Reputation: 2071
According to Apple's AppStore Review Guidelines the app should be functional in the first place to get approved.
Enable backend services so that they’re live and accessible during review.
And apps should not require a user to do certain setup to run it.
Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
If your app requires some setup before its installed that means its not for the masses but for specific persons running your setup instead. In that instance try distributing the app outside the AppStore using enterprise account.
The App Store is a great way to reach hundreds of millions of people around the world. If you build an app that you just want to show to family and friends, the App Store isn’t the best way to do that. Consider Ad Hoc distribution or the Enterprise Program. If you’re just getting started, learn more about the Apple Developer Program.
Read this document for OverTheAir (OTA) installation of iOS app for enterprise account.
For Android my knowledge is quite limited but as far as I know, you can distribute any APK outside the PlayStore without any specific account requirement like we have in the case of iOS. Just enable the installation of the app from unknown sources in the Android security settings.
Upvotes: 1