5

我最近更新了我的應用中的Google Play服務庫以使用新的Google API。在這樣做的時候,無論我何時第一次啓動一個Activity(它擴展了BaseGameActivity)而沒有登錄,Activity都會自動出現登錄對話框。Google Play遊戲 - 自動調用beginUserInitiatedSignIn()的活動

我沒有撥打任何地方的任何beginUserInitiatedSignIn()電話。這很煩人 - 這有什麼辦法嗎?

下面是一個logcat的:

03-02 21:13:08.067: W/PopupManager(12332): You have not specified a View to use as content view for popups. Falling back to the Activity content view which may not work properly in future versions of the API. Use setViewForPopups() to set your content view. 
03-02 21:13:08.137: D/dalvikvm(12332): GC_FOR_ALLOC freed 223K, 3% free 9306K/9560K, paused 16ms, total 16ms 
03-02 21:13:08.197: I/Adreno-EGL(12332): <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13 
03-02 21:13:08.228: D/OpenGLRenderer(12332): Enabling debug mode 0 
03-02 21:13:39.771: W/PopupManager(12432): You have not specified a View to use as content view for popups. Falling back to the Activity content view which may not work properly in future versions of the API. Use setViewForPopups() to set your content view. 
03-02 21:13:39.891: D/dalvikvm(12432): GC_FOR_ALLOC freed 227K, 3% free 9303K/9560K, paused 17ms, total 17ms 
+0

你可以發佈Logcat嗎? –

+0

@MarcoAcierno我已經添加了一個,但我不認爲它有幫助。 – RiThBo

+0

對不起,我的錯誤。我以爲你遇到了崩潰(糟糕的一天,也許)。 –

回答

4

這是默認的行爲按this issue

FAQ狀態:

[4]爲什麼GameHelper/BaseGameActivity試圖登錄到 應用程序啓動?

BaseGameActivity和GameHelper的默認行爲是在您的應用程序啓動後立即向用戶顯示登錄流程(同意對話框等) 。 當然,一旦用戶第一次登錄,他們將不會再次看到 同意流程,因此這將是一次無縫的體驗。重要的是 讓用戶儘早登錄,因此您的應用程序可以立即獲得Google Play遊戲API的 優勢(例如,使用雲存儲保存 用戶的進度,解鎖成就等)。如果用戶 取消登錄流程,BaseGameAcitivity/GameHelper將會記住 取消。如果取消的總數達到預定義的 最大值(默認爲3),則不會再提示用戶登錄 應用程序啓動。如果發生這種情況,他們仍然可以通過點擊 登錄您的應用程序的登錄按鈕,如果您提供了登錄按鈕。

[5]我不喜歡GameHelper的新「自動登錄」功能。我怎麼能 我禁用它?

要禁用此功能,並返回到原來的行爲,您可以編輯 GameHelper.java和DEFAULT_MAX_SIGN_IN_ATTEMPTS常數設置爲0,或 呼叫GameHelper.setMaxAutoSignInAttempts(0)在運行時,調用 GameHelper.setup前() (或相應地,從您的Activity的onCreate 方法)。

相關問題