没有在Google Play商店中发布应用程序的情况下,有什么方法可以测试新的Google Play推荐链接API?

时间:2018-10-10 05:36:51

标签: android install google-play-services install-referrer

最近,Google发布了Google Play安装引荐来源网址API(公告)。

这个问题有很多重复之处,但不清楚。

需要一种在发布之前测试此代码的准确方法。

InstallReferrerClient mReferrerClient

mReferrerClient = InstallReferrerClient.newBuilder(this).build();
mReferrerClient.startConnection(new InstallReferrerStateListener() {
    @Override
    public void onInstallReferrerSetupFinished(int responseCode) {
        switch (responseCode) {
            case InstallReferrerResponse.OK:
                // Connection established
                break;
            case InstallReferrerResponse.FEATURE_NOT_SUPPORTED:
                // API not available on the current Play Store app
                break;
            case InstallReferrerResponse.SERVICE_UNAVAILABLE:
                // Connection could not be established
                break;
        }
    }

    @Override
    public void onInstallReferrerServiceDisconnected() {
        // Try to restart the connection on the next request to
        // Google Play by calling the startConnection() method.
    }
});

0 个答案:

没有答案