Is the main entry point for the Shopify SDK for Unity. Using you'll create a client which can create queries on the Storefront API. ShopifyClient can also be used to create a Cart .
More...
Is the main entry point for the Shopify SDK for Unity. Using you'll create a client which can create queries on the Storefront API. ShopifyClient
can also be used to create a Cart
.
◆ Client() [1/2]
Returns the default ShopifyClient . The default client is the first client created after calling ShopifyBuy.Init . Note that ShopifyBuy.Init must be called before trying to call this function.
ShopifyBuy.Client().products((products, error) => {
Debug.Log(products[0].title());
Debug.Log(products[1].title());
Debug.Log(products.Count);
});
◆ Client() [2/2]
static ShopifyClient Shopify.Unity.ShopifyBuy.Client |
( |
string |
domain | ) |
|
|
inlinestatic |
Returns a ShopifyClient for the domain<c> passed in. This is useful when you have multiple Shops your application is querying. Note that ShopifyBuy.Init
must be called before trying to call this function.
- Parameters
-
domain | the domain associated to a client |
ShopifyBuy.Client("unity-buy-sdk.myshopify.com").products((products, error) => {
Debug.Log(products[0].title());
Debug.Log(products[1].title());
Debug.Log(products.Count);
});
◆ Init() [1/2]
Typically not used, but it is possible to create a ShopifyClient by passing an instance that implements BaseLoader . BaseLoaders handle network communicationication with the Storefront API. This functionality is useful if you'd like to use the Shopify SDK for Unity in a C# environment outside of Unity. The domain
string used to access specific initialized clients is inferred from BaseLoader.Domainwhich can be used to request a specific client.
- Parameters
-
loader | a loader which will handle network communicationication with the Storefront API |
string accessToken = "b8d417759a62f7b342f3735dbe86b322";
string shopDomain = "unity-buy-sdk.myshopify.com";
CustomLoaderForNonUnityPlatform loader = new CustomLoaderForNonUnityPlatform(accessToken, shopDomain);
ShopifyBuy.Init(loader);
◆ Init() [2/2]
static ShopifyClient Shopify.Unity.ShopifyBuy.Init |
( |
string |
accessToken, |
|
|
string |
domain, |
|
|
string |
locale = null |
|
) |
| |
|
inlinestatic |
Initializes a ShopifyClient that can be used to query the Storefront API. The default client which can be accessed by calling ShopifyBuy.Client() which is initialized after ShopifyBuy.Init is called. To access the client for the specific domain passed, use ShopifyBuy.Client(domain) .
- Parameters
-
accessToken | access token that was generated for your store |
domain | domain of your Shopify store |
locale | optional locale for translated content of supported types and fields |
string accessToken = "b8d417759a62f7b342f3735dbe86b322";
string shopDomain = "unity-buy-sdk.myshopify.com";
string locale = "es";
ShopifyBuy.Init(accessToken, shopDomain);
ShopifyBuy.Init(accessToken, shopDomain, locale);
The documentation for this class was generated from the following file:
- Assets/Shopify/Unity/ShopifyBuy.cs