Skip to content

tenqube/commerce-ios-sdk-sample

Repository files navigation

commerce-ios-sdk-sample

Requirements

  • Swift 5.5 / Xcode 13.2 / iOS 15.0+

Installation

  • CocoaPods
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '15.0'
use_frameworks!

target 'MyApp' do
  pod 'Commerce', :git => "https://github.com/TENQUBE/commerce-ios-sdk.git"
end

Usage

사용 예시 스크린샷
초기화
var scrapService: ScrapService?
let layer = "dev"   // 서비스 레이어 구분 (dev/prod)
let logger = true   // 로그유무
let demoApiKey = "문의" // api Key

do { scrapService = try ServiceBuilder() .setApiKey(demoApiKey) .setLayer(layer) .setLogger(logger) .build() scrapService?.initialize(completion: { err in }) } catch {

}

설명
      전달받은 apiKey 정보를 입력하새 Builder를 이용해 객체를 생성합니다.
    
사용 예시 스크린샷
ViewController 공통 적용
scrapService?.setWebViewController(vc: self, 
                                   frame: self.view.bounds) 
  
설명
      api 호출 전 scrapService를 사용하는 ViewController를       
      설정하도록 합니다.
    
사용 예시 스크린샷
사용자 등록
scrapService?.signUp(
      clientId: "testClientid", // 등록할 아이디
      birth: 1990,              // 태어난 해
      gender: .Female,          // 성별 (.Male/.Female)
      completion: { err in   })
  
설명
      아이디, 태어난 해, 성별을 입력합니다.                          
    
사용 예시 스크린샷
커머스 목록 가져오기
scrapService?.getCommerces(completion: { err, items in    })
  
설명
    
      커머스 목록을 가져옵니다.                                   
    
사용 예시 스크린샷
커머스 로그인
scrapService?.startLogin(
                    id:  "testId",   // 커머스 사용자 아이디
                    pwd: "testPwd",  // 커머스 사용자 패스워드
                    commerceId: "commerceId", // 커머스 아이디
                    completion: { err in   })
  
설명
      커머스에 로그인을 합니다.
    
사용 예시 스크린샷
커머스 스크랩
scrapService?.startScrapingOrder(
                  id: "testId", // 커머스 사용자 아이디
                  pwd: "testPwd", // 커머스 사용자 패스워드
                  commerceId: "commerceId", // 커머스 아이디
                  completion: { err, result in   })    
  
설명
      startLogin() -> startScrapingOrder() 순서로 호출하여      
      커머스 주문내역 스크랩을 합니다.
    
사용 예시 스크린샷
커머스 로그인 정보 스크랩
scrapService?.getScrapingUsers(completion: { err, rst in   })
  
설명
      로그인 정보가 저장된 커머스 목록을 가져옵니다.                   
    
사용 예시 스크린샷
스크랩한 주문 목록 가져오기
scrapService?.getOnlineOrders(
          commerceIds: ["commerceId"], // 커머스 아이디 목록
          completion: { err, rst in   })
  
설명
      스크랩된 주문 목록을 가져옵니다.                              
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors