CocoaPods trunk is moving to be read-only. Read more on the blog, there are 7 months to go.

UBSDK 0.2.22

UBSDK 0.2.22

TestsTested
LangLanguage Obj-CObjective C
License Custom
ReleasedLast Release Mar 2015

Maintained by Marcus Greenwood.



 
Depends on:
BaseModel>= 0
HRCoder>= 0
PureLayout>= 0
DTModelStorage>= 0
DTTableViewManager>= 0
DTCollectionViewManager>= 0
SSKeychain>= 0
SVProgressHUD>= 0
EasyMapping~> 0.6.3
AFNetworking>= 0
Bolts>= 0
SDWebImage~> 3.6
TPKeyboardAvoiding>= 0
BKMoneyKit>= 0
CocoaLumberjack~> 1.9
SVGKit>= 0
BSKeyboardControls~> 2.2
TTTAttributedLabel>= 0
 

UBSDK 0.2.22

iOS SDK

Reference the UBSDKFramework in your project using the private Cocoapod:

pod 'UBSDK', :git => '[email protected]:inventures/ub-ios.git', :tag => '0.2.12'

Initialise the UB iOS SDK:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [UBSDK sharedInstance].isModal = NO;
    [UBSDK sharedInstance].apiKey = @"APIKEY";

    // setup UB stylesheet
    NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
        [UIColor colorWithRed:255.0f/255 green:189.0f/255 blue:87.0f/255 alpha:1.0f], @"primaryColor",
        [UIColor colorWithRed:74.0f/255 green:74.0f/255 blue:74.0f/255 alpha:1.0f], @"textColor",
        [UIFont fontWithName:@"AvenirNext-Regular" size:15], @"textFont",
        [UIFont fontWithName:@"AvenirNext-Bold" size:15], @"boldFont",
        [UIFont fontWithName:@"AvenirNext-Italic" size:15], @"italicFont",
        [UIFont fontWithName:@"AvenirNext-Medium" size:11], @"labelFont",
        [UIFont fontWithName:@"AvenirNext-Regular" size:22], @"headingFont",
        nil];
    [[UBSDK sharedInstance] configureStylesheetWithDictionary:settings];

    // handle product title tap to show product within your app
    [[UBSDK sharedInstance] subscribeToProductViewCallback:^(NSString* urlString) {
        [MyApp showProductWithUrl:urlString];
    }];

    // Override point for customization after application launch.
    return YES;
}

Add a product to basket:

[[UBSDK sharedInstance] addProductWithUrl:url];

Just show the basket:

[[UBSDK sharedInstance] showBasket];

Crawling API instructions

First you need a access token. Ask us for one.

POST https://api.ub.io/products/crawl

Parameters:

token=[access token]
url=[url of the product]
wait=true

Try with this url in CURL to test it.

http://www.topshop.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=12556&catalogId=33057&productId=16614303&categoryId=1093383&parent_category_rn=208530

Possible responses:

200 - ok with product details. Please note product.outOfStock value
404 - not found or shop not supported
50x - error. please treat as out of stock. we receive automatic notifications for errors and will investigate accordingly.