测试已测试 | ✗ |
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 |
使用私有 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];
首先您需要一个访问令牌。向我们要一个。
POST https://api.ub.io/products/crawl
参数
token=[access token]
url=[url of the product]
wait=true
使用这个 URL 在 CURL 中测试。
可能响应
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.