Shopify / mobile-buy-sdk-android

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using their credit card.
MIT License
212 stars 136 forks source link

Where to store SHOP_DOMAIN and API_KEY #686

Closed blob84 closed 3 years ago

blob84 commented 3 years ago

When the SHOP_DOMAIN and API_KEY are stored in the shop.properties file they are not resolved. This is the sample code:

   String shopUrl = BuildConfig.SHOP_DOMAIN;
    if (TextUtils.isEmpty(shopUrl)) {
      throw new IllegalArgumentException(SHOP_PROPERTIES_INSTRUCTION + "You must add 'SHOP_DOMAIN' entry in "
          + "app/shop.properties, in the form '<myshop>.myshopify.com'");
    }

    String shopifyApiKey = BuildConfig.API_KEY;
    if (TextUtils.isEmpty(shopifyApiKey)) {
      throw new IllegalArgumentException(SHOP_PROPERTIES_INSTRUCTION + "You must populate the 'API_KEY' entry in "
          + "app/shop.properties");
    }

These are the errors:

cannot find symbol variable SHOP_DOMAIN
cannot find symbol variable API_KEY
cannot find symbol variable OKHTTP_LOG_LEVEL
cannot find symbol variable SHOP_DOMAIN
cannot find symbol variable API_KEY
cannot find symbol variable DEFAULT_LOCALE

I've imported the import com.shopify.buy3.BuildConfig; This class doesn't provide these variables.

blob84 commented 3 years ago

Do not import tthat class.