Web
caution
We are updated some points on plugin.
Most change is entagration is handled by url. Therefore,
There is no need to update your app or website frequently. Improvements and new features are reached immediately.
Second change is apply function. No more need to enter color information or anything else.The only needed information is product category and product name. this give us to flexiblity of improvement on better visual results.
Comminacation on web is handled by postMessage
function because of url usage.
caution
Photo makeup and Photo nailpolish usages are very similar but there is some small differences on function names and parameters.
#
1. Importing pluginYou can directly import plugin into your project. No need to import any file to your projects. Just insert iframe with below configurations.
src
: url of our website.allow
: camera permission must be given. Otherwise camera can not be open. Visitor choose only model or pick image from device.onload
: Some informations are must be provided to webview. These informations are defined in ^below.
#
2. StructureBasically we need one iframe and color buttons. Any design can be created with this plugin. We uses product names to apply them. Product informations are stored in our pms system. To apply any product, The only information you need is product code.
When iframe loaded some informations are must be provided. Comminication between iframe and your site provided by post messages.Post message contents are includes function name and parameters. It can be tested on your localhost. But you need to give us your domain name for production. Unrecorded subdomains are not allowed for security issues.
caution
You can use any hex color to get result. But it is not recomended for production. Our results are getting better day by day. And we developing algorithms for product base.
#
3. FunctionsYou can see very simple usage of our plugin. Iframe is center of page and color buttons below. When web page is loaded init
function runs with api-key
, website_id
and initial_product
parameters. Without these information plugin does not works.
Will be used on iframe load
postMessage
is must be called to execute functions in iframe. Setting api key and initProducts is simple.
set_initial_product
takes string parameter as product name.
caution
There is option to use and design your own camera ui. In this scenario you can create camera ui. And only result is shown by our ui.
Only use result screen
In this scenario when page load or photo captured, photo must be provided with below function.
loadimgBase64
takes one argument which is base64 representation of captured photo.
- Will be used on product selection
applyProduct
takes product name. Product name must be name of product that recorded on our pms.applyColorNailPolish
takes hex color in string format.removeProduct
takes only category name.
#
Plugin filesMail us to to get web and api-key. You can get contact from here.