Bomber
Bomber

Reputation: 10957

React native webivew, playing youtube videos - Violation of Device and Network Abuse policy

I get the error below when I submit my app to the play store. How can I submit my app?

export default class VideoPlayer extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      appState: AppState.currentState
    };
  }

  componentDidMount() {
    AppState.addEventListener("change", this._handleAppStateChange);
  }

  componentWillUnmount() {
    AppState.removeEventListener("change", this._handleAppStateChange);
  }

  _handleAppStateChange = nextAppState => {
    this.setState({ appState: nextAppState });
  };

  render() {
    let {

      youtubeVideo,

    } = this.props;

    return (
      <View style={styles.container}>
        {this.state.appState == "active" && (
          <WebView
            mediaPlaybackRequiresUserAction={true}
            style={{
              height: 240,
              width: "100%",
              alignSelf: "center",
              alignContent: "center"
            }}
            source={{
              uri: `https://www.youtube.com/embed/${youtubeVideo}?rel=0`
            }}
          />
        )}
      </View>
    );
  }
}

Issue: Violation of Device and Network Abuse policy We don’t allow apps that interfere with, disrupt, damage, or access in an unauthorized manner the user’s device, other devices or computers, servers, networks, application programming interfaces (APIs), or services, including but not limited to other apps on the device, any Google service, or an authorized carrier’s network.

Your app shouldn’t access or use the service or API in a manner that violates its terms of service. For example, your app shouldn't download, monetize, or access YouTube videos in a way that violates the YouTube Terms of Service.

Upvotes: 0

Views: 382

Answers (1)

Bomber
Bomber

Reputation: 10957

Fixed by adding the following to AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Upvotes: 1

Related Questions