Apple 审阅者无法看到使用 expo-tracking-transparency 实现的 Tracking Transparency 提示

问题描述 投票:0回答:1

尽管我相信我已经使用

expo-tracking-transparency 3.0.3
正确配置了所有内容以提示用户接受或拒绝跟踪,但由于某种原因,Apple 审核者无法看到该提示。但是当我在手机上安装该应用程序时,我可以看到它。我在我们的工作 iPhone 上使用最新的 iOS 16.6.1。

这是苹果的评论回复:

We're looking forward to completing our review, but we need more information to continue. Your app uses the AppTrackingTransparency framework, but we are unable to locate the App Tracking Transparency permission request when reviewed on iOS 16.6.1.

Next Steps

Please explain where we can find the App Tracking Transparency permission request in your app. The request should appear before any data is collected that could be used to track the user.

If you've implemented App Tracking Transparency but the permission request is not appearing on devices running the latest OS, please review the available documentation and confirm App Tracking Transparency has been correctly implemented.

If your app does not track users, update your app privacy information in App Store Connect to not declare tracking. You must have the Account Holder or Admin role to update app privacy information.

我已经使用

react-native-admob-native-ads 0.6.6

在我的应用程序中实现了 Google Google AdMob

我的应用程序完全构建为 Expo SDK 48 托管项目,因此我的整个应用程序配置位于

app.config.js
app.json
中。

这是我的配置:

app.config.js
文件是所有应用程序配置所在的位置:

expo: {
    plugins: [
      "expo-localization",
      [
        "expo-build-properties",
        {
          ios: {
            useFrameworks: "static",
          },
        },
      ],
      [
        "expo-tracking-transparency",
        {
          userTrackingPermission:
            "This identifier will be used to deliver personalized ads to you.",
        },
      ],
    ],
  },

而且我也有

app.json
文件仅包含
react-native-google-mobile-ads
配置,因为
app.config.js
文件中不接受这种配置:

{
  "react-native-google-mobile-ads": {
    "android_app_id": "id-string",
    "ios_app_id": "id-string",
    "user_tracking_usage_description": "This identifier will be used to deliver personalized ads to you."
  }
}

app.tsx
文件中,我有一个
useEffect
钩子,用于初始化提示:

  React.useEffect(() => {
    ;(async () => {
      try {
        await TrackingTransparency.requestTrackingPermissionsAsync()
      } catch (error) {
        console.error({
          msg: "Error requesting tracking permissions",
          error,
        })
      }
    })()
  }, [])

广告使用

NativeAdView
包中的
react-native-admob-native-ads
组件投放:

const nativeAdId = Platform.OS === "ios" ? Config.NATIVE_AD_ID_IOS : Config.NATIVE_AD_ID_ANDROID

<NativeAdView
  style={$cardItem}
  ref={nativeAdViewRef}
  adUnitID={nativeAdId}
  targetingOptions={{ keywords }}
  onNativeAdLoaded={onAdLoaded}
  adChoicesPlacement="topRight"
  requestNonPersonalizedAdsOnly={true}
  >
   <NativeMediaView
      muted={true}
      paused={false}
      onVideoPlay={() => console.log("playing")}
      style={$mediaContent}
     />
</NativeAdView>

我真的不明白为什么苹果审阅者不会显示提示。我不确定苹果如何审查这些应用程序,但例如我发现,如果我通过 TestFlight 安装我的应用程序,则不会显示此提示,但如果我使用 Expo 为

preview
构建应用程序,然后下载它到我的手机上,每次新安装应用程序时都会显示提示。

我还向审阅者发送了一段视频,以展示如何在我的设备上显示提示,但这没有帮助。

我完全不知道如何解决这个问题,我将不胜感激。只是,我的项目中没有任何 iOS 或 Android 配置,一切都由 Expo 管理。

ios react-native expo app-store apptrackingtransparency
1个回答
0
投票

尝试这个解决方案:

找到这个答案后,苹果的文档说它应该放在 applicationDidBecomeActive 中,问题似乎是该应用程序未处于活动状态。

我的解决方法是在请求周围添加超时,以等待应用程序加载:

setTimeout(async () => {
  const { granted } = await requestTrackingPermissionsAsync();
}, 500);

另一种选择是添加事件侦听器,并通过 Expo App State 查看应用程序何时处于活动状态,然后调用它。

© www.soinside.com 2019 - 2024. All rights reserved.