0

我用 react native 编写了 web 应用程序,我想添加 google adsense。我能找到的只是“React”,而不是“React Native”。我跟着它,得到了错误 400(错误请求)。即使是“React Native”,也都是关于移动应用程序,而不是 Web 应用程序。有人可以告诉我如何向 React Native Web App 添加广告吗?

export const InArticleAds = () => {
  React.useEffect(() => {
    (window.adsbygoogle = window.adsbygoogle || []).push({});
  }, []);

  return (
    <ins
      className="adsbygoogle"
      style={{ display: "block", textAlign: "center" }}
      data-ad-layout="in-article"
      data-ad-format="fluid"
      data-ad-client="ca-pub-9172738714424609"
      data-ad-slot="6235565279"
    ></ins>
  );
};

这就是我尝试过的。

4

0 回答 0