Deprecated JavaScript API Calls

The following API calls have been replaced with newer calls or represent functionality that is no longer supported.

This documentation is preserved as a reference for developers who may be revising an older, existing project, but these calls may no longer work or may be removed in a future version and should not be used in new projects moving forward.

API: Check API Availability

These API calls allowed a page to determine when the JavaScript API is available if accessing the API by injection.

Accessing the API by injection was deprecated in version 10.0 and is not recommended for new projects as it may be removed in a later release. We currently recommend accessing the API by import as that is a more flexible solution without any of the downsides of relying on injection.

Previously supported in:

Kiosk Pro Basic, Plus and Enterprise

Requirements

  • Integration of our JavaScript API into your webpage
  • Offline Status
    • Unlike all other API calls we provide, the API Availability functions are only used when the JavaScript API is accessed by injection, which means that the files must be downloaded, unzipped, and transferred locally to the the device.
    • As functions are only available in the 'By Injection' method if the device is offline, the device must not be connected to the Internet.
  • App Settings
    • JavaScript > Access JavaScript API = By Injection (Deprecated, Offline Only)

Deprecated Function:
kp_Vars_DidInject

This was a callback triggered by the app when all app-defined variables in the JavaScript API were successfully loaded and available for use.

Format
kp_Vars_DidInject();
		
Status This callback does not return a specific value but can be used to trigger other events that rely on the JavaScript API being available. This is done by defining this callback function in your code and placing a call within it.

Deprecated Function:
kp_Hooks_DidInject

This callback was triggered by the app when all functions and callbacks that make up the JavaScript API were successfully loaded and available for use.

Format
kp_Hooks_DidInject();
		
Status This callback does not return a specific value but can be used to trigger other events that rely on the JavaScript API being available. This is done by defining this callback function in your code and placing a call within it.

Change Log

  • Added in version 3.4.1. Deprecated in version 10.0.

API: Manage Local Files

The deprecated function returned the appropriate base64 string for any locally stored image file in Kiosk Pro's Documents folder. This could be useful when your content was hosted remotely, but you required access to a file that was stored locally on the device - for example if you wanted to create a thumbnail to display on your page or return a text string that can be uploaded to a database.

This function was deprecated in version 10.0. As Base64 strings can be very large, running this type of processing on a full-resolution image can result in performance problems when using Kiosk Pro. We continue to support a newer call, kp_PhotoVideo_base64FromScaledPhoto, that supports passing specific pixel dimensions for the resulting Base64 string, allowing you to request the minimum necessary size required for a specific use case.

Previously supported in:

Kiosk Pro Plus and Enterprise

See main article for requirements for use.

Deprecated Function:
kp_FileAPI_base64FromFile

If the file is located in a subfolder, the filepath included in the name parameters should be relative to Kiosk Pro's Document root folder (not to the page calling the function).

Format
kp_FileAPI_base64FromFile(filename, callback);
		
Parameters
  • filename - [string, required] the name of the image file to convert to a Base64 string
  • callback - [string, optional] the name of the callback to be triggered after the function has been executed
Callback format
callback(base64String, error);
		
Callback return values
  • base64String - the base64 string of the resized image
  • error - if defined, an array of key-value pairs returning the reason for failure
  • Change Log

    • Added in version 7.5 & deprecated in version 10.0

    API: Print to AirPrint Printer

    The deprecated callback was triggered when a visitor cancels printing or an error occurred.

    This callback was replaced in version 10.0 with kp_AirPrinter_printDidFailWithErrorEx to allow the app to return more robust information about why the print call failed.

    Previously supported in:

    Kiosk Pro Basic, Plus and Enterprise

    See main article for requirements for use.

    Deprecated Callback:
    kp_AirPrinter_printDidFailWithError

    Format
    kp_AirPrinter_printDidFailWithError(errorCode);
    		
    Return Values errorCode = the code of the error as an integer. The following are possible:
    • -1001 - AirPrint is disabled in Kiosk Pro's settings
    • -1000 - AirPrint dialog is already showing
    • -999 - WebView failed to create the necessary printer controller
    • -998 - printing was not completed: visitor cancelled printing or another error communicated by the printer
    • -997 - Number of Copies setting <= 0
    • 1 - the device does not support printing
    • 2 - no print formatter, page renderer, printing item or printing items was assigned for printing
    • 3 - an image is in a format not recognized by UIKit for printing
    • 4 - an internal error occurred with the print job

    Change Log

    • Added in version 1.0. Deprecated in version 10.0.

    API: Print to Custom America Printer

    The Custom America Printer API allowed the printing of simple text, certain HTML elements, bar codes, and QR codes to supported Custom America thermal printers. In addition, the Custom America Printer API could return information about the results of a specific printing job and the status of a connected Custom America printer.

    This API and associated settings were deprecated in version 10.0 after Custom America notified us that they would no longer be offering the Bluetooth dongles used to connect their printers to iOS and iPadOS devices for sale moving forward.

    Previously supported in:

    Kiosk Pro Enterprise

    Requirements

    • JavaScript API > Access JavaScript API
      • 'By Import' - recommended, worked both online & offline, required inclusion of kiosk_functions.js prior to any of the following calls.
      • 'By Injection' - only worked offline, may not be available 'onload' event.
    • Printing > Custom America Printer = On
    • Printing > Custom America Printer Settings > Select Custom America Printer = selected
    • Connection to a supported Custom America printer

    Previously Supported Devices

    This app previously supported the following Custom America thermal kiosk printers:

    D-ONE K3 KPM150H
    KPM180H KPM216H 200 dpi KPM216H 300 dpi
    KPM216H ETH 200 dpi KPM216H ETH 300 dpi KPM302H
    KUBE KUBE ETHERNET mPLUS2
    MY3A MYPRINTER PLUS2
    PLUS4 Q1 Q3
    TG02-H TG2460H TG2480H
    TL60 TL80 VK80
    VKP80II VKP80II ETHERNET VKP80III

    Your iOS device must be connected to the Custom America printer through Bluetooth, which must be configured prior to app launch in iOS/iPadOS Settings.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_printText

    This function printed the text parameter defined.

    Format
    kp_CustomAmericaPrinterAPI_printText(text, pixelLeftAlign, pixelTextWidth, feed, wordWrap, callback);
    		
    Parameters
    • text = text to be printed, formatted as a string.
    • pixelLeftAlign = the left margin in pixels, formatted as a string.
    • pixelTextWidth = text width in pixels, formatted as a string. Pass '-1' to use maximum available width.
    • feed = integer representing whether to automatically add a line feed at the end of the request. Possible values are:
      • 1 = adds a line feed.
      • 0 = does not add a line feed and the next print request will print immediately following this one without a break.
    • wordWrap = integer representing whether to automatically wrap words at the end of a line, using the 'Word Wrap Page Width' in Kiosk Pro settings. Possible values are:
      • 1 = formats the text with word wrapping.
      • 0 = does not format the text with word wrapping and so individual words may break at the end of a line.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_printImage

    This function printed the image parameter defined.

    Format
    kp_CustomAmericaPrinterAPI_printImage(pathToImage, imageJustification, imageScale, imageWidth, callback);
    		
    Parameters
    • pathToImage = relative path to image stored in Kiosk Pro's documents folder or full URL to remotely stored image, formatted as a string.
    • imageJustification = justification of the image on the page. Possible values are:
      • 0 = left justification.
      • -1 = center justification.
      • -2 = right justification.
    • imageScale = determines how the image is scaled prior to printing. Possible values are:
      • 0 = no scaling.
      • 1 = image is scaled to fit page width.
      • 2 = image is scaled to the width provided in 'imageWidth' parameter below.
    • imageWidth = width of the image in pixels. Pass '-1' to use the maximum available width. Only has an effect if 'imageScale' parameter above is set to '2'.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_printHTMLElement

    This function printed the contents of the HTML element defined through parameters. This function allowed you to pass both text and images as part of a single print call and could recognize basic .html formatting including header tags (e.g., h1, h2), formatting tags (e.g., bold, italic, underline), margin and alignment tags.

    Format
    kp_CustomAmericaPrinterAPI_printHTMLElement(elementID, wordWrap, callback);
    		
    Parameters
    • elementID = relative path to image stored in Kiosk Pro's documents folder or full URL to remotely stored image, formatted as a string.
    • wordWrap = justification of the image on the page. Possible values are:
      • 1 = formats the text with word wrapping.
      • 0 = does not and individual words may break at the end of a line.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_printBarCode

    This function printed defined text parameter as a 1D barcode, including UPC and EAN barcodes.

    Format
    kp_CustomAmericaPrinterAPI_printBarCode(text, type, justification, hri, barWidth, height, callback);
    		
    Parameters
    • text = text to be printed in barcode format, formatted as a string.
    • type = barcode format to be used. Possible values are:
      • -1 = CODEBAR
      • -2 = UPC-A
      • -3 = UPC-E
      • -4 = EAN13
      • -5 = EAN8
      • -6 = CODE39
      • -7 = ITF
      • -8 = CODE93
      • -9 = CODE128
      • -10 = CODE32
      • Each format has its own requirements so if, for example, you attempt to print a 6-digit string as a UPC-A (traditionally a 12-digit string), an error will be returned.
    • justification = justification of the bar code on the page. Possible values are:
      • 0 = left justification.
      • -1 = center justification.
      • -2 = right justification.
    • hri = 'human readable input', the text of the barcode. Possible values are:
      • 1 = HRI above the barcode.
      • 2 = HRI below the barcode.
      • 3 = HRI above and below the barcode.
    • barWidth = horizontal width of the barcode, defined as the width of the narrow bar. Possible values are:
      • 1 = narrow
      • 2 = medium
      • 3 = wide
    • height = height of the barcode in pixels.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_print2DBarCode

    This function printed defined text parameter as a 2D barcode, including QR codes and PDF417 barcodes.

    Format
    kp_CustomAmericaPrinterAPI_print2DBarCode(text, type, justification, width, callback);
    		
    Parameters
    • text = text to be printed in barcode format, formatted as a string.
    • type = barcode format to be used. Possible values are:
      • -101 = QR CODE
      • -102 = MICRO QR CODE
      • -103 = DATAMATRIX
      • -104 = PDF417
      • -105 = MICRO PDF417
      • -106 = AZTEC
    • justification = justification of the bar code on the page. Possible values are:
      • 0 = left justification.
      • -1 = center justification.
      • -2 = right justification.
    • width = width of the barcode in pixels. Pass '-1' to use the maximum available width.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_feed

    This function instructed the printer to feed a specific number of lines.

    Format
    kp_CustomAmericaPrinterAPI_feed(numberOfLFToSend, callback);
    		
    Parameters
    • numberOfLFToSend = determines number of lines to feed, formatted as a string.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_cut

    This function instructed the printer to cut.

    Format
    kp_CustomAmericaPrinterAPI_cut(cutType, callback);
    		
    Parameters
    • cutType = determines cut type. Possible values are:
      • 0 = full cut.
      • 1 = partial cut. If partial cut is specified and printer does not support partial cut, a full cut will be performed.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getPageWidth

    This function returns the width of the thermal paper roll in pixels through a callback.

    Format
    kp_CustomAmericaPrinterAPI_getPageWidth(callback);
    		
    Parameters callback = callback name as a string.
    Callback format
    callback(errorDic, pageWidth);
    		
    Callback return values
    • errorDic = an array containing the domain, code, and description of any error that occurred during the request.
    • pageWidth = the width in pixels of the thermal paper the printer is configured to use.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_setFontCharWidth

    This function set the character width of the printer.

    Format
    kp_CustomAmericaPrinterAPI_setFontCharWidth(value, callback);
    		
    Parameters
    • value = the character width as a multiplier of the base size of the current font. Possible values are:
      • 0 = indicates that the font is being printed at the default 1x character width.
      • 1 = at 2x.
      • 2 = at 3x.
      • 3 = at 4x.
      • 4 = at 5x.
      • 5 = at 6x.
      • 6 = at 7x.
      • 7 = at 8x.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getFontCharWidth

    This function returned the current character width of the printer through a callback.

    Format
    kp_CustomAmericaPrinterAPI_getFontCharWidth(callback);
    		
    Parameters callback = callback name as a string.
    Callback format
    callback(errorDic, charWidth);
    		
    Callback return values
    • errorDic = an array containing the domain, code, and description of any error that occurred during the request.
    • charWidth = the current character width as a multiplier of the base size of the current font. Possible values are:
      • 0 = indicates that the font is being printed at the default 1x character width.
      • 1 = at 2x.
      • 2 = at 3x.
      • 3 = at 4x.
      • 4 = at 5x.
      • 5 = at 6x.
      • 6 = at 7x.
      • 7 = at 8x.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_setFontCharHeight

    This function set the character height of the printer.

    Format
    kp_CustomAmericaPrinterAPI_setFontCharHeight(value, callback);
    		
    Parameters
    • value = the character height as a multiplier of the base size of the current font. Possible values are:
      • 0 = indicates that the font is being printed at the default 1x character height.
      • 1 = at 2x.
      • 2 = at 3x.
      • 3 = at 4x.
      • 4 = at 5x.
      • 5 = at 6x.
      • 6 = at 7x.
      • 7 = at 8x.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getFontCharHeight

    This function returned the current character height of the printer through a callback.

    Format
    kp_CustomAmericaPrinterAPI_getFontCharHeight(callback);
    		
    Parameters callback = callback name as a string.
    Callback format
    callback(errorDic, charHeight);
    		
    Callback return values
    • errorDic =- an array containing the domain, code, and description of any error that occurred during the request.
    • charHeight = the current character height as a multiplier of the base size of the current font. Possible values are:
      • 0 = indicates that the font is being printed at the default 1x character height.
      • 1 = at 2x.
      • 2 = at 3x.
      • 3 = at 4x.
      • 4 = at 5x.
      • 5 = at 6x.
      • 6 = at 7x.
      • 7 = at 8x.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_setFontEmphasizedProperty

    This function set whether the printer should print in bold font weight.

    Format
    kp_CustomAmericaPrinterAPI_setFontEmphasizedProperty(value, callback);
    		
    Parameters
    • value = indicates whether the font should be printed in bold font weight. Possible values are:
      • 0 = indicates that the font is not being printed in bold.
      • 1 = indicates that the font is being printed in bold.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getFontEmphasizedProperty

    This function returned whether the printer is currently printing in bold font weight through a callback.

    Format
    kp_CustomAmericaPrinterAPI_getFontEmphasizedProperty(callback);
    		
    Parameters callback = callback name as a string.
    Callback format
    callback(errorDic, isEmphasized);
    		
    Callback return values
    • errorDic = an array containing the domain, code, and description of any error that occurred during the request.
    • isEmphasized = integer value defining whether text is currently printing in bold weight. Possible values are:
      • 0 = indicates that the font is not being printed in bold.
      • 1 = indicates that the font is being printed in bold.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_setFontItalicProperty

    This function set whether the printer should print in italics.

    Format
    kp_CustomAmericaPrinterAPI_setFontItalicProperty(value, callback);
    		
    Parameters
    • value = indicates whether the font should be printed in italics. Possible values are:
      • 0 = indicates that the font is not being printed in italics.
      • 1 = indicates that the font is being printed in italics.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getFontItalicProperty

    This function returned whether the printer was currently printing in italics through a callback.

    Format
    kp_CustomAmericaPrinterAPI_getFontItalicProperty(callback);
    		
    Parameters callback = callback name as a string.
    Callback format
    callback(errorDic, isItalic);
    		
    Callback return values
    • errorDic = an array containing the domain, code, and description of any error that occurred during the request.
    • isItalic = integer indicating whether the font will be printed in italics. Possible values are:
      • 0 = indicates that the font is not being printed in italics.
      • 1 = indicates that the font is being printed in italics.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_setFontUnderlineProperty

    This function set whether the printer should print with underline.

    Format
    kp_CustomAmericaPrinterAPI_setFontUnderlineProperty(value, callback);
    		
    Parameters
    • value = indicates whether the font should be printed with underline. Possible values are:
      • 0 = indicates that the font is not being printed with underline.
      • 1 = indicates that the font is being printed with underline.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getFontUnderlineProperty

    This function returned whether the printer was currently printing with underline through a callback.

    Format
    kp_CustomAmericaPrinterAPI_getFontUnderlineProperty(callback);
    		
    Parameters
    • value = indicates whether the font should be printed with underline. Possible values are:
      • 0 = indicates that the font is not being printed with underline.
      • 1 = indicates that the font is being printed with underline.
    • callback = callback name as a string.
    Callback format
    callback(errorDic, isUnderline);
    		
    Callback return values
    • errorDic = an array containing the domain, code, and description of any error that occurred during the request.
    • isUnderline = integer indicating whether the font will be printed with underline. Possible values are:
      • 0 = indicates that the font is not being printed with underline.
      • 1 = indicates that the font is being printed with underline.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_setFontJustificationProperty

    This function set how the printer should justify text.

    Format
    kp_CustomAmericaPrinterAPI_setFontJustificationProperty(value, callback);
    		
    Parameters
    • value = indicates whether the font should be printed with underline. Possible values are:
      • 0 = left justification.
      • 1 = center justification.
      • 2 = right justification.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getFontJustificationProperty

    This function returned how the printer was currently justifying text through a callback.

    Format
    kp_CustomAmericaPrinterAPI_getFontJustificationProperty(callback);
    		
    Parameters callback = callback name as a string.
    Callback format
    callback(errorDic, justification);
    		
    Callback return values
    • errorDic = an array containing the domain, code, and description of any error that occurred during the request.
    • justification = integer indicating how the font will be justified. Possible values are:
      • 0 = left justification.
      • 1 = center justification.
      • 2 = right justification.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_setCharFontType

    This function set which system font should be used for printing. Note that the font used would affect the 'Word Wrap Page Width' in Kiosk Pro settings.

    Format
    kp_CustomAmericaPrinterAPI_setCharFontType(value, callback);
    		
    Parameters
    • value = indicates which system font should be used for printing. Possible values are:
      • 0 - font A, default system font.
      • 1 - font B, a narrower, more compact font option.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getCharFontType

    This function returned which of the two system fonts was being used for printing through a callback. Note that the font used would affect the 'Word Wrap Page Width' in Kiosk Pro settings.

    Format
    kp_CustomAmericaPrinterAPI_getCharFontType(callback);
    		
    Parameters callback = callback name as a string.
    Callback format
    callback(errorDic, charFontType);
    		
    Callback return values
    • errorDic = an array containing the domain, code, and description of any error that occurred during the request.
    • charFontType = indicates which system font will be used for printing. Possible values are:
      • 0 = font A, default system font.
      • 1 = font B, a narrower, more compact font option.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_setFontInternationalCharSetType

    This function set which international character set type should be used for printing.

    Format
    kp_CustomAmericaPrinterAPI_setFontInternationalCharSetType(value, callback);
    		
    Parameters
    • value = indicates which system font should be used for printing. Possible values are:
      • 0 = printer default.
      • 1 = Russian, code page 866.
      • 2 = Turkish, code page 857.
      • 3 = Eastern European, code page 852.
      • 4 = Israeli, code page 862.
      • 5 = Greek, code page 737.
    • callback = callback name as a string.
    Callback format
    callback(errorDic);
    		
    Callback return values errorDic = an array containing the domain, code, and description of any error that occurred during the request.

    Deprecated Function:
    kp_CustomAmericaPrinterAPI_getFontInternationalCharSetType

    This function returned the international character set type being used for printing through a callback.

    Format
    kp_CustomAmericaPrinterAPI_getFontInternationalCharSetType(callback);
    		
    Parameters callback = callback name as a string.
    Callback format
    callback(errorDic, charSetType);
    		
    Callback return values
    • errorDic = an array containing the domain, code, and description of any error that occurred during the request.
    • charSetType = indicates which international character set will be used for printing. Possible values are:
      • 0 = printer default.
      • 1 = Russian, code page 866.
      • 2 = Turkish, code page 857.
      • 3 = Eastern European, code page 852.
      • 4 = Israeli, code page 862.
      • 5 = Greek, code page 737.

    Deprecated Callback:
    kp_CustomAmericaPrinterAPI_printerDidConnect

    This callback was triggered when a successful connection was made to the printer selected in Kiosk Pro settings.

    Format
    kp_CustomAmericaPrinterAPI_printerDidConnect(nameOfPrinter);
    		
    Return values nameOfPrinter = name of connected printer as string.

    Deprecated Callback:
    kp_CustomAmericaPrinterAPI_printerDidDisconnect

    This callback was triggered when a Custom America printer was disconnected. Could be used to trigger a notification that there was a problem with the printer's connection status.

    Format
    kp_CustomAmericaPrinterAPI_printerDidDisconnect();
    		

    Change Log

    • Added in version 5.5. Deprecated in version 10.0.

    API: Return Device Location

    This associative array returns key-value pairs defining the coordinates, accuracy, and timestamp of the most recent location check.

    This variable was deprecated in version 10.0 as this variable array was injected by the app into the page and, as such, was not reliably available when the 'onLoad' event was triggered. The underlying functionality is replaced by newer API calls, which do not suffer the same flaw.

    Previously Supported In:

    Kiosk Pro Plus and Enterprise

    See main article for requirements for use.

    Deprecated Variable Array:
    window.kioskpro_location

    Format
    window.kioskpro_location[value];
    		
    Return Values
    • latitude - the latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator
    • longitude - the longitude in degrees. Measurements are relative to the zero meridian, with positive values extending east of the meridian and negative values extending west of the meridian
    • accuracy - the radius of uncertainty for the location, measured in meters
    • timestamp - the time at which this location check occurred

    Change Log

    • Added in version 1.0 and deprecated in version 10.0

    API: Capture Photos & Videos

    This set of API calls allowed access to the camera and saved the result locally on the iPad in Kiosk Pro's documents folder.

    This section of the API was deprecated in version 10.3 and was replaced with a set of new API calls that exposed more options for customization and included support for Apple's Center Stage feature on supported devices.

    Previously Supported In:

    Kiosk Pro Plus and Enterprise

    See main article for requirements for use.

    Deprecated Function:
    kp_PhotoVideo_getCameraType

    This function triggered a callback returning which camera (front or back) would be used when the camera was opened for photo or video capture.

    Format
    kp_PhotoVideo_getCameraType(callback)
    		
    Parameters callback - [string] the name of the callback to be triggered after the function has been executed
    Callback format
    callback(cameraLocation);
    		
    Callback return values cameraLocation - [number] returns which camera the device is currently set to use. Possible values are:
    • 0 - rear camera
    • 1 - front camera

    Deprecated Function:
    kp_PhotoVideo_setCameraType

    This function set which camera (front or back) should be used when a photo or video capture was called. Note: The app defaulted to the front camera unless otherwise instructed.

    Format
    kp_PhotoVideo_setCameraType(cameraLocation,callback)
    		
    Parameters
    • cameraLocation - [integer] sets which camera the device should use. Possible values are:
      • 0 - rear camera
      • 1 - front camera
    • callback - [string] the name of the callback to be triggered after the function has been executed
    Callback format
    callback(success);
    		
    Callback return values success - if defined, the function successfully set the camera location

    Deprecated Function:
    kp_PhotoVideo_getFlashMode

    This function triggered a callback returning the flash mode which would be set when the camera was opened for photo or video capture. In instances where the device did not have a flash for the camera currently in use, this would be ignored.

    Format
    kp_PhotoVideo_getFlashMode(callback)
    		
    Parameters callback - [string] the name of the callback to be triggered after the function has been executed
    Callback format
    callback(flashMode);
    		
    Callback return values flashMode - [integer] representing the current flash mode configured. Possible values are:
    • -1 - off
    • 0 - auto
    • 1 - on

    Deprecated Function:
    kp_PhotoVideo_setFlashMode

    This function set how flash mode should be configured when the camera was opened for photo or video capture. In instances where the device did not have a flash for the camera currently in use, this would be ignored.

    Format
    kp_PhotoVideo_setFlashMode(flashMode, callback)
    		
    Parameters
    • flashMode - [integer] representing the flash mode to be set. Possible values are:
      • -1 - off
      • 0 - auto
      • 1 - on
    • callback - [string] the name of the callback to be triggered after the function has been executed
    Callback format
    callback(success);
    		
    Callback return values success - if defined, the function successfully set the flash mode requested

    Deprecated Function:
    takePhotoToFile

    This function triggered the native iOS camera interface to capture a photo. Using this function, the visitor must trigger photo capture through the standard iOS camera interface and was given the opportunity to 'Retake' or to cancel out of the camera. Once they took a picture and tapped 'Use Photo', the photo was saved.

    This function used the native iOS interface to allow the visitor to trigger and review the photo, which also included buttons to trigger the flash mode used and switch between the front and rear camera. While these options could be preconfigured using the API calls above, they could be changed by the visitor prior to capturing the image. To prevent this, you could choose to use the calls below featuring a countdown to trigger the camera which did not allow access to these options.

    Format
    takePhotoToFile(filename, callback);
    		
    Parameters
    • filename - [required, string] the name of the image file to be saved to the device. As photos are always saved in .png format, this file extension is automatically added to any filename defined through this parameter
    • callback - [string] the name of the callback to be triggered after the function has been executed
    Callback Format
    callback(success, error);
    		
    Callback Return Values
    • success - if defined, a photo was successfully captured and saved to the Kiosk Pro document's folder
    • error - [object] the error returned when printing fails. Includes the following:
      • domain - [string] where the error occurred
      • code - [integer] the error code
      • description - [string] a description of the error
      • debugDescription - [string] a detailed description of the error

    Deprecated Function:
    kp_PhotoVideo_takePhotoToFileResize

    This function triggered the native iOS camera interface to capture a photo. Using this function, the visitor could trigger photo capture through the standard iOS camera interface and would be given the opportunity to 'Retake' or to cancel out of the camera. Once they took a picture and tapped 'Use Photo', the photo was resized to the width and height defined in the call and saved to the app's documents folder.

    This function used the native iOS interface to allow the visitor to trigger and review the photo, which also included buttons to trigger the flash mode used and switch between the front and rear camera. While these options could be preconfigured using the API calls above, they could be changed by the visitor prior to capturing the image. To prevent this, you could choose to use the calls below featuring a countdown to trigger the camera which did not allow access to these options.

    Please note that if the height and width defined did not match the aspect ratio of the original image, then the image would be resized and then cropped as necessary to meet the height and width defined.

    Format
    kp_PhotoVideo_takePhotoToFileResize(filename, callback, width, height);
    		
    Parameters
    • filename - [required, string] the name of the image file to be saved to the device. As photos are always saved in .png format, this file extension is automatically added to any filename defined through this parameter
    • callback - [string] the name of the callback to be triggered after the function has been executed
    • width - [string] the width of saved image in pixels
    • height - [string] the height of saved image in pixels
    Callback format
    callback(success, error);
    		
    Callback return values
    • success - if defined, a photo was successfully captured and saved to the Kiosk Pro document's folder
    • error - [object] the error returned when printing fails. Includes the following:
      • domain - [string] where the error occurred
      • code - [integer] the error code
      • description - [string] a description of the error
      • debugDescription - [string] a detailed description of the error

    Deprecated Function:
    takePhotoWithCountdownToFile

    This function triggered an automatic photo capture using an on-screen countdown. The countdown was defined in the parameters of the call, along with the message shown after a successful capture and the number of seconds to display the photo taken after the message is dismissed.

    Format
    takePhotoWithCountdownToFile(filename, callback, countdownTimer, alertMessageOnSuccess, secondsToShowImage);
    		
    Parameters
    • filename - [required, string] the name of the image file to be saved to the device. As photos are always saved in .png format, this file extension is automatically added to any filename defined through this parameter
    • callback - [string] the name of the callback to be triggered after the function has been executed
    • countdownTimer - [integer] the number of seconds to count down prior to capture
    • alertMessageOnSuccess - [string] the alert message displayed after a successful capture. If empty (''), no alert will be shown
    • secondsToShowImage - [integer] the number of seconds to display image on screen following capture
    Callback format
    callback(success, error);
    		
    Callback return values
    • success - if defined, a photo was successfully captured and saved to the Kiosk Pro document's folder
    • error - [object] the error returned when printing fails. Includes the following:
      • domain - [string] where the error occurred
      • code - [integer] the error code
      • description - [string] a description of the error
      • debugDescription - [string] a detailed description of the error

    Deprecated Function:
    kp_PhotoVideo_takePhotoWithCountdownToFileResize

    This function triggered an automatic photo capture using an on-screen countdown. The countdown was defined in the parameters of the call, along with the message shown after a successful capture and the number of seconds to display the photo taken after the message is dismissed. Once complete, the photo was resized to the width and height defined in the call and saved to the app's documents folder.

    Please note that if the height and width defined did not match the aspect ratio of the original image, then the image would be resized and then cropped as necessary to meet the height and width defined.

    Format
    kp_PhotoVideo_takePhotoWithCountdownToFileResize(filename, callback, countdownTimer, alertMessageOnSuccess, secondsToShowImage, width, height);
    		
    Parameters
    • filename - [required, string] the name of the image file to be saved to the device. As photos are always saved in .png format, this file extension is automatically added to any filename defined through this parameter
    • callback - [string] the name of the callback to be triggered after the function has been executed
    • countdownTimer - [integer] the number of seconds to count down prior to capture
    • alertMessageOnSuccess - [string] the alert message displayed after a successful capture
    • secondsToShowImage - [integer] the number of seconds to display image on screen following capture
    • width - [string] the width of saved image in pixels
    • height - [string] the height of saved image in pixels
    Callback format
    callback(success, error);
    		
    Callback return values
    • success - if defined, a photo was successfully captured and saved to the Kiosk Pro document's folder
    • error - [object] the error returned when printing fails. Includes the following:
      • domain - [string] where the error occurred
      • code - [integer] the error code
      • description - [string] a description of the error
      • debugDescription - [string] a detailed description of the error

    Deprecated Function:
    takeVideoToFile

    This function captured video using the native iOS camera interface. Using this function, the visitor must start and end video capture through the standard record button and was given the opportunity to watch and 'Retake' or to cancel out of the camera. Once they tapped 'Use Video', the video was saved to the specified location.

    This function used the native iOS interface to allow the visitor to trigger and review the video, which also included buttons to trigger the flash mode used and switch between the front and rear camera. While these options could be preconfigured using the API calls above, they could be changed by the visitor prior to capturing the video. To prevent this, you could choose to use the calls below featuring a countdown to trigger the camera which did not allow access to these options.

    Format
    	takeVideoToFile(filename,callback);
    		
    Parameters
    • filename - [required, string] the name of the video file to be saved to the device. Video is saved using the H.264 codec and can be saved as .mov (default if not specified as a part of the filename defined through this parameter) or .mp4
    • callback - [string] the name of the callback to be triggered after the function has been executed
    Callback format
    callback(success, error);
    		
    Callback return values
    • success - if defined, a video was successfully captured and saved to the Kiosk Pro document's folder
    • error - [object] the error returned when printing fails. Includes the following:
      • domain - [string] where the error occurred
      • code - [integer] the error code
      • description - [string] a description of the error
      • debugDescription - [string] a detailed description of the error

    Deprecated Function:
    kp_PhotoVideo_takeVideoWithCountdown

    This allowed a page to take a video of a predetermined length with an on-screen countdown prior to start and then another optional countdown showing how long until the recording ends. This worked well in situations where storage on the device is limited or the resulting video needs to be limited to a specific duration. 

    Format
    kp_PhotoVideo_takeVideoWithCountdown(filename, callback, countdownTimer, recordingTimer, showRecordingTimer, alertMessageOnSuccess);
    		
    Parameters
    • filename - [required, string] the name of the video file to be saved to the device. Video is saved using the H.264 codec and can be saved as .mov (default if not specified as a part of the filename defined through this parameter) or .mp4
    • callback - [string] the name of the callback to be triggered after the function has been executed
    • countdownTimer - [integer] the number of seconds to count down prior to recording
    • recordingTimer - [integer] the number of seconds to record video
    • showRecordingTimer - [boolean integer] defines whether to display the countdown timer on screen during recording:
      • 1 - show the timer
      • 0 - hide the timer
    • alertMessageOnSuccess - [string] the alert message displayed after a successful capture.

    Callback format
    callback(success, error);
    		
    Callback return values
    • success - if defined, a video was successfully captured and saved to the Kiosk Pro document's folder
    • error - [object] the error returned when printing fails. Includes the following:
      • domain - [string] where the error occurred
      • code - [integer] the error code
      • description - [string] a description of the error
      • debugDescription - [string] a detailed description of the error

    Deprecated Function:
    kp_PhotoVideo_takeVideoWithEndingByTouchingScreen

    This function allowed video capture with an on-screen countdown prior to start. Once the recording started, you could display a message on-screen and/or a timer showing the visitor how long the recording has been running. Recording could be ended through a pre-defined timer or through a visitor tap to the screen.  

    Format
    kp_PhotoVideo_takeVideoWithEndingByTouchingScreen(filename, callback, countdownTimer, recordingTimer, recordingMessage, showRecordingTimer, alertMessageOnSucces);
    		
    Parameters
    • filename - [required, string] the name of the video file to be saved to the device, expressed as a string. Video is saved using the H.264 codec and can be saved as .mov (default if not specified as a part of the filename defined through this parameter) or .mp4
    • callback - [string] the name of the callback to be triggered after the function has been executed
    • countdownTimer - [integer] the number of seconds to count down prior to recording
    • recordingTimer - [integer] the number of seconds to record video
    • recordingMessage - [string] the text to display on-screen during recording
    • showRecordingTimer - [boolean integer] defines whether to display the countdown timer on screen during recording:
      • 1 - show the timer
      • 0 - hide the timer
    • alertMessageOnSuccess - [string] the alert message displayed after a successful capture
    Callback format
    callback(success, error);
    		
    Callback return values
    • success - if defined, a video was successfully captured and saved to the Kiosk Pro document's folder
    • error - [object] the error returned when printing fails. Includes the following:
      • domain - [string] where the error occurred
      • code - [integer] the error code
      • description - [string] a description of the error
      • debugDescription - [string] a detailed description of the error

    Change Log

    • Added in version 1.3. Ability to check and set specific camera used added in version 3.4. Ability to capture photos with specific dimensions added in version 9.2. Ability to return Base64 string added in version 9.4. Ability to set the flash mode added in version 10.0. Deprecated and replaced with new functions and callbacks in version 10.3.

    Still stuck? How can we help? How can we help?