Skip to content

ARTLabs-Engineering/meshkraft-ios-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meshkraft

Version License Platform

ART Labs introduces tailor-made AR-commerce. A specially designed, effortless, 3D-powered boost for eCommerce.

Installation

CocoaPods

To integrate Meshkraft into your Xcode project using CocoaPods, add it to your Podfile:

pod 'Meshkraft'

Then, run the following command:

$ pod install

Usage

Initialization

  1. Import Meshkraft framework header in your AppDelegate

    import Meshkraft
  2. Add the following to your AppDelegate application:didFinishLaunchingWithOptions: method.

    Meshkraft.setApiKey("YOUR_API_KEY")

    Make sure to replace YOUR_API_KEY with your application token.

Code Implementation

Import Meshkraft framework header

import Meshkraft

AR Session

Start an AR session with product SKU:

Meshkraft.meshkraft().startARSession(productSKU: "YOUR_PRODUCT_SKU")

To receive model loading status notifications , conform to MeshkraftDelegate protocol:

Meshkraft.meshkraft().delegate = self
extension ViewController : MeshkraftDelegate {
    
    func modelLoadStarted() {
        print("load started")
        activityIndicator.startAnimating()
    }
    
    func modelLoadFinished() {
        print("load finished")
        activityIndicator.stopAnimating()
    }
    
    func modelLoadFailed(message: String) {
        print("load failed message: \(message)")
        activityIndicator.stopAnimating()
    }
    
}

Model URL

Get AR model URL with product SKU: Get the modelURL from the completion block, check the errorMessage for any possible errors.

Meshkraft.meshkraft().getModelURL(productSKU: "YOUR_PRODUCT_SKU", completion: {(modelUrl, errorMessage) in
    print("modelUrl: \(modelUrl ?? "")")
    print("errorMessage: \(errorMessage ?? "")")
})

Device Support

You can check if AR is supported on the device:

Meshkraft.isARSupported()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published