菜鸟教程小白 发表于 2022-12-13 15:46:12

ios - 手动屏幕跟踪在 Firebase (iOS) 中不起作用


                                            <p><p>我正在尝试禁用 Firebase 中的手动屏幕跟踪,将其替换为我自己的屏幕跟踪实现。 </p>

<p>通过自动屏幕跟踪,我发送到 firebase 的每个事件都有两个额外的参数:<code>firebase_screen_class</code> 和 <code>firebase_screen_id</code> 以及应用程序中显示的最后一个 ViewController 的值</p>

<p>所以我修改了应用程序的 <code>Info.plist</code> 文件:</p>

<pre><code>FirebaseScreenReportingEnabled = NO
</code></pre>

<p>当应用程序的屏幕发生变化时,我开始调用该函数:</p>

<pre><code>Analytics.setScreenName(screenName, screenClass: screenName)
</code></pre>

<p>此更改后的结果是 Firebase 的 DebugView 不再注册 <code>screen_view</code> 事件并且没有额外的信息(<code>firebase_screen_class</code> 和 <code>firebase_screen_id</code>)是附加到以后的事件。</p>

<p>我错过了什么?</p>

<p><strong>编辑</strong>那些是podfile.lock中的谷歌相关pod</p>

<pre><code>- Firebase/AdMob (4.2.0):
    - Firebase/Core
    - Google-Mobile-Ads-SDK (= 7.24.0)
- Firebase/Core (4.2.0):
    - FirebaseAnalytics (= 4.0.3)
    - FirebaseCore (= 4.0.7)
- Firebase/RemoteConfig (4.2.0):
    - Firebase/Core
    - FirebaseRemoteConfig (= 2.0.3)
- FirebaseAnalytics (4.0.3):
    - FirebaseCore (~&gt; 4.0)
    - FirebaseInstanceID (~&gt; 2.0)
    - GoogleToolboxForMac/NSData+zlib (~&gt; 2.1)
    - nanopb (~&gt; 0.3)
- FirebaseCore (4.0.7):
    - GoogleToolboxForMac/NSData+zlib (~&gt; 2.1)
    - nanopb (~&gt; 0.3)
- FirebaseInstanceID (2.0.3)
- FirebaseRemoteConfig (2.0.3):
    - FirebaseAnalytics (~&gt; 4.0)
    - FirebaseInstanceID (~&gt; 2.0)
    - GoogleToolboxForMac/NSData+zlib (~&gt; 2.1)
    - Protobuf (~&gt; 3.1)
- Google-Mobile-Ads-SDK (7.24.0)
- GoogleAnalytics (3.17.0)
- GoogleSignIn (4.1.0):
    - GoogleToolboxForMac/NSDictionary+URLArguments (~&gt; 2.1)
    - GoogleToolboxForMac/NSString+URLArguments (~&gt; 2.1)
    - GTMOAuth2 (~&gt; 1.0)
    - GTMSessionFetcher/Core (~&gt; 1.1)
- GoogleToolboxForMac/DebugUtils (2.1.1):
    - GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/Defines (2.1.1)
- GoogleToolboxForMac/NSData+zlib (2.1.1):
    - GoogleToolboxForMac/Defines (= 2.1.1)
- GoogleToolboxForMac/NSDictionary+URLArguments (2.1.1):
    - GoogleToolboxForMac/DebugUtils (= 2.1.1)
    - GoogleToolboxForMac/Defines (= 2.1.1)
    - GoogleToolboxForMac/NSString+URLArguments (= 2.1.1)
- GoogleToolboxForMac/NSString+URLArguments (2.1.1)
- GTMOAuth2 (1.1.5):
    - GTMSessionFetcher (~&gt; 1.1)
- GTMSessionFetcher (1.1.12):
    - GTMSessionFetcher/Full (= 1.1.12)
- GTMSessionFetcher/Core (1.1.12)
- GTMSessionFetcher/Full (1.1.12):
    - GTMSessionFetcher/Core (= 1.1.12)
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我从 Firebase 得到的答复是,在 iOS 上,他们支持自动 + 手动屏幕报告或根本不报告屏幕。 Google Analytics for Firebase 不支持手动屏幕报告的情况。 plist 标志 <strong>FirebaseAutomaticScreenReportingEnabled</strong> 已重命名为 <strong>FirebaseScreenReportingEnabled</strong> 以减少混淆。请注意,该值必须是 bool 值而不是字符串。如果它没有按预期工作,您可以通过向 Info.plist 添加标志 <strong>FirebaseScreenReportingEnabled</strong> 并使用 bool 值 NO 来完全禁用屏幕报告。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 手动屏幕跟踪在 Firebase (iOS) 中不起作用,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/46815428/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/46815428/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 手动屏幕跟踪在 Firebase (iOS) 中不起作用