iOS SDK
Seel iOS SDK provides a way to integrate Seel Return Assurance(RA) into your iOS app.
Integrating RA into an iOS client includes adding the RA widget to the checkout page, setting up RA event listeners, creating a quote when shopper opts in RA, and creating a policy after shopper has purchased the RA.
pod init
3. Add this line to your Podfile:
pod 'SeelSDK'
4. Run the following command:
pod install
5. Don't forget to use the .xcworkspace file to open your project in Xcode, instead of the .xcodeproj file, from here on out.
6. In the future, to update to the latest version of the SDK, just run:
pod update SeelSDK
Add RA widget to the checkout page.
let controller = SeelRAViewController.start()
present(controller, animated: true, completion: nil)
createQuote() is triggered when shopper lands on the checkout page.
var quoteInfo = {
"quote_type": "bra",
"quote_info": {
"session_id": "347d24413737713f326719ad450263ba",
"cart_id": "cart_12345",
"items":[{ // all items in the cart
"item_id": "5821444812",
"is_final_sale": True,
"quantity": 1,
"price": 34.33,
"original_price": 34.33,
"variant_id": "23123",
"product_id": "12344",
"title": "title_1",
"description": "description_1",
"color": "red",
"size": "s",
"brand_id": "21",
"brand_name": "brand_1",
"category": "category_1",
"store_id": "123"
}
]
"customer_info": { //customer_info is optional
"email": "[email protected]",
"addr_1": "123 Main St",
"addr_2": "Apt 1001",
"city": "San Francisco",
"state": "CA",
"zipcode": "94105",
"country": "US"
}
}
}
self.createQuote(quoteInfo)
Set up RA event listeners to listen RA check/uncheck events.
extension SeelRAViewController: SeelRAEventListener {
func onRAChecked() {
// Implemenation required: add RA to the order
print("onRAChecked")
}
func onRAUnchecked() {
// Implemenation required: remove RA from the order
print("onRAUnchecked")
}
}
createPolicy() is triggered when shopper successfully places an order with Return Assurance opted in, and is used to inform Seel of the policy creation.
var policy_info = {
"quote_id": "quote_123",
"order_id": "order_123",
"customer_email": "[email protected]"
}
self.createPolicy(policy_info)
Last modified 3mo ago