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.
In this article
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:
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:
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 |
|
Callback format | callback(base64String, error); |
Callback return values | |
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:
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:
|
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:
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
Deprecated Function:
kp_CustomAmericaPrinterAPI_setFontCharWidth
This function set the character width of the printer.
Format | kp_CustomAmericaPrinterAPI_setFontCharWidth(value, callback); |
Parameters |
|
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 |
|
Deprecated Function:
kp_CustomAmericaPrinterAPI_setFontCharHeight
This function set the character height of the printer.
Format | kp_CustomAmericaPrinterAPI_setFontCharHeight(value, callback); |
Parameters |
|
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 |
|
Deprecated Function:
kp_CustomAmericaPrinterAPI_setFontEmphasizedProperty
This function set whether the printer should print in bold font weight.
Format | kp_CustomAmericaPrinterAPI_setFontEmphasizedProperty(value, callback); |
Parameters |
|
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 |
|
Deprecated Function:
kp_CustomAmericaPrinterAPI_setFontItalicProperty
This function set whether the printer should print in italics.
Format | kp_CustomAmericaPrinterAPI_setFontItalicProperty(value, callback); |
Parameters |
|
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 |
|
Deprecated Function:
kp_CustomAmericaPrinterAPI_setFontUnderlineProperty
This function set whether the printer should print with underline.
Format | kp_CustomAmericaPrinterAPI_setFontUnderlineProperty(value, callback); |
Parameters |
|
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 |
|
Callback format | callback(errorDic, isUnderline); |
Callback return values |
|
Deprecated Function:
kp_CustomAmericaPrinterAPI_setFontJustificationProperty
This function set how the printer should justify text.
Format | kp_CustomAmericaPrinterAPI_setFontJustificationProperty(value, callback); |
Parameters |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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:
See main article for requirements for use.
Deprecated Variable Array:
window.kioskpro_location
Format | window.kioskpro_location[value]; |
Return Values |
|
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:
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:
|
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 |
|
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:
|
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 |
|
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 |
|
Callback Format | callback(success, error); |
Callback Return Values |
|
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 |
|
Callback format | callback(success, error); |
Callback return values |
|
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 |
|
Callback format | callback(success, error); |
Callback return values |
|
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 |
|
Callback format | callback(success, error); |
Callback return values |
|
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 |
|
Callback format | callback(success, error); |
Callback return values |
|
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 |
|
Callback format | callback(success, error); |
Callback return values |
|
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 |
|
Callback format | callback(success, error); |
Callback return values |
|
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.