Giter VIP home page Giter VIP logo

cuzy-ios-demo's Introduction

Cuzy-iOS-demo

alt tag

iOS demo, that shows the capabilities of Cuzy SDK (淘宝客),taobaoke, that can be found on http://www.cuzy.com

===============version 3.1==========================

last update 2013.8.13

  1. add result filter function
  2. add results sorting methods

===============version 3.0=============== last update: 2013.7.23 fix tmall jump bug. add picsize function

  1. this is a IOS APP SDK for taobaoke (Also has a sdk for android)

  2. you can download the sdk at : http://cuzy.com/index/download_sdk

  3. Something Notable:

1).Copy the apropriate architecture's .a library and the apropriate resource bundle when you test.

2).You app's mainWindow's rootViewController should not be nil.

3).Add -ObjC linker flag to your other link flag.

4.HOW TO USE: #import "CuzyAdSDK.h" @interface FrontViewController : UIViewController

{

}

  • (void)viewDidLoad { [super viewDidLoad]; [[CuzyAdSDK sharedAdSDK] setDelegate:self]; [[CuzyAdSDK sharedAdSDK] registerAppWithAppKey:@"cuzy key" andAppSecret:@"cuzy secret"]; }

  • (IBAction)showLayout1:(id)sender { [[CuzyAdSDK sharedAdSDK] fetchAppItemWithThemeID:nil orSearchKeywords:@"abcd"]; }

  • (IBAction)showLayout2:(id)sender {

    //////可以使用这个函数改变排序方式, 支持的排序方式有多种,具体可以参考文档或者.h文件///////////////////////// //[[CuzyAdSDK sharedAdSDK] setItemSortingMethod:@"commission_volume_desc"]; ////// 可以用以下函数设置 过滤功能/////////////////////////////////////////////////////////////////

    //1.商品降价 大于30元 [[CuzyAdSDK sharedAdSDK] setFilter_PromotionRange:@"100" withEnd:@""];

    //2. 卖家等级 大于10,五钻以上// [[CuzyAdSDK sharedAdSDK] setFilter_SellerCreditRange:@"10" withEnd:@""];

    //3.佣金比例大于20%// [[CuzyAdSDK sharedAdSDK] setFilter_ComissionRate:@"2000" withEnd:@""];

    //4. 30天内促销量 大于500//[[CuzyAdSDK sharedAdSDK] setFilter_ComissionVolumeIn30days:@"500" withEnd:@""];

    //5. 淘宝类型//[[CuzyAdSDK sharedAdSDK] setFilter_itemType:@"1"];

    ///////////////////////////////////////////////////////////////////////// [[CuzyAdSDK sharedAdSDK] fetchAppItemWithThemeID:@"2" orSearchKeywords:@"鞋子" withPageIndex:0]; }

  • (IBAction)getRawDataArray:(id)sender { NSArray* rawArray = [[CuzyAdSDK sharedAdSDK] fetchRawItemArraysWithThemeID:@"8" orSearchKeywords:@"adbc" withPageIndex:0];

    NSLog(@"the rawArray size is %d", rawArray.count); for (int i =0;i<[rawArray count]; i++) { CuzyTBKItem* tempItem = [rawArray objectAtIndex:i];

    }

}

  1. set picture size /* picsize: 可以定制返回图片的大小,注意图片越大,获取图片的时间越长。默认返回的图片大小为200*200 600x600 400x400 360x360 350x350 320x320 310x310 300x300 290x290 270x270 250x250 240x240 230x230 220x220 210x210 200x200 190x190 180x180 170x170 160x160 130x130 120x120 110x110 100x100 90x90 80x80 70x70 60x60 40x40 */

-(void)setRawItemPicSize:(NSString*)sizeString;

////////////////////////////////////////////////////////

/////////////////////////////////version 3.0///////////////////////

为了解决天猫物品的跳转问题,在使用 webview展示商品detail的时候。,需要重新构造一下跳转连接,代码如下。

  • (void)webViewDidFinishLoad:(UIWebView *)webView { [self.loadingImage setHidden:YES];

    NSLog(@"webview fininsh loading %@", [webView.request.URL absoluteString]); NSString* absoluteString = [webView.request.URL absoluteString]; if ([absoluteString rangeOfString:@"http://detail.tmall.com/"].length>0) {

      NSArray* substrings = [absoluteString componentsSeparatedByCharactersInSet:
       [NSCharacterSet characterSetWithCharactersInString:@"?&"]];
     
     
     
      @try {
          NSString* idstring = [substrings objectAtIndex:1];
          NSString* subIdString = [idstring substringFromIndex:3];
          NSString* wapString = [@"" stringByAppendingFormat:@"http://a.m.tmall.com/i%@.htm",subIdString];
          urlString = wapString;
          NSURL* url = [NSURL URLWithString:[self.urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
          if (url)
          {
              NSURLRequest* request = [NSURLRequest requestWithURL:url];
              if (request)
              {
                  [self.webview loadRequest:request];
              }
          }
      }
      @catch (NSException *exception) {
          ///todo
      }
    

    }

}

////////////////////////////////////////////////////////

QQ:1263572458 QQ群:322622433

意见反馈及技术支持:Email:[email protected],[email protected]

地址:朝阳区西大望路甲3号 蓝堡国际中心1座2303

////////////////////////////////////////////////////////

alt tag alt tag

alt tag

alt tag

alt tag

keywords:taobaoke,淘宝客,掌淘,手机淘客,cuzy,cuzysdk,返利,手机返利

cuzy-ios-demo's People

Contributors

oday0311 avatar kgro avatar

Watchers

kevin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.