2017-04-13 53 views
0

我需要禁用Apptentive來顯示其反饋對話框,因爲它會干擾我的UI測試。我找不到任何方法註銷或禁用它。 我試圖設置這樣的隨機應用程序鍵,但apptentive正在使用緩存的API鍵。如何在Android中取消註冊Apptentive?

@BeforeClass 
public static void beforeClass() { 
    Apptentive.register(CustomApp.getInstance(), ""); 
} 

回答

1

你不能註銷Apptentive它已被註冊後,但也有一些方法來保持它顯示出來,當你運行你的UI測試。

  1. 爲您的UI測試使用特殊構建變體。然後,在Application.onCreate(),包裹調用Apptentive.register()在對證構建配置味

    @Override 
    onCreate() { 
        if (!BuildConfig.FLAVOR.equals("<YOUR_UI_TEST_FLAVOR>")) { 
        Apptentive.register(...); 
        } 
    } 
    
  2. 您可以設置一塊定製Person數據像Apptentive.addCustomPersonData("ui_test", true)。然後,在你的Interaction「Who」標準中使用它,這樣只要這個標誌是真的,Interaciton就不能顯示。