工廠課程

使用 Samsung 和 Google 工廠類別建立 ResellerService 物件。 使用 ResellerService 物件,即可用一組常見的方法 可用於聲明及註冊 Samsung 和其他 Android 裝置。

SamsungResellerServiceFactory

在使用 SamsungResellerServiceFactory 類別產生 ResellerService 物件,您必須透過 KDP 加入計畫。 以下是使用ResellerService SamsungResellerServiceFactory 類別:

public static ResellerService createResellerService(String resellerId, String serviceAccountKeyFilePath, String clientIdentifier) throws CommonException;

輸入參數

屬性名稱 必填 說明
resellerId string 經銷商的專屬 ID (由 KDP 系統提供)。
serviceAccountKeyFilePath string 服務帳戶金鑰的檔案路徑。
clientIdentifier string KDP 系統提供的用戶端 ID。

錯誤行為

發生錯誤時,程式庫會擲回 CommonException 包含下列其中一個錯誤代碼:

錯誤代碼
INVALID_RESELLER_ID
AUTHORIZATION_FAIL

GoogleResellerServiceFactory

在使用 GoogleResellerServiceFactory 類別產生 ResellerService 物件,您必須加入零接觸註冊機制 經銷商。

以下是使用ResellerService GoogleResellerServiceFactory 類別:

public static ResellerService createResellerService(long resellerId, String serviceAccountKeyFilePath) throws CommonException, InterruptedException;

輸入參數

屬性名稱 必填 說明
resellerId long 經銷商的專屬 ID,由零接觸系統提供。
serviceAccountKeyFilePath string 服務帳戶金鑰的檔案路徑。

錯誤行為

發生錯誤時,程式庫會擲回 CommonException 包含下列其中一個錯誤代碼:

錯誤代碼
INVALID_PARAM_DEFAULT
INVALID_RESELLER_ID
INTERNAL_SERVER_ERROR