• Learn
    • Code Lab
    • Foldables and Large Screens
    • One UI Beta
  • Develop
    • Mobile/Wearable
    • Galaxy GameDev
    • Galaxy Themes
    • Galaxy Watch
    • Health
    • Samsung Blockchain
    • Samsung DeX
    • Samsung IAP
    • Samsung Internet
    • Samsung Pay
    • Samsung Wallet
    • View All
      • Galaxy AR Emoji
      • Galaxy Accessory
      • Galaxy Edge
      • Galaxy Z
      • Galaxy Performance
      • Galaxy FM Radio
      • Galaxy S Pen Remote
      • Galaxy Sensor Extension
      • PENUP
      • Samsung Automation
      • Samsung Neural
      • Samsung TEEGRIS
      • Samsung eSE SDK
      • Galaxy Watch for Tizen
      • Watch Face Studio
      • One UI Watch for Tizen
      • Galaxy Watch Studio Converter
      • Samsung IAP for Galaxy Watch (Tizen)
    • Visual Display
    • Smart TV
    • Smart Hospitality Display
    • Smart Signage
    • Digital Appliance
    • Family Hub
    • Platform
    • Bixby
    • Knox
    • SmartThings
    • Tizen.NET
  • Design
    • Design System
    • One UI
    • One UI Watch
    • Smart TV
  • Distribute
    • Galaxy Store
    • TV Seller Office
    • Galaxy Store Games
    • Instant Plays
  • Support
    • Developer Support
    • Remote Test Lab
    • Samsung Android USB Driver
    • Galaxy Emulator Skin
  • Connect
    • Blog
    • News
    • Forums
    • Events
    • Samsung Developer Conference
    • SDC23
    • SDC22
    • SDC21
    • SDC19 and Previous Events
  • Sign In
Top Global Search Form
Recommendation
  • Blog
  • Code Lab
  • Foldable and Large Screen Optimization
  • Forums
  • Galaxy Emulator Skin
  • Galaxy GameDev
  • Health
  • Remote Test Lab
  • SDC22
  • Watch Face Studio
All Search Form
Recommendation
    Suggestion
      All Search Form
      Filter
      Filter
      Filter
      • ALL
      • DOCS
      • SDK
      • API REFERENCE (2)
      • CODE LAB
      • BLOG
      • NEWS/EVENTS
      • API REFERENCE
        api reference code lab blog news/events
      1. Develop
      2. Samsung Pay

      api

      SpaySdk

      overview package class tree index help package com.samsung.android.sdk.samsungpay.v2 class spaysdk java.lang.object com.samsung.android.sdk.samsungpay.v2.spaysdk direct known subclasses: cardmanager, paymentmanager public abstract class spaysdk extends object this class allows to define samsung pay sdk information, common error codes, and constants. since: api level 1.1 nested class summary nested classes modifier and type class description static enum spaysdk.brand this enumeration provides sdk supported card brands such as american express, mastercard, visa, discover, china unionpay, octopus, eci and pagobancomat. static enum spaysdk.servicetype this enumeration provides service types. partners must set their service type in the partnerinfo when they call any apis. field summary fields modifier and type field description static final string common_status_table this table shows the status codes used commonly. status bundle keys bundle values spay_not_supported (0) extra_error_reason error_device_not_samsung (-350) error_spay_pkg_not_found (-351) error_spay_sdk_service_not_available (-352) error_device_integrity_check_fail (-353) error_spay_app_integrity_check_fail (-360) error_android_platform_check_fail (-361) spay_not_ready (1) extra_error_reason error_spay_setup_not_completed (-356) error_spay_app_need_to_update (-357) error_spay_internal (-1) extra_error_reason error_server_internal (-311) n/a n/a error_not_allowed (-6) extra_error_reason error_invalid_parameter (-12) error_sdk_not_supported_for_this_region (-300) error_service_id_invalid (-301) error_service_unavailable_for_this_region (-302) error_partner_app_signature_mismatch (-303) error_partner_app_version_not_supported (-304) error_partner_app_blocked (-305) error_user_not_registered_for_debug (-306) error_service_not_approved_for_release (-307) error_partner_not_approved (-308) error_unauthorized_request_type (-309) error_expired_or_invalid_debug_key (-310) error_missing_information (-354) error_unable_to_verify_caller (-359) error_invalid_parameter (-12) n/a n/a error_no_network (-21) n/a n/a error_server_no_response (-22) n/a n/a error_partner_info_invalid (-99) extra_error_reason error_partner_sdk_api_level (-10) error_partner_service_type (-11) error_partner_sdk_version_not_allowed (-358) error_initiation_fail (-103) n/a n/a spay_not_allowed_temporally (3) extra_error_reason error_spay_connected_with_external_display (-605) error_spay_fmm_lock (-604) n/a n/a paymentmanager.error_making_sheet_failed (-115) n/a n/a static final string cryptogram_type_icc key to represent the icc cryptogram type of mastercard. static final string cryptogram_type_ucaf key to represent the ucaf cryptogram type of mastercard. static final string device_id key to represent unique device id. static final string device_type_gear device type is gear. static final string device_type_phone device type is phone. static final int error_android_platform_check_fail this error indicates that android platform version check has failed. for in-app payment, the samsung pay sdk requires android 6.0(m) (android api level 23) or later versions of the android os. this is returned as extra_error_reason for spay_not_supported error. static final int error_device_integrity_check_fail this error indicates that device integrity check has failed. this is returned as extra_error_reason for spay_not_supported error. static final int error_device_not_samsung this error indicates that the device is not a samsung device. this is returned as extra_error_reason for spay_not_supported error. static final int error_duplicated_sdk_api_called this error indicates that duplicate api called by partner. static final int error_expired_or_invalid_debug_key this error indicates that debug key is invalid or expired. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app uses expired debug-api-key, then the partner app verification will be failed. static final int error_initiation_fail this error indicates that session initiation or service binding has failed. for example, if the service connection with samsung pay was not successful. static final int error_invalid_parameter this error indicates that requested operation contains invalid parameter or invalid bundle key/value. static final int error_missing_information this error indicates that some information of partner is missing. this error code is returned as an extra_error_reason of error_not_allowed error. for example, if the partner app does not deliver a required information to samsung pay to get the wallet information, then samsung pay will send this error to partner app. also if the partner does not define the issuer name in samsung pay developer portal, samsung pay will send this error to partner app. static final int error_no_network this error indicates that samsung pay is unable to connect to the server since there is no network. for example, partner app tries to verify with server while network is not connected. static final int error_none this error indicates that requested operation is success with no error. static final int error_not_allowed this error indicates that requested operation is not allowed. for example, partner app verification has failed in samsung pay server. static final int error_not_found this error indicates that given card id is not found in samsung pay. static final int error_not_supported this error indicates that requested operation is not supported in samsung pay. static final int error_partner_app_blocked this error indicates that partner app version is removed/blocked by the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app is blocked, then the partner app verification will be failed. static final int error_partner_app_signature_mismatch this error indicates that the app signature is different from the one registered from samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if different signature is used for signing apk, the partner app verification will be failed. checking signature logic will be activated in case debug mode is "n". static final int error_partner_app_version_not_supported this error indicates that app version is not supported by samsung pay. this is returned as extra_error_reason for error_not_allowed error. for example, if the version registered from developer portal is higher than current version(or no any version registered), then the partner app verification will be failed. static final int error_partner_info_invalid this error indicates that partner information is invalid. for example, partner app is using sdk version not allowed, invalid service type, wrong api level, and so on. static final int error_partner_not_approved this error indicates that partner registration is not done on the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app is submitted but not approved, then the partner app verification will be failed. static final int error_partner_sdk_api_level this error indicates that sdk api level is missing or invalid. partner must set valid api level in the androidmanifest file. static final int error_partner_sdk_version_not_allowed this error indicates that the partner app is using samsung pay sdk not allowed. this is returned as extra_error_reason for error_partner_info_invalid error. static final int error_partner_service_type this error indicates that the service type is invalid. partner must set valid service type in partnerinfo when calling apis. this is returned as extra_error_reason for spay_not_ready error. static final int error_registration_fail this error indicates that the card provisioning has failed. static final int error_sdk_not_supported_for_this_region this error indicates that the samsung pay sdk is not supported in particular region. this is returned as extra_error_reason for error_not_allowed error. for example, if the device is from the country that samsung pay sdk is not supported, then the partner app verification will be failed. static final int error_server_internal this error indicates that server fails to proceed request due to unknown internal error. this is returned as extra_error_reason for error_spay_internal error. for example, if the server error occurred while the partner verification is going on, then the partner app verification will be failed. static final int error_server_no_response this error indicates that server did not respond to the samsung pay request. static final int error_service_id_invalid this error indicates that service id is not registered with the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if invalid service id was used in partner app, then the partner app verification will be failed. static final int error_service_not_approved_for_release this error indicates that service version is not approved for release by the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app is not registered for release mode, then the partner app verification will be failed. static final int error_service_unavailable_for_this_region this error indicates that sdk support is not available for partner's service in particular region. static final int error_spay_app_integrity_check_fail this error indicates that samsung pay app integrity check has failed. this is returned as extra_error_reason for spay_not_supported error. static final int error_spay_app_need_to_update this error indicates that the samsung pay should be updated. partner app need to ask user to update samsung pay app. static final int error_spay_connected_with_external_display this error indicates that device is connected with an external display. due to security reason, samsung pay cannot be launched at this moment. in this case, partner can guide user to disconnect any external display if connected. static final int error_spay_fmm_lock this error indicates that device is locked due to fmm(find my mobile). partner app needs to ask user to unlock the samsung pay app. static final int error_spay_internal this error indicates that internal error has occurred while the requested operation is going on. static final int error_spay_pkg_not_found this error indicates that the samsung pay application is not on the device. this is returned as extra_error_reason for spay_not_supported error. this could mean that the device does not support samsung pay. static final int error_spay_sdk_service_not_available this error indicates that sdk service is not available on this device. this is returned as extra_error_reason for spay_not_supported error. static final int error_spay_setup_not_completed this error indicates that the samsung pay setup was not completed. partner app need to ask user to set up samsung pay app. static final int error_unable_to_verify_caller this error indicates that samsung pay is unable to verify partner app at this moment. this is returned as extra_error_reason for error_not_allowed error. for example, samsung pay tried to connect to the server and validate partner id, but the device does not have the network connectivity. static final int error_unauthorized_request_type this error indicates that the partner is not authorized for this request type such as payment or enrollment. this is returned as extra_error_reason for error_not_allowed error. for example, if the merchant app calls enrollment api, then the partner app verification will be failed. static final int error_user_canceled this error indicates that user has cancelled before completing the requested operation. for example, user taps the cancel or back key on the payment sheet. static final int error_user_not_registered_for_debug this error indicates that user account is not registered for using debug mode on the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app is in debug mode but the samsung account is not registered for the debug-api-key, then the partner app verification will be failed. static final string extra_accept_combo_card key to represent that a merchant accepts combo card. partner can use this key to let customers to choose debit/credit in case of combo card. static final string extra_card_type key to represent card type. the possible values are: card.card_type_credit_debit card.card_type_credit card.card_type_debit card.card_type_gift card.card_type_loyalty card.card_type_transit static final string extra_country_code key to represent country code. device country code(iso 3166-1 alpha-2) static final string extra_cpf_holder_name key to get cpf holder name in extra payment data. when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager.customsheettransactioninfolistener.onsuccess(com.samsung.android.sdk.samsungpay.v2.payment.customsheetpaymentinfo, java.lang.string, android.os.bundle) callback static final string extra_cpf_number key to get cpf number in extra payment data. when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager.customsheettransactioninfolistener.onsuccess(com.samsung.android.sdk.samsungpay.v2.payment.customsheetpaymentinfo, java.lang.string, android.os.bundle) callback static final string extra_cryptogram_type key to represent the dsrp (digital secure remote payments) cryptogram type of mastercard. static final string extra_device_card_limit_reached key to represent the maximum registered card number has reached or not. static final string extra_device_type key to represent type of the device (mobile or gear). static final string extra_error_reason key to represent extra error reasons. static final string extra_error_reason_message key to represent extra error reason messages. static final string extra_issuer_name key to represent name of the issuer. this key can be used in the bundle for partnerinfo(string, bundle). static final string extra_issuer_pkgname key to represent package name of the issuer app on android. static final string extra_last4_dpan key to represent the last four digits of digitalized personal identification number (dpan). static final string extra_last4_fpan key to represent the last four digits of funding personal identification number (fpan). static final string extra_member_id key to represent member id of the issuer. this is for korean issuers only. static final string extra_merchant_ref_id key to set/get merchant reference id beyond marketplace app or service(i.e. static final string extra_partner_name key to represent name of the partner app. this key can be used in the bundle for partnerinfo(string, bundle). static final string extra_request_id key to represent request id. when a request is failed, tr will send this key to partner app. static final string extra_require_cpf key to represent that a partner requires cpf. partner can use this key to ask samsung pay to show cpf information in the payment sheet. static final string extra_resolved_1 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. static final string extra_resolved_2 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. static final string extra_resolved_3 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. static final string extra_resolved_4 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. static final string extra_resolved_5 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. static final string extra_resolved_6 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. static final string extra_resolved_7 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. static final string partner_service_type key to represent unique service type. this key must be set in the bundle for partnerinfo(string, bundle). static final int spay_has_no_transit_card this code is returned if samsung pay doesn't have a registered transit card this is for korean issuers only. static final int spay_has_transit_card this code is returned if samsung pay has a registered transit card. this is for korean issuers only. static final int spay_not_allowed_temporally samsung pay is not allowed temporally. refer extra reason delivered with extra_error_reason. static final int spay_not_ready samsung pay is not completely activated. usually, this status code is returned if the user did not complete the mandatory update or if the user is not signed in with the samsung account yet. in this case, partner app can call samsungpay.activatesamsungpay() api to launch samsung pay or can call samsungpay.gotoupdatepage() api to update samsung pay app. static final int spay_not_supported samsung pay is not supported on this device. usually, this status code is returned if the device is not compatible to run samsung pay or if the samsung pay app is not installed. static final int spay_ready samsung pay is activated and ready to use. usually, this status code is returned after user completes all the mandatory updates and is signed in. static final string wallet_dm_id key to represent unique device management id. static final string wallet_user_id key to represent user's wallet id. method summary all methodsstatic methodsconcrete methods modifier and type method description static int getversioncode() returns the version code of the samsung pay sdk. static string getversionname() returns the version name of the samsung pay sdk. methods inherited from class java.lang.object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details error_none public static final int error_none this error indicates that requested operation is success with no error. see also: constant field values error_spay_internal public static final int error_spay_internal this error indicates that internal error has occurred while the requested operation is going on. see also: constant field values error_not_supported public static final int error_not_supported this error indicates that requested operation is not supported in samsung pay. see also: constant field values error_not_found public static final int error_not_found this error indicates that given card id is not found in samsung pay. see also: constant field values error_not_allowed public static final int error_not_allowed this error indicates that requested operation is not allowed. for example, partner app verification has failed in samsung pay server. see also: constant field values error_user_canceled public static final int error_user_canceled this error indicates that user has cancelled before completing the requested operation. for example, user taps the cancel or back key on the payment sheet. see also: constant field values error_partner_sdk_api_level public static final int error_partner_sdk_api_level this error indicates that sdk api level is missing or invalid. partner must set valid api level in the androidmanifest file. minimum possible version is 1.4. also if the partner set the values defined in higher api level, samsung pay will send this error to partner app. this is returned as extra_error_reason for error_partner_info_invalid error. since: api level 1.4 see also: constant field values error_partner_service_type public static final int error_partner_service_type this error indicates that the service type is invalid. partner must set valid service type in partnerinfo when calling apis. this is returned as extra_error_reason for spay_not_ready error. since: api level 1.4 see also: constant field values error_invalid_parameter public static final int error_invalid_parameter this error indicates that requested operation contains invalid parameter or invalid bundle key/value. since: api level 2.3 see also: constant field values error_no_network public static final int error_no_network this error indicates that samsung pay is unable to connect to the server since there is no network. for example, partner app tries to verify with server while network is not connected. see also: constant field values error_server_no_response public static final int error_server_no_response this error indicates that server did not respond to the samsung pay request. see also: constant field values error_partner_info_invalid public static final int error_partner_info_invalid this error indicates that partner information is invalid. for example, partner app is using sdk version not allowed, invalid service type, wrong api level, and so on. since: api level 2.5 see also: constant field values error_initiation_fail public static final int error_initiation_fail this error indicates that session initiation or service binding has failed. for example, if the service connection with samsung pay was not successful. see also: constant field values error_registration_fail public static final int error_registration_fail this error indicates that the card provisioning has failed. since: api level 1.2 see also: constant field values error_duplicated_sdk_api_called public static final int error_duplicated_sdk_api_called this error indicates that duplicate api called by partner. since: api level 2.1 see also: constant field values error_sdk_not_supported_for_this_region public static final int error_sdk_not_supported_for_this_region this error indicates that the samsung pay sdk is not supported in particular region. this is returned as extra_error_reason for error_not_allowed error. for example, if the device is from the country that samsung pay sdk is not supported, then the partner app verification will be failed. see also: constant field values error_service_id_invalid public static final int error_service_id_invalid this error indicates that service id is not registered with the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if invalid service id was used in partner app, then the partner app verification will be failed. since: api level 2.5 see also: constant field values error_service_unavailable_for_this_region public static final int error_service_unavailable_for_this_region this error indicates that sdk support is not available for partner's service in particular region. since: api level 2.5 see also: constant field values error_partner_app_signature_mismatch public static final int error_partner_app_signature_mismatch this error indicates that the app signature is different from the one registered from samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if different signature is used for signing apk, the partner app verification will be failed. checking signature logic will be activated in case debug mode is "n". since: api level 2.9 see also: constant field values error_partner_app_version_not_supported public static final int error_partner_app_version_not_supported this error indicates that app version is not supported by samsung pay. this is returned as extra_error_reason for error_not_allowed error. for example, if the version registered from developer portal is higher than current version(or no any version registered), then the partner app verification will be failed. since: api level 2.9 see also: constant field values error_partner_app_blocked public static final int error_partner_app_blocked this error indicates that partner app version is removed/blocked by the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app is blocked, then the partner app verification will be failed. since: api level 2.9 see also: constant field values error_user_not_registered_for_debug public static final int error_user_not_registered_for_debug this error indicates that user account is not registered for using debug mode on the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app is in debug mode but the samsung account is not registered for the debug-api-key, then the partner app verification will be failed. see also: constant field values error_service_not_approved_for_release public static final int error_service_not_approved_for_release this error indicates that service version is not approved for release by the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app is not registered for release mode, then the partner app verification will be failed. since: api level 2.5 see also: constant field values error_partner_not_approved public static final int error_partner_not_approved this error indicates that partner registration is not done on the samsung pay developers. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app is submitted but not approved, then the partner app verification will be failed. see also: constant field values error_unauthorized_request_type public static final int error_unauthorized_request_type this error indicates that the partner is not authorized for this request type such as payment or enrollment. this is returned as extra_error_reason for error_not_allowed error. for example, if the merchant app calls enrollment api, then the partner app verification will be failed. see also: constant field values error_expired_or_invalid_debug_key public static final int error_expired_or_invalid_debug_key this error indicates that debug key is invalid or expired. this is returned as extra_error_reason for error_not_allowed error. for example, if the partner app uses expired debug-api-key, then the partner app verification will be failed. see also: constant field values error_server_internal public static final int error_server_internal this error indicates that server fails to proceed request due to unknown internal error. this is returned as extra_error_reason for error_spay_internal error. for example, if the server error occurred while the partner verification is going on, then the partner app verification will be failed. since: api level 2.5 see also: constant field values error_device_not_samsung public static final int error_device_not_samsung this error indicates that the device is not a samsung device. this is returned as extra_error_reason for spay_not_supported error. see also: constant field values error_spay_pkg_not_found public static final int error_spay_pkg_not_found this error indicates that the samsung pay application is not on the device. this is returned as extra_error_reason for spay_not_supported error. this could mean that the device does not support samsung pay. see also: constant field values error_spay_sdk_service_not_available public static final int error_spay_sdk_service_not_available this error indicates that sdk service is not available on this device. this is returned as extra_error_reason for spay_not_supported error. see also: constant field values error_device_integrity_check_fail public static final int error_device_integrity_check_fail this error indicates that device integrity check has failed. this is returned as extra_error_reason for spay_not_supported error. see also: constant field values error_spay_app_integrity_check_fail public static final int error_spay_app_integrity_check_fail this error indicates that samsung pay app integrity check has failed. this is returned as extra_error_reason for spay_not_supported error. see also: constant field values error_android_platform_check_fail public static final int error_android_platform_check_fail this error indicates that android platform version check has failed. for in-app payment, the samsung pay sdk requires android 6.0(m) (android api level 23) or later versions of the android os. this is returned as extra_error_reason for spay_not_supported error. since: api level 1.5 see also: constant field values error_missing_information public static final int error_missing_information this error indicates that some information of partner is missing. this error code is returned as an extra_error_reason of error_not_allowed error. for example, if the partner app does not deliver a required information to samsung pay to get the wallet information, then samsung pay will send this error to partner app. also if the partner does not define the issuer name in samsung pay developer portal, samsung pay will send this error to partner app. see also: constant field values error_spay_setup_not_completed public static final int error_spay_setup_not_completed this error indicates that the samsung pay setup was not completed. partner app need to ask user to set up samsung pay app. if user agrees, call samsungpay.activatesamsungpay() api . this is returned as extra_error_reason for spay_not_ready error. see also: constant field values error_spay_app_need_to_update public static final int error_spay_app_need_to_update this error indicates that the samsung pay should be updated. partner app need to ask user to update samsung pay app. if user agrees, call samsungpay.gotoupdatepage() api. this is returned as extra_error_reason for spay_not_ready error. since: api level 1.1 see also: constant field values error_partner_sdk_version_not_allowed public static final int error_partner_sdk_version_not_allowed this error indicates that the partner app is using samsung pay sdk not allowed. this is returned as extra_error_reason for error_partner_info_invalid error. since: api level 2.5 see also: constant field values error_unable_to_verify_caller public static final int error_unable_to_verify_caller this error indicates that samsung pay is unable to verify partner app at this moment. this is returned as extra_error_reason for error_not_allowed error. for example, samsung pay tried to connect to the server and validate partner id, but the device does not have the network connectivity. see also: constant field values error_spay_fmm_lock public static final int error_spay_fmm_lock this error indicates that device is locked due to fmm(find my mobile). partner app needs to ask user to unlock the samsung pay app. if user agrees, call samsungpay.activatesamsungpay() to unlock the samsung pay app. since: api level 2.1 see also: samsungpay.activatesamsungpay() constant field values error_spay_connected_with_external_display public static final int error_spay_connected_with_external_display this error indicates that device is connected with an external display. due to security reason, samsung pay cannot be launched at this moment. in this case, partner can guide user to disconnect any external display if connected. since: api level 2.7 see also: constant field values spay_not_supported public static final int spay_not_supported samsung pay is not supported on this device. usually, this status code is returned if the device is not compatible to run samsung pay or if the samsung pay app is not installed. since: api level 1.1 see also: constant field values spay_not_ready public static final int spay_not_ready samsung pay is not completely activated. usually, this status code is returned if the user did not complete the mandatory update or if the user is not signed in with the samsung account yet. in this case, partner app can call samsungpay.activatesamsungpay() api to launch samsung pay or can call samsungpay.gotoupdatepage() api to update samsung pay app. since: api level 1.1 see also: constant field values spay_ready public static final int spay_ready samsung pay is activated and ready to use. usually, this status code is returned after user completes all the mandatory updates and is signed in. since: api level 1.1 see also: constant field values spay_not_allowed_temporally public static final int spay_not_allowed_temporally samsung pay is not allowed temporally. refer extra reason delivered with extra_error_reason. since: api level 2.7 see also: constant field values spay_has_transit_card public static final int spay_has_transit_card this code is returned if samsung pay has a registered transit card. this is for korean issuers only. since: api level 2.8 see also: constant field values spay_has_no_transit_card public static final int spay_has_no_transit_card this code is returned if samsung pay doesn't have a registered transit card this is for korean issuers only. since: api level 2.8 see also: constant field values device_type_phone public static final string device_type_phone device type is phone. since: api level 1.1 see also: constant field values device_type_gear public static final string device_type_gear device type is gear. since: api level 1.1 see also: constant field values extra_last4_dpan public static final string extra_last4_dpan key to represent the last four digits of digitalized personal identification number (dpan). since: api level 1.1 see also: constant field values extra_last4_fpan public static final string extra_last4_fpan key to represent the last four digits of funding personal identification number (fpan). since: api level 1.1 see also: constant field values extra_issuer_name public static final string extra_issuer_name key to represent name of the issuer. this key can be used in the bundle for partnerinfo(string, bundle). since: api level 1.1 see also: constant field values extra_issuer_pkgname public static final string extra_issuer_pkgname key to represent package name of the issuer app on android. since: api level 1.1 see also: constant field values extra_partner_name public static final string extra_partner_name key to represent name of the partner app. this key can be used in the bundle for partnerinfo(string, bundle). since: api level 2.6 see also: constant field values extra_error_reason public static final string extra_error_reason key to represent extra error reasons. since: api level 1.1 see also: constant field values extra_error_reason_message public static final string extra_error_reason_message key to represent extra error reason messages. since: api level 2.9 see also: constant field values extra_card_type public static final string extra_card_type key to represent card type. the possible values are: card.card_type_credit_debit card.card_type_credit card.card_type_debit card.card_type_gift card.card_type_loyalty card.card_type_transit since: api level 1.1 see also: constant field values extra_device_type public static final string extra_device_type key to represent type of the device (mobile or gear). the possible values are: device_type_phone device_type_gear since: api level 1.1 see also: constant field values extra_member_id public static final string extra_member_id key to represent member id of the issuer. this is for korean issuers only. since: api level 1.1 see also: constant field values extra_country_code public static final string extra_country_code key to represent country code. device country code(iso 3166-1 alpha-2) since: api level 1.1 see also: constant field values extra_device_card_limit_reached public static final string extra_device_card_limit_reached key to represent the maximum registered card number has reached or not. since: api level 1.1 see also: constant field values extra_cryptogram_type public static final string extra_cryptogram_type key to represent the dsrp (digital secure remote payments) cryptogram type of mastercard. cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo. since: api level 2.4 see also: constant field values extra_resolved_1 public static final string extra_resolved_1 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. since: api level 2.4 see also: constant field values extra_resolved_2 public static final string extra_resolved_2 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. since: api level 2.4 see also: constant field values extra_resolved_3 public static final string extra_resolved_3 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. since: api level 2.4 see also: constant field values extra_resolved_4 public static final string extra_resolved_4 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. since: api level 2.4 see also: constant field values extra_resolved_5 public static final string extra_resolved_5 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. since: api level 2.4 see also: constant field values extra_resolved_6 public static final string extra_resolved_6 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. since: api level 2.4 see also: constant field values extra_resolved_7 public static final string extra_resolved_7 key to represent additional data. partner can use this key to put tagged data to a bundle before sending to samsung pay. since: api level 2.4 see also: constant field values extra_request_id public static final string extra_request_id key to represent request id. when a request is failed, tr will send this key to partner app. request id would be helpful for debugging a failed request between partner and tr. since: api level 2.5 see also: constant field values cryptogram_type_ucaf public static final string cryptogram_type_ucaf key to represent the ucaf cryptogram type of mastercard. ucaf cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo. ucaf is a default cryptogram type if not specified in the extrapaymentinfo bundle. since: api level 2.4 see also: constant field values cryptogram_type_icc public static final string cryptogram_type_icc key to represent the icc cryptogram type of mastercard. icc cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo. since: api level 2.4 see also: constant field values extra_accept_combo_card public static final string extra_accept_combo_card key to represent that a merchant accepts combo card. partner can use this key to let customers to choose debit/credit in case of combo card. it can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo. the possible value is the boolean. since: api level 2.9 see also: constant field values extra_require_cpf public static final string extra_require_cpf key to represent that a partner requires cpf. partner can use this key to ask samsung pay to show cpf information in the payment sheet. it can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo. the possible value is the boolean. this is for brazil partners only. since: api level 2.11 see also: constant field values extra_cpf_holder_name public static final string extra_cpf_holder_name key to get cpf holder name in extra payment data. when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager.customsheettransactioninfolistener.onsuccess(com.samsung.android.sdk.samsungpay.v2.payment.customsheetpaymentinfo, java.lang.string, android.os.bundle) callback since: api level 2.11 see also: constant field values extra_cpf_number public static final string extra_cpf_number key to get cpf number in extra payment data. when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager.customsheettransactioninfolistener.onsuccess(com.samsung.android.sdk.samsungpay.v2.payment.customsheetpaymentinfo, java.lang.string, android.os.bundle) callback since: api level 2.11 see also: constant field values extra_merchant_ref_id public static final string extra_merchant_ref_id key to set/get merchant reference id beyond marketplace app or service(i.e. bixby). when marketplace apps request in-app payment, they can set merchant reference id so that samsung pay app can get detail information about the merchant using the id. since: api level 2.11 see also: constant field values wallet_user_id public static final string wallet_user_id key to represent user's wallet id. since: api level 1.2 see also: constant field values device_id public static final string device_id key to represent unique device id. since: api level 1.2 see also: constant field values wallet_dm_id public static final string wallet_dm_id key to represent unique device management id. since: api level 1.2 see also: constant field values partner_service_type public static final string partner_service_type key to represent unique service type. this key must be set in the bundle for partnerinfo(string, bundle). since: api level 1.4 see also: constant field values common_status_table public static final string common_status_table this table shows the status codes used commonly. status bundle keys bundle values spay_not_supported (0) extra_error_reason error_device_not_samsung (-350) error_spay_pkg_not_found (-351) error_spay_sdk_service_not_available (-352) error_device_integrity_check_fail (-353) error_spay_app_integrity_check_fail (-360) error_android_platform_check_fail (-361) spay_not_ready (1) extra_error_reason error_spay_setup_not_completed (-356) error_spay_app_need_to_update (-357) error_spay_internal (-1) extra_error_reason error_server_internal (-311) n/a n/a error_not_allowed (-6) extra_error_reason error_invalid_parameter (-12) error_sdk_not_supported_for_this_region (-300) error_service_id_invalid (-301) error_service_unavailable_for_this_region (-302) error_partner_app_signature_mismatch (-303) error_partner_app_version_not_supported (-304) error_partner_app_blocked (-305) error_user_not_registered_for_debug (-306) error_service_not_approved_for_release (-307) error_partner_not_approved (-308) error_unauthorized_request_type (-309) error_expired_or_invalid_debug_key (-310) error_missing_information (-354) error_unable_to_verify_caller (-359) error_invalid_parameter (-12) n/a n/a error_no_network (-21) n/a n/a error_server_no_response (-22) n/a n/a error_partner_info_invalid (-99) extra_error_reason error_partner_sdk_api_level (-10) error_partner_service_type (-11) error_partner_sdk_version_not_allowed (-358) error_initiation_fail (-103) n/a n/a spay_not_allowed_temporally (3) extra_error_reason error_spay_connected_with_external_display (-605) error_spay_fmm_lock (-604) n/a n/a paymentmanager.error_making_sheet_failed (-115) n/a n/a see also: constant field values method details getversioncode public static int getversioncode() returns the version code of the samsung pay sdk. returns: sdk version code. since: api level 1.1 getversionname public static string getversionname() returns the version name of the samsung pay sdk. returns: sdk version name. since: api level 1.1 samsung electronics.samsung pay sdk 2.18.00 - aug 25 2023

      https://developer.samsung.com/pay/api-reference/com/samsung/android/sdk/samsungpay/v2/SpaySdk.html
      1. Develop
      2. Smart TV

      api

      VoiceInteraction API

      voiceinteraction api to use samsung product api, <script type="text/javascript" src="$webapis/webapis/webapis.js"></script> should be loaded in index.html samsung tvs allow developers to use voice commands such as navigation, search, selection and media control to control their application. the voice assistant in the tv can be bixby or other assistants. regardless of which assistant is used, the application will interact with it via the voice interaction apis. for best results, we recommend the application to be implemented with all the features that are described in this document. since : 6.0 product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol summary of interfaces and methods interface method voiceinteractionmanagerobject voiceinteractioncallback optional voiceapplicationstate onupdatestate();optional boolean onnavigation(voicenavigation voicenavigation);optional boolean onsearch(voicesearchterm voicesearchterm);optional boolean onplay();optional boolean onstop();optional boolean onpause();optional boolean onexit();optional boolean onselection(long voiceselection);optional boolean ontitleselection(domstring title);optional boolean onfastforward();optional boolean onrewind();optional domstring onsearchcollection(voicesearchterm voicesearchterm);optional boolean onchangeappstate(voiceapplicationstate state);optional boolean onchangeprevioustrack();optional boolean onchangenexttrack();optional boolean onrestart();optional boolean onskipbackward(long offsetseconds);optional boolean onskipforward(long offsetseconds);optional boolean onsetplayposition(long position);optional boolean onchangesubtitlemode(mediafunctionmode mode);optional boolean onchangeshufflemode(mediafunctionmode mode);optional boolean onchangescreenfitmode(mediafunctionmode mode);optional boolean onzoom(mediazoommode zoom);optional boolean onrotate(mediarotatemode direction);optional boolean onchange360mode(mediafunctionmode mode);optional boolean onchangerepeatmode(mediarepeatmode mode);optional boolean oncontinuewatching();optional boolean oncustom(domstring jsonobjectstring);optional domstring onrequestcontentcontext();optional boolean onadditiontolist(listitem list);optional boolean onremovalfromlist(listitem list); voicesearchterm voiceinteractioncontentcontext voiceinteractionmanager domstring getversion();void setcallback(voiceinteractioncallback callback);void listen();domstring getdatafromsearchterm(voicesearchterm voicesearchterm, voicesearchtermfield field);domstring buildcollectiondeeplinkdata(domstring appid, domstring title, domstring payload);domstring buildcollectionshowdata(domstring appid, domstring title, domstring payload, domstring thumbnail);voiceinteractioncontentcontext buildvoiceinteractioncontentcontextitem(long positionx, long positiony, domstring title, domstring[] aliasarr, boolean bfocused);domstring buildvoiceinteractioncontentcontextresponse(voiceinteractioncontentcontext[] contentcontextarr); 1. type definitions 1.1 voiceapplicationstate the application status handled via voice interaction. enum voiceapplicationstate { "none", "home", "list", "player", "setting", "search", "unknown" }; the following values are supported none : application default status. home : the status of application's home. list : the status of application showing something in list. player : the status of application playing something. setting : the status of application showing its setting. search : the status of application searching its content. unknown : the status of unknown. 1.2 voicenavigation the navigation via voice interaction. enum voicenavigation { "nav_previous", "nav_next", "nav_left", "nav_right", "nav_up", "nav_down", "nav_show_more", "nav_unknown" }; the following values are supported nav_previous : the navigation for the previous page. nav_next : the navigation for the next page. nav_left : the navigation for the left item. nav_right : the navigation for the right item. nav_up : the navigation for the upper item. nav_down : the navigation for the down item. nav_show_more : the navigation for the detail page. nav_unknown : the navigation for unknown. 1.3 voicesearchtermfield defines the fields which can be delivered via voice search. enum voicesearchtermfield { "search_term_utterance", "search_term_title", "search_term_genre", "search_term_cast", "search_term_content_type", "search_term_release_date_from", "search_term_release_date_to" }; the following values are supported search_term_utterance : the field for the full utterance. search_term_title : the field for the title. search_term_genre : the field for the genre. search_term_cast : the field for the cast. search_term_content_type : the field for the content type (movie/tvshow). search_term_release_date_from : the field for the start date time(iso 8601). search_term_release_date_to : the field for the end date time(iso 8601). 1.4 mediafunctionmode enum for the param of media control function mode. enum mediafunctionmode { "media_function_on", "media_function_off" }; the following values are supported media_function_on : media function mode on. media_function_off : media function mode off. 1.5 mediarotatemode enum for the param of rotate. enum mediarotatemode { "media_rotate_left", "media_rotate_right" }; the following values are supported media_rotate_left : media rotate mode left. media_rotate_right : media rotate mode right. 1.6 mediazoommode enum for the param of zoom. enum mediazoommode { "media_zoom_in", "media_zoom_out" }; the following values are supported media_zoom_in : media zoom mode in. media_zoom_out : media zoom mode out. 1.7 mediarepeatmode enum for the param of media repeat. enum mediarepeatmode { "media_repeat_off", "media_repeat_one", "media_repeat_all" }; the following values are supported media_repeat_off : media repeat mode off. media_repeat_one : media repeat mode for one track. media_repeat_all : media repeat mode for all tracks. 1.8 listitem enum for the param of list item. enum listitem { "list_bookmarks", "list_watch_later", "list_unknown" }; the following values are supported list_bookmarks : bookmarks list_watch_later : watchlater list_unknown : unknown 2. interfaces 2.1 voiceinteractionmanagerobject the voiceinteractionmanagerobject interface defines what is instantiated by the webapis object from the tizen platform. there will be a webapis.voiceinteraction object that allows access to the functionality of the voice interaction api. to use the voice interaction api, the following privileges must be declared in the manifest file of the application. if they are not declared, all usage of these apis are blocked, and security exceptions are thrown. to use these privileges, the minimum ‘required_version’ is 6.0. [nointerfaceobject] interface voiceinteractionmanagerobject { readonly attribute voiceinteractionmanager voiceinteraction; }; webapi implements voiceinteractionmanagerobject; since : 6.0 attributes readonly voiceinteractionmanager voiceinteraction this attribute defines the namespace for voiceinteraction apis. 2.2 voiceinteractioncallback every voice interaction application should implement a callback function, so that the assistant can operate the controls. your application can interact with voice assistant by passing the callbacks in webapis.voiceinteraction.setcallback and calling webapis.voiceinteraction.listen. except onupdatestate, onsearchcollection callbacks, the return value for the callback is the boolean flag for support or not. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. [callback, nointerfaceobject] interface voiceinteractioncallback { optional voiceapplicationstate onupdatestate(); optional boolean onnavigation(voicenavigation voicenavigation); optional boolean onsearch(voicesearchterm voicesearchterm); optional boolean onplay(); optional boolean onstop(); optional boolean onpause(); optional boolean onexit(); optional boolean onselection(long voiceselection); optional boolean ontitleselection(domstring title); optional boolean onfastforward(); optional boolean onrewind(); optional domstring onsearchcollection(voicesearchterm voicesearchterm); optional boolean onchangeappstate(voiceapplicationstate state); optional boolean onchangeprevioustrack(); optional boolean onchangenexttrack(); optional boolean onrestart(); optional boolean onskipbackward(long offsetseconds); optional boolean onskipforward(long offsetseconds); optional boolean onsetplayposition(long position); optional boolean onchangesubtitlemode(mediafunctionmode mode); optional boolean onchangeshufflemode(mediafunctionmode mode); optional boolean onchangescreenfitmode(mediafunctionmode mode); optional boolean onzoom(mediazoommode zoom); optional boolean onrotate(mediarotatemode direction); optional boolean onchange360mode(mediafunctionmode mode); optional boolean onchangerepeatmode(mediarepeatmode mode); optional boolean oncontinuewatching(); optional boolean oncustom(domstring jsonobjectstring); optional domstring onrequestcontentcontext(); optional boolean onadditiontolist(listitem list); optional boolean onremovalfromlist(listitem list); }; since : 6.0 methods onupdatestate developers must specify the current application status to the onupdatestate function to get a proper voice control from the voice assistant. this function is called right before processing every utterance, so that the voice assistant can be aware of the application status dynamically. depending on the status, the callback function called could be different. therefore, it is important to return the real status of the application. optional voiceapplicationstate onupdatestate(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional voiceapplicationstate : the status of the current application status. "none" : application is in its default status. same as "player" status. "list" : the application is showing something in list. during this status, the utterances "play this" or "play" will call onselection(0). the utterance "previous" will call onnavigation ("nav_previous"). "player" : the application is playing a piece of content. during this status, the utterance "play this" will call onplay(). since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "list"; } }); onnavigation to support navigation controls via voice, the application should have the following callbacks. otherwise, the key event will be generated. optional boolean onnavigation(voicenavigation voicenavigation); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : voicenavigation : the navigation enumeration via voice. return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "list"; }, onnavigation : function (voicenavigation) { var bsupport = true; console.log("onnavigation : " + voicenavigation); switch(voicenavigation) { case "nav_previous ": // "previous page" break; case "nav_next": // "next page" break; case "nav_left": // "go to left" break; case "nav_right": // "move to right" break; case "nav_up": // "move up" break; case "nav_down": // "go down" break; // if there is no callback implementation for these enums, // tv will generate remote control key events: "arrowright", "arrowleft", "arrowup", "arrowdown". case "nav_show_more": // "show me more" break; default: bsupport = false; break; } return bsupport; } }); onsearch for a contents search provided by the application, it can receive a search utterance to show the search results. in order to support the search via voice, the application must be registered to samsung tv's companion search application and have the following callbacks. the onsearch parameter has a specific format. to learn more about it, please refer to the getdatafromsearchterm. some callbacks are not called by default such as onsearch. to receive all the callback signals on the development stage, request a key from samsung and apply the key to the manifest of your tizen application. the following example shows how to add the "http://developer.samsung.com/tizen/metadata/support-vif-devfeature" key to the manifest file. optional boolean onsearch(voicesearchterm voicesearchterm); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : voicesearchterm : the object contains the information via voice. return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : <?xml version="1.0" encoding="utf-8"?> <widget xmlns="http://www.w3.org/ns/widgets" tizen="http://tizen.org/ns/widgets" id="http://yourdomain/voiceinteractionwebsample" version="1.0.0" viewmodes="maximized"> <access origin="" subdomains="true"></access> < application id="abcdefghrj.voiceinteractionwebsample" package="abcdefghrj" required_version="6.0"/> <content src="index.html"/> <feature name="http://tizen.org/feature/screen.size.normal.1080.1920"/> <icon src="icon.png"/> < metadata key="http://developer.samsung.com/tizen/metadata/support-vif-dev-feature" value="true"/> <name>voiceinteractionwebsample</name> < privilege name="http://developer.samsung.com/privilege/voicecontrol"/> < privilege name="http://developer.samsung.com/privilege/microphone"/> < profile name="tv-samsung"/> </widget> @endcode @param voicesearchterm the object contains the information via voice. @see getdatafromsearchterm @throw none n/a @return boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. @code webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "home"; }, onsearch : function (voicesearchterm) { console.log("onsearch : " + json.stringify(voicesearchterm)); var title = webapis.voiceinteraction.getdatafromsearchterm(voicesearchterm, "search_term_title"); var genre = webapis.voiceinteraction.getdatafromsearchterm(voicesearchterm, "search_term_genre"); console.log("request to search " + title + ", " + genre); return true; } }); onplay supports the media control to handle playback(play). optional boolean onplay(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "player"; }, onplay : function () { // tv default action: generates the remote control key, "mediaplay". console.log("onplay called"); return true; } }); onstop supports the media control to handle playback(stop). optional boolean onstop(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "player"; }, onstop : function () { // tv default action: generates the remote control key, "mediastop". console.log("onstop called"); return true; } }); onpause supports the media control to handle playback(pause). optional boolean onpause(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "player"; }, onpause : function () { // tv default action: generates the remote control key, "mediaplaypause". console.log("onpause called"); return true; } }); onexit supports the media control to handle playback(exit). optional boolean onexit(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "player"; }, onexit : function () { // tv default action: generates the remote control key, "exit". console.log("onexit called"); return true; } }); onselection to support selection controls via voice, the application should have the following callbacks. this callback supports the ordinal, relative selection control. optional boolean onselection(long voiceselection); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : voiceselection : the relative index via voice, (ex. the last item is -1, the current item is 0, the first item is 1). return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "list"; }, onselection : function (voiceselection) { var bsupport = true; console.log("onselection : " + voiceselection); switch(voiceselection) { case -1 : // "select the last one" break; case 0 : // "select this" break; default: { if(voiceselection >= 1) // "select the first one" { // select the (voiceselection)th item // index of the first item is 1 console.log("for ordinal : " + voiceselection); } else { bsupport = false; } } break; } return bsupport; } }); ontitleselection title selection refers to an utterance in the format "select {title name}". to support the title selection via voice, the following two callbacks are required : onrequestcontentcontext and ontitleselection. the onrequestcontentcontext callback provides the information regarding the content of the screen (such as title and position) to the samsung tv. this method will be invoked at the beginning of every utterance. the response consists of positionx(int), positiony(int), title(string), alias(string array) and bfocused(bool). the title property is used for asr conversion and the other properties are used to set the priority of each title. the ontitleselection callback receives the title name from the utterance. optional boolean ontitleselection(domstring title); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : title : the string input via voice. return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "list"; }, onrequestcontentcontext : function () { console.log("onrequestcontentcontext "); var result = []; try { var item = { "positionx" : 0, "positiony" : 0, "title" : "title text1", "alias" : ["title1", "my text1"], "bfocused" : true }; result.push(item); var item2 = { "positionx" : 1, "positiony" : 0, "title" : "title text2", "alias" : ["title2", "my text2"], "bfocused" : false }; result.push(item2); result.push(webapis.voiceinteraction.buildvoiceinteractioncontentcontextitem(2,0,"title text3", ["title3", "my text3"], false)); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } return webapis.voiceinteraction.buildvoiceinteractioncontentcontextresponse(result); }, ontitleselection : function (title) { console.log("ontitleselection" + title); return true; } }); onfastforward supports the media control to handle playback(ff). optional boolean onfastforward(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "player"; }, onfastforward : function () { // tv default action: generates the remote control key, "mediafastforward". console.log("onfastforward called"); return true; } }); onrewind supports the media control to handle playback(rewind). optional boolean onrewind(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "player"; }, onrewind : function () { // tv default action: generates the remote control key, "mediarewind". console.log("onrewind called"); return true; } }); onsearchcollection supports the search utterance appending to the default search application. the value of the result for the search term. optional domstring onsearchcollection(voicesearchterm voicesearchterm); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : voicesearchterm : the object contains the information via voice. return value : optional domstring : the formatted value of the result for the search term. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "none"; }, onsearchcollection : function (voicesearchterm) { log("onsearchcollection : " + json.stringify(voicesearchterm)); var result = []; //appname and appid are of the ui application to get the payload on launch. result.push(webapis.voiceinteraction.buildcollectiondeeplinkdata("a1b2c3d4ef.mytizenappid", "mytizenapp", "page_id=123456&method=voice")); return json.stringify(result); } }); onchangeappstate to support the utterance of shortcut commands, the application must have the onchangeappstate callback. optional boolean onchangeappstate(voiceapplicationstate state); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : state : the application context via voice. return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "none"; }, onchangeappstate: function (state) { // tv default action: launches the samsung tv firstscreen, menu or search application. depending on the input parameter. // "go to home", "go to settings", "go to search". console.log("onchangeappstate : " + state); var bsupport = true; switch (state) { case "home": // go to app's home break; default: bsupport = false; break; } return bsupport; } }); onchangeprevioustrack in order to handle requests to move to the previous track via voice, the application should override the onchangeprevioustrack callback. optional boolean onchangeprevioustrack(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onchangeprevioustrack : function () { console.log("onchangeprevioustrack"); return true; } }); onchangenexttrack in order to handle requests to move to the next track via voice, the application should override the onchangenexttrack callback. optional boolean onchangenexttrack(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onchangenexttrack : function () { console.log("onchangenexttrack"); return true; } }); onrestart in order to handle requests to restart to this track via voice, the application should override the onrestart callback. optional boolean onrestart(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onrestart : function () { console.log("onrestart"); return true; } }); onskipbackward in order to handle requests to skip backward via voice, the application should override the onskipbackward callback. optional boolean onskipbackward(long offsetseconds); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : offsetseconds : the relative position in seconds. return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onskipbackward : function (offsetseconds) { console.log("onskipbackward : " + offsetseconds); return true; } }); onskipforward in order to handle requests to skip forward via voice, the application should override the onskipforward callback. optional boolean onskipforward(long offsetseconds); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : offsetseconds : the relative position in seconds. return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onskipforward : function (offsetseconds) { console.log("onskipforward : " + offsetseconds); return true; } }); onsetplayposition in order to handle requests to set play position via voice, the application should override the onsetplayposition callback. optional boolean onsetplayposition(long position); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : position : the absolute position in seconds. return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onsetplayposition : function (position) { console.log("onsetplayposition : " + position); return true; } }); onchangesubtitlemode in order to handle requests to turn the subtitle feature on/off via voice, the application should override the onchangesubtitlemode callback. optional boolean onchangesubtitlemode(mediafunctionmode mode); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : mode : media_function_on : turning on / media_function_off : turning off return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onchangesubtitlemode : function (mode) { console.log("onchangesubtitlemode"); switch(mode) { case "media_function_on" : console.log("function on"); break; default : console.log("function off"); break; } return true; } }); onchangeshufflemode in order to handle requests to turn the shuffle feature on/off via voice, the application should override the onchangeshufflemode callback. optional boolean onchangeshufflemode(mediafunctionmode mode); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : mode : media_function_on : turning on / media_function_off : turning off return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onchangeshufflemode : function (mode) { console.log("onchangeshufflemode"); switch(mode) { case "media_function_on" : console.log("function on"); break; default : console.log("function off"); break; } return true; } }); onchangescreenfitmode in order to handle requests to turn the screen fit feature on/off via voice, the application should override the onchangescreenfitmode callback. optional boolean onchangescreenfitmode(mediafunctionmode mode); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : mode : media_function_on : turning on / media_function_off : turning off return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onchangescreenfitmode : function (mode) { console.log("onchangescreenfitmode"); switch(mode) { case "media_function_on" : console.log("function on"); break; default : console.log("function off"); break; } return true; } }); onzoom in order to handle requests to zoom in/out via voice, the application should override the onzoom callback. optional boolean onzoom(mediazoommode zoom); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : zoom : media_zoom_in : zoom in / media_zoom_out : zoom out return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onzoom : function (zoom) { console.log("onzoom"); switch(zoom) { case "media_zoom_in" : console.log("zoom in"); break; default : console.log("zoom out"); break; } return true; } }); onrotate in order to handle requests to rotate left/right via voice, the application should override the onrotate callback. optional boolean onrotate(mediarotatemode direction); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : direction : media_rotate_left : rotate left / media_rotate_right : rotate right return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onrotate : function (direction) { console.log("onrotate"); switch(direction) { case "media_rotate_left" : console.log("rotate left"); break; default : console.log("rotate right"); break; } return true; } }); onchange360mode in order to handle requests to turn the 360 feature on/off via voice, the application should override the onchange360mode callback. optional boolean onchange360mode(mediafunctionmode mode); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : mode : media_function_on : turning on / media_function_off : turning off return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onchange360mode : function (mode) { console.log("onchange360mode"); switch(mode) { case "media_function_on" : console.log("function on"); break; default : console.log("function off"); break; } return true; } }); onchangerepeatmode in order to handle requests to change the repeat mode via voice, the application should override the onchangerepeatmode callback. optional boolean onchangerepeatmode(mediarepeatmode mode); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : mode : media_repeat_off : repeat mode off / media_repeat_one : repeat this track / media_repeat_all : repeat all tracks return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onchangerepeatmode : function (mode) { console.log("onchangerepeatmode"); switch(mode) { case "media_repeat_one" : console.log("one"); break; case "media_repeat_all" : console.log("all"); break; default : console.log("off"); break; } return true; } }); oncontinuewatching in order to handle requests to launch the application with playing the history track via voice, the application should override the oncontinuewatching callback to play the history track. this callback will be called after launching the application. optional boolean oncontinuewatching(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung device may perform its basic function. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, oncontinuewatching : function () { console.log("oncontinuewatching"); return true; } }); oncustom supports the custom voice assistant action. optional boolean oncustom(domstring jsonobjectstring); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : jsonobjectstring : the string stringified json object. return value : optional boolean : boolean value of whether the app supports this feature. voice assistant action will get the response "{"result_code":"success"}" for true, "{"result_code":"failure"}" for false/undefined. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "list"; }, oncustom : function (jsonobjectstring) { console.log("oncustom : " + jsonobjectstring); try { var customobject = json.parse(jsonobjectstring); for (var key in customobject) { if(customobject.hasownproperty(key)) { console.log("key : " + key + ", value : " + customobject[key]); } } } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); return false; } return true; } }); onrequestcontentcontext in order to support the voice title selection via voice, the application should override the onrequestcontentcontext callback, return the jsonobject string for the current content context list showing. optional domstring onrequestcontentcontext(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : optional domstring : domstring containing jsonobject string for the content context list. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "list"; }, onrequestcontentcontext : function () { log("onrequestcontentcontext "); var result = []; try { var item = webapis.voiceinteraction.buildvoiceinteractioncontentcontextitem(1,1,"test", ["test set", "test title"], true); result.push(item); var item2 = webapis.voiceinteraction.buildvoiceinteractioncontentcontextitem(2,1,"test2", ["test set 2", "test title 2"], false); result.push(item2); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } return webapis.voiceinteraction.buildvoiceinteractioncontentcontextresponse(result); } }); onadditiontolist in order to handle requests to add this context to list via voice, the application should override the onadditiontolist callback. optional boolean onadditiontolist(listitem list); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : list : list_bookmarks : bookmarks / list_watch_later : watch later return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung tv may perform its basic function. since : 6.5 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onadditiontolist : function (list) { console.log("onadditiontolist"); switch(list) { case "list_bookmarks" : console.log("add this context to bookmarks"); break; case "list_watch_later" : console.log("add this context to watch later"); break; default : break; } return true; } }); onremovalfromlist in order to handle requests to remove this context from list via voice, the application should override the onremovalfromlist callback. optional boolean onremovalfromlist(listitem list); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : list : list_bookmarks : bookmarks / list_watch_later : watch later return value : optional boolean : boolean value of whether the app supports this feature. if a callback returns the false/undefined value, or there is no callback implementation for the utterance, samsung tv may perform its basic function. since : 6.5 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onremovalfromlist : function (list) { console.log("onremovalfromlist"); switch(list) { case "list_bookmarks" : console.log("remove this context from bookmarks"); break; case "list_watch_later" : console.log("remove this context from watch later"); break; default : break; } return true; } }); 2.3 voicesearchterm this interface represents information about the voice search term. [nointerfaceobject] interface voicesearchterm { readonly attribute domstring? utterance; readonly attribute domstring? title; readonly attribute domstring? genre; readonly attribute domstring? cast; readonly attribute domstring? contenttype; readonly attribute domstring? from; readonly attribute domstring? to; }; attributes readonly domstring utterance [nullable] the field for the full utterance. readonly domstring title [nullable] the field for the title. readonly domstring genre [nullable] the field for the genre. readonly domstring cast [nullable] the field for the cast. readonly domstring contenttype [nullable] the field for the content type (movie/tvshow). readonly domstring from [nullable] the field for the start date time(iso 8601). readonly domstring to [nullable] the field for the end date time(iso 8601). 2.4 voiceinteractioncontentcontext this interface represents information about the content context for an item. [nointerfaceobject] interface voiceinteractioncontentcontext { attribute long positionx; attribute long positiony; attribute domstring title; attribute boolean bfocused; }; attributes long positionx the field for x-axis position of the item. long positiony the field for y-axis position of the item. domstring title the field for the title of the item. boolean bfocused the field for whether this item has a focus. 2.5 voiceinteractionmanager the voiceinteractionmanager interface is the top-level interface for the voiceinteractionmanager api that provides access to the module functionalities. [nointerfaceobject] interface voiceinteractionmanager { domstring getversion(); void setcallback(voiceinteractioncallback callback); void listen(); domstring getdatafromsearchterm(voicesearchterm voicesearchterm, voicesearchtermfield field); domstring buildcollectiondeeplinkdata(domstring appid, domstring title, domstring payload); domstring buildcollectionshowdata(domstring appid, domstring title, domstring payload, domstring thumbnail); voiceinteractioncontentcontext buildvoiceinteractioncontentcontextitem(long positionx, long positiony, domstring title, domstring[] aliasarr, boolean bfocused); domstring buildvoiceinteractioncontentcontextresponse(voiceinteractioncontentcontext[] contentcontextarr); }; methods getversion this method gets the plugin's version number. domstring getversion(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol return value : domstring : domstring return value of plugin's version. exceptions : webapiexception with error type unknownerror in any other error case. with error type securityerror, if the application does not have the privilege to call this method. since : 6.0 code example : try { var version = webapis.voiceinteraction.getversion(); console.log("works with voiceinteraction [" + version + "]"); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } setcallback api to define callback functions for the voice interaction commands. void setcallback(voiceinteractioncallback callback); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : callback : composing the functions to be called for the voice interaction commands. exceptions : webapiexception with error type unknownerror in any other error case. with error type typemismatcherror, if an input parameter is not compatible with its expected type. with error type securityerror, if the application does not have the privilege to call this method. since : 6.0 code example : try { webapis.voiceinteraction.setcallback({ onupdatestate : function () { return "list"; }, onnavigation : function (vn) { console.log("onnavigation" + vn); return true; }, onselection : function (voiceselection) { console.log("onselection" + voiceselection); return true; } }); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } listen api to start listening the voice interaction commands after setting callbacks by setcallback. void listen(); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol exceptions : webapiexception with error type unknownerror in any other error case. with error type securityerror, if the application does not have the privilege to call this method. since : 6.0 code example : try { webapis.voiceinteraction.listen(); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } getdatafromsearchterm api to parse the searchterm from samsung side. domstring getdatafromsearchterm(voicesearchterm voicesearchterm, voicesearchtermfield field); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : voicesearchterm : the voicesearchterm from samsung side as search term. field : the field enum to get the value. return value : domstring : the result string formatted. exceptions : webapiexception with error type unknownerror in any other error case. with error type securityerror, if the application does not have the privilege to call this method. with error type invalidvalueserror, if any input parameter contains an invalid value. with error type typemismatcherror, if an input parameter is not compatible with its expected type. since : 6.0 code example : var title = webapis.voiceinteraction.getdatafromsearchterm(voicesearchterm, "search_term_title"); var genre = webapis.voiceinteraction.getdatafromsearchterm(voicesearchterm, "search_term_genre"); buildcollectiondeeplinkdata api to build data for search collection easily. domstring buildcollectiondeeplinkdata(domstring appid, domstring title, domstring payload); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : appid : the app id to be shown in the search application, and to launch the payload. title : the title to be shown in the search application. payload : the payload value to be passed with application launch request. return value : domstring : the result string formatted. exceptions : webapiexception with error type unknownerror in any other error case. with error type typemismatcherror, if any input parameter is not domstring type. with error type securityerror, if the application does not have the privilege to call this method. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "none"; }, onsearchcollection : function (voicesearchterm) { log("onsearchcollection : " + json.stringify(voicesearchterm)); var result = []; // appname and appid are of the ui application to get the payload on launch. try { result.push(webapis.voiceinteraction.buildcollectiondeeplinkdata("a1b2c3d4ef.mytizenappid", "mytizenapp", "page_id=123456&method=voice")); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } return json.stringify(result); } }); buildcollectionshowdata api to build data for search collection easily. domstring buildcollectionshowdata(domstring appid, domstring title, domstring payload, domstring thumbnail); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : appid : the app id to be shown in the search application, and to launch the payload. title : the title to be shown in the search application. payload : the payload value to be passed with application launch request. thumbnail : the thumbnail url, path to be shown in the search application. return value : domstring : the result string formatted. exceptions : webapiexception with error type unknownerror in any other error case. with error type typemismatcherror, if any input parameter is not domstring type. with error type securityerror, if the application does not have the privilege to call this method. since : 6.0 code example : webapis.voiceinteraction.setcallback({ onupdatestate : function () { console.log("assistant tries to get app state"); return "none"; }, onsearchcollection : function (voicesearchterm) { log("onsearchcollection : " + json.stringify(voicesearchterm)); var result = []; // appname and appid are of the ui application to get the payload on launch. try { result.push(webapis.voiceinteraction.buildcollectionshowdata("a1b2c3d4ef.mytizenappid", "mytizenapp", "page_id=123456&method=voice", "http://myservice.com/content/123456.png")); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } return json.stringify(result); } }); buildvoiceinteractioncontentcontextitem api to build the voiceinteractioncontentcontext of an item. voiceinteractioncontentcontext buildvoiceinteractioncontentcontextitem(long positionx, long positiony, domstring title, domstring[] aliasarr, boolean bfocused); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : positionx : x-axis position of the item. positiony : y-axis position of the item. title : the title of the item. aliasarr : the alias titles of the item. bfocused : whether this item has a focus. return value : voiceinteractioncontentcontext : the voiceinteractioncontentcontext object containing an item showing. exceptions : webapiexception with error type unknownerror in any other error case. with error type typemismatcherror, if any input parameters are not compatible with its expected type. since : 6.0 code example : onrequestcontentcontext : function () { console.log("onrequestcontentcontext "); var result = []; try { var item = webapis.voiceinteraction.buildvoiceinteractioncontentcontextitem(1,1,"test", ["test set", "test title"], true); result.push(item); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } return webapis.voiceinteraction.buildvoiceinteractioncontentcontextresponse(result); } buildvoiceinteractioncontentcontextresponse api to build the response of onrequestcontentcontext callback function from voiceinteractioncontentcontext. domstring buildvoiceinteractioncontentcontextresponse(voiceinteractioncontentcontext[] contentcontextarr); product : tv privilege level : public privilege : http://developer.samsung.com/privilege/voicecontrol parameters : contentcontextarr : voiceinteractioncontentcontext objects of the items showing. return value : domstring : the domstring of jsonobject string containing the items showing. exceptions : webapiexception with error type unknownerror in any other error case. with error type typemismatcherror, if any input parameters are not compatible with its expected type. since : 6.0 code example : onrequestcontentcontext : function () { console.log("onrequestcontentcontext "); var result = []; try { var item = webapis.voiceinteraction.buildvoiceinteractioncontentcontextitem(1,1,"test", ["test set", "test title"], true); result.push(item); } catch (e) { console.log("exception [" + e.code + "] name: " + e.name + " message: " + e.message); } return webapis.voiceinteraction.buildvoiceinteractioncontentcontextresponse(result); } 3. full webidl module voiceinteraction { enum voiceapplicationstate { "none", "home", "list", "player", "setting", "search", "unknown" }; enum voicenavigation { "nav_previous", "nav_next", "nav_left", "nav_right", "nav_up", "nav_down", "nav_show_more", "nav_unknown" }; enum voicesearchtermfield { "search_term_utterance", "search_term_title", "search_term_genre", "search_term_cast", "search_term_content_type", "search_term_release_date_from", "search_term_release_date_to" }; enum mediafunctionmode { "media_function_on", "media_function_off" }; enum mediarotatemode { "media_rotate_left", "media_rotate_right" }; enum mediazoommode { "media_zoom_in", "media_zoom_out" }; enum mediarepeatmode { "media_repeat_off", "media_repeat_one", "media_repeat_all" }; enum listitem { "list_bookmarks", "list_watch_later", "list_unknown" }; [nointerfaceobject] interface voiceinteractionmanagerobject { readonly attribute voiceinteractionmanager voiceinteraction; }; webapi implements voiceinteractionmanagerobject; [callback, nointerfaceobject] interface voiceinteractioncallback { optional voiceapplicationstate onupdatestate(); optional boolean onnavigation(voicenavigation voicenavigation); optional boolean onsearch(voicesearchterm voicesearchterm); optional boolean onplay(); optional boolean onstop(); optional boolean onpause(); optional boolean onexit(); optional boolean onselection(long voiceselection); optional boolean ontitleselection(domstring title); optional boolean onfastforward(); optional boolean onrewind(); optional domstring onsearchcollection(voicesearchterm voicesearchterm); optional boolean onchangeappstate(voiceapplicationstate state); optional boolean onchangeprevioustrack(); optional boolean onchangenexttrack(); optional boolean onrestart(); optional boolean onskipbackward(long offsetseconds); optional boolean onskipforward(long offsetseconds); optional boolean onsetplayposition(long position); optional boolean onchangesubtitlemode(mediafunctionmode mode); optional boolean onchangeshufflemode(mediafunctionmode mode); optional boolean onchangescreenfitmode(mediafunctionmode mode); optional boolean onzoom(mediazoommode zoom); optional boolean onrotate(mediarotatemode direction); optional boolean onchange360mode(mediafunctionmode mode); optional boolean onchangerepeatmode(mediarepeatmode mode); optional boolean oncontinuewatching(); optional boolean oncustom(domstring jsonobjectstring); optional domstring onrequestcontentcontext(); optional boolean onadditiontolist(listitem list); optional boolean onremovalfromlist(listitem list); }; [nointerfaceobject] interface voicesearchterm { readonly attribute domstring? utterance; readonly attribute domstring? title; readonly attribute domstring? genre; readonly attribute domstring? cast; readonly attribute domstring? contenttype; readonly attribute domstring? from; readonly attribute domstring? to; }; [nointerfaceobject] interface voiceinteractioncontentcontext { attribute long positionx; attribute long positiony; attribute domstring title; attribute boolean bfocused; }; [nointerfaceobject] interface voiceinteractionmanager { domstring getversion(); void setcallback(voiceinteractioncallback callback); void listen(); domstring getdatafromsearchterm(voicesearchterm voicesearchterm, voicesearchtermfield field); domstring buildcollectiondeeplinkdata(domstring appid, domstring title, domstring payload); domstring buildcollectionshowdata(domstring appid, domstring title, domstring payload, domstring thumbnail); voiceinteractioncontentcontext buildvoiceinteractioncontentcontextitem(long positionx, long positiony, domstring title, domstring[] aliasarr, boolean bfocused); domstring buildvoiceinteractioncontentcontextresponse(voiceinteractioncontentcontext[] contentcontextarr); }; };

      https://developer.samsung.com/smarttv/develop/api-references/samsung-product-api-references/voiceinteraction-api.html
      No Search Results
      No Search results. Try using another keyword.
      • <<
      • <
      • 1
      • >
      • >>
      Samsung Developers
      Samsung Developers
      Quick Link
      • Android USB Driver
      • Code Lab
      • Galaxy Emulator Skin
      • Foldables and Large Screens
      • One UI Beta
      • Remote Test Lab
      • Developer Support
      Family Site
      • Bixby
      • Knox
      • Samsung Pay
      • SmartThings
      • Tizen
      • Samsung Research
      • SamsungOpen Source
      • Samsung Dev Spain
      • Samsung Dev Brazil
      Legal
      • Terms
      • Privacy
      • Open Source License
      • Cookie Policy
      Social Communications
      • Facebook
      • Instagram
      • Twitter
      • YouTube
      • Buzzsprout
      • Rss
      • Linkedin
      • System Status
      • Site Map
      • System Status
      • Site Map
      • facebook
      • instagram
      • twitter
      • youtube
      • buzzsprout
      • rss
      • linkedin

      Copyright © 2023 SAMSUNG. All rights reserved.