Skip to main content

Tangiblee Help Center

Integration für mobile Apps

So integrieren Sie Ihre mobilen Apps:

Sobald der Bildschirm mit den Produktdetails geöffnet ist, müssen Sie die SKU validieren. Eine API-Anfrage sollte an den folgenden Endpunkt gesendet werden:

https://api.tangiblee.com/api/tngimpr?ids=<sku1>&domain=<domain>&activeLocale=en

Wo Artikelnummer 1 ist die aktuelle Variations-SKU, eine Domain sollte Ihre Domain sein.

Sobald der Benutzer auf das PDP klickt, sollte ein Bildschirm mit der WebView-Komponente geöffnet werden. Shift the url in the following format:

https://cdn.tangiblee.com/widget/index.html?id=sku&domain=<retailer domain>&useCookies=true&price=<price>&currency=<currency symbol>

Configuration of the app

Falls wir AR zeigen müssen, sollten Kameraberechtigungen angegeben werden.

iOS

1. In info.plist must you add the following code (click you with the right button and select „As quellcode anzeigen“, to add him):

<key>NSCameraUsageDescription</key>
<string>Camera Access</string>

2. Create a WebView and set the field allowsInlineMediaPlayback in der WebConfiguration auf true.

Code-Example:

class ViewController: UIViewController, WKUIDelegate {
var webView: WKWebView!

	override func loadView() {
	    let webConfiguration = WKWebViewConfiguration()
	    webConfiguration.allowsInlineMediaPlayback = true
	    webView = WKWebView(frame: .zero, configuration: webConfiguration)
	    webView.uiDelegate = self
	    view = webView
	}
	
	override func viewDidLoad() {
	    super.viewDidLoad()         
	    let myURL = URL(string:"https://cdn.tangiblee.com/widget/index.html?id=th1791880&domain=titan.co.in&useCookies=true&price=13495.00&currency=₹&version=3.1.1.180")
	    let myRequest = URLRequest(url: myURL!)
	    webView.load(myRequest)
	}
}

Android

1. Add to the manifest file:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />

2. Add a webview-element to activity_main.xml (or a other xml file)

Code-Example:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <WebView
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>

3. Add the following code to MainActivity.kt (or a other .java- or .kt file):


class MainActivity : AppCompatActivity() {
    val PERMISSION_CAMERA_REQUEST_CODE = 200
    lateinit var webView: WebView;

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        requestPermissions(this, arrayOf(Manifest.permission.CAMERA), PERMISSION_CAMERA_REQUEST_CODE)

        webView = findViewById(R.id.webview)
        webView.setWebChromeClient(object : WebChromeClient() {
            override fun onPermissionRequest(request: PermissionRequest) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                    request.grant(request.resources)
                }
            }
        })

        webView.loadUrl("https://cdn.tangiblee.com/widget/index.html?id=th1791880&domain=titan.co.in&useCookies=true&price=13495.00¤cy=₹&version=3.1.1.180")
        webView.settings.javaScriptEnabled = true
    }
}

RestricTIONS

Tangiblee hat noch kein SDK für Mobilgeräte. Wenn Sie Tangiblee zu Ihrer mobilen App hinzufügen möchten, teilen Sie dies bitte Ihrem Account Manager mit, damit er Ihnen Optionen anbieten kann.

AR auf iOS wird ab Version 14.3 unterstützt. In älteren Versionen als this must the Tangiblee-CTA versteckt werden.