react-native - 响应 native Webview,播放youtube视频-违反设备和网络滥用政策

标签 react-native youtube google-play-console

将我的应用提交到Play商店时,出现以下错误。如何提交我的应用程序?

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.

最佳答案

通过在AndroidManifest.xml中添加以下内容进行修复:

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

关于react-native - 响应 native Webview,播放youtube视频-违反设备和网络滥用政策,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58408703/

相关文章:

react-native - 如何限制 map 上的缩放以使用 <MapView/> 组件进行原生 react

android - 如何将 Google Play Developer API 版本更新到 v3?

android - 三星 Galaxy Note 3 SM-N9005 google play 控制台设备目录

android - 如何知道我使用的是哪个版本的 Google Play Developer API?将 Google Play Developer API 版本更新到 v3 的步骤是什么?

javascript - 在 StyleSheet 中使用函数是否存在性能缺陷?

javascript - 如何在 React Native 上循环 MasonryList?

react-native - 创建新的 native 应用程序从注册表收到格式错误的响应

google-api - 过于广泛的权限要求Google youtube API

php - WordPress 自动嵌入 YouTube 视频 - 添加过滤器以处理 `end` 属性

javascript - Youtube API v3 Javascript 示例代码无法运行