UBSDK 0.2.22

UBSDK 0.2.22

测试已测试
Lang语言 Obj-CObjective C
许可证 自定义
发布上次发布2015年3月

Marcus Greenwood 维护。



 
依赖于
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

使用私有 Cocoapod 将 UBSDKFramework 集成到您的项目中

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

初始化 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;
}

添加产品到购物篮

[[UBSDK sharedInstance] addProductWithUrl:url];

只是显示购物篮

[[UBSDK sharedInstance] showBasket];

爬虫 API 说明

首先您需要一个访问令牌。向我们要一个。

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

参数

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

使用这个 URL 在 CURL 中测试。

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

可能响应

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.