Commit ac3866ce by Rune Madsen

Adding Product View readme, updating with assets

parent 0f2e66bc
# Mobile Buy SDK - Product View
The SDK includes an easy-to-use product view to make selling simple in any app.
![Product View Screenshot](https://raw.github.com/Shopify/mobile-buy-sdk-ios/master/Assets/Product_View_Screenshot_1.png)
![Product View Screenshot](https://raw.github.com/Shopify/mobile-buy-sdk-ios/master/Assets/Product_View_Screenshot_2.png)
Simply initialize the `BUYProductViewController` and present it from any view controller in your app to sell a product from you shop.
### Getting started
The `BUYProductViewController` needs a `BUYClient` setup with your shop's credentials to work, so first create a `BUYClient` object:
```objc
BUYClient *client = [[BUYClient alloc] initWithShopDomain:@"yourshop.myshopify.com"
apiKey:@"aaaaaaaaaaaaaaaaaa"
channelId:@"99999"];
```
Now, create a `BUYProductViewController` with the `BUYClient`, and optionally add Apple Pay and a custom theme.
```objc
// Optionally customize the UI:
BUYTheme *theme = [[BUYTheme alloc] init];
theme.style = BUYThemeStyleLight;
theme.tintColor = [UIColor redColor];
BUYProductViewController *productViewController = [[BUYProductViewController alloc] initWithClient:self.client theme:theme];
// Optionally enable Apple Pay:
productViewController.merchantId = @"MERCHANT_ID";
```
Now the `BUYProductViewController` is ready to load a product and be presented in your app:
```objc
[productViewController loadProduct:@"PRODUCT_ID" completion:^(BOOL success, NSError *error) {
if (success) {
[self presentViewController:self.productViewController animated:YES completion:nil];
} else {
NSLog(@"Error: %@", error.userInfo);
}
}];
```
If you have already loaded a product, you can call `loadWithProduct:completion:` instead. For a complete demo, check out the [Advanced Sample App](https://github.com/Shopify/mobile-buy-sdk-ios/tree/master/Mobile Buy SDK Sample Apps/Sample App Advanced/README.md), which demoes UI customization with `BUYTheme` and both modal and navigation controller push presentations.
\ No newline at end of file
![Mobile Buy SDK](http://s3.amazonaws.com/shopify-marketing_assets/static/mbsdk-github.png)
![Mobile Buy SDK](https://raw.github.com/Shopify/mobile-buy-sdk-ios/master/Assets/Mobile_Buy_SDK_Github_banner.png)
[![Build status](https://badge.buildkite.com/3951692121947fbf7bb06c4b741601fc091efea3fa119a4f88.svg)](https://buildkite.com/shopify/mobile-buy-sdk-ios)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/Shopify/mobile-buy-sdk-ios/blob/master/LICENSE)
......@@ -118,6 +118,15 @@ The repo includes 3 sample apps. Each sample apps embeds the dynamic framework a
We suggest you take a look at the **Advanced Sample App** and test your shop with the sample app before you begin. If you run into any issues, the **Advanced Sample App** is also a great resource for debugging integration issues and checkout.
### Product View
The SDK includes an easy-to-use product view to make selling simple in any app.
![Product View Screenshot](https://raw.github.com/Shopify/mobile-buy-sdk-ios/master/Assets/Product_View_Screenshot_1.png)
![Product View Screenshot](https://raw.github.com/Shopify/mobile-buy-sdk-ios/master/Assets/Product_View_Screenshot_2.png)
The [Advanced Sample App](https://github.com/Shopify/mobile-buy-sdk-ios/tree/master/Mobile Buy SDK Sample Apps/Sample App Advanced/) includes a demo of the `BUYProductViewController`. Documentation on how to use the `BUYProductViewController` is also available [here](https://github.com/Shopify/mobile-buy-sdk-ios/tree/master/Mobile Buy SDK Sample Apps/Sample App Advanced/PRODUCT_VIEW_README.md).
### Unit Tests
To run the Mobile Buy SDK integration tests against an actual shop, you will need a Shopify shop that is publicly accessible (not password protected). Please note that the integration tests **will create an order** on that shop. This is to validate that the SDK works properly with Shopify. Modify the **test_shop_data.json** file to contain your shop's credentials and the required product IDs, gift cards, and discounts as necessary.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment