Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
tutorials
blogsamsung in-app purchase (iap) offers developers a robust solution for handling digital transactions within mobile applications available on galaxy store. whether it is selling digital goods, handling subscriptions, or managing refunds, samsung iap is designed to offer a smooth, secure experience. the samsung iap orders api expands the scope of these benefits. you can fetch all the payments and refunds history according to specified dates. this content guides you through the essential components for implementing both the samsung iap and samsung iap orders apis. figure 1: sample application ui in this tutorial, we provide a sample application called book spot, which offers users the option to subscribe to their favorite books and consumable items, such as text fonts, for purchase. after purchase, users can consume the item. finally, developers can view all their payment and refund history on specific dates by calling the samsung iap orders api from the back-end server. prerequisites before implementing in-app purchases in your app, do the following to enable a smooth and effective execution of the process while developing your own application: integrate the samsung iap sdk into your application. for more information about the iap sdk integration, you can follow the integration of samsung iap services in android apps article. upload the application for beta testing on samsung galaxy store. a step-by-step guide with screenshots has been provided in the documentation. for more details, see the section “production closed beta test” on the test guide. finally, create items on the seller portal so that users can purchase or subscribe to them while using the application. for more details about the available items that the seller portal supports, see the programming guide. for the sample application, we have already completed these steps. some example items were already created in seller portal, such as books and fonts so that you can consume and subscribe to them while using this sample application. implementation of item purchase now that the application and items are ready, you can implement the purchase functionality in your application like in the sample below: when clicking "buy," the startpayment() method is called, specifying parameters for item id and the onpaymentlistener interface, which handles the results of the payment transaction. the onpayment() callback returns whether the purchase has succeeded or failed. the purchasevo object is instantiated and in case it is not null, it holds the purchase results. if the purchase is successful, then it validates the purchase showing its id. if the purchase is not successful, a purchaseerror message is shown. for more information, check the purchase an in-app item section. iaphelper.startpayment(itemid, string.valueof(1), new onpaymentlistener() { @override public void onpayment(@nonnull errorvo errorvo, @nullable purchasevo purchasevo) { if (purchasevo != null) { // purchase successful log.d("purchaseid" , purchasevo.getpurchaseid().tostring()); toast.maketext(getapplicationcontext() ,"purchase successfully", toast.length_short).show(); } else { log.d("purchaseerror" , errorvo.tostring()); toast.maketext(getapplicationcontext() ,"purchase failed", toast.length_short).show(); } } }); implementation of item consumption after successfully purchasing an item, the user can then consume it. in the sample code below, when "consumed" is selected, the consumepurchaseitems() triggers the consume functionality. this is necessary as items must be marked as consumed so they can be purchased again: the consumepurchaseitems() method is called specifying the parameters for purchaseid and the onconsumepurchaseditemslistener() interface, which handles the item data and results. this code also checks if consuming the purchased items succeeded or failed: if the errorvo parameter is not null and there is no error with the purchase, which can be verified with the iap_error_none response code, then the “purchase acknowledged” message is displayed. however, if there is an error, the errorvo parameter returns an error description with the geterrorstring() getter, along with the “acknowledgment failed” message. iaphelper.consumepurchaseditems(purchaseid, new onconsumepurchaseditemslistener() { @override public void onconsumepurchaseditems(@nonnull errorvo errorvo, @nonnull arraylist<consumevo>arraylist) { if (errorvo != null && errorvo.geterrorcode() == iaphelper.iap_error_none) { toast.maketext(getapplicationcontext() ,"purchase acknowledged", toast.length_short).show(); } else { toast.maketext(getapplicationcontext(), "acknowledgment failed: " + errorvo.geterrorstring(), toast.length_short).show(); } } }); implementation of item subscription besides purchasing and consuming items, you can also subscribe to them in your applications. similar to the validation done for the consumable item purchase, you validate the subscription with a purchase id if the purchase is successful. use the same code snippet specified for “item purchase.” for more information, check the implementation of item purchase section. implementation of the samsung iap orders api the samsung iap orders api is used to view all payments and refunds on a specific date. it does this by fetching the payments and refunds history within the date you specified. let’s implement the samsung iap orders api and create a server to listen to its notifications. through server-to-server communication, the api returns all orders data for the application. configuring the server you can develop a spring boot server for this purpose. here are the guidelines on how to set up this server: set up a spring boot project. for more information, follow the steps on developing your first spring boot application. set up your server endpoint: create a controller for the samsung iap orders api in an integrated development environment (ide) after importing the spring boot project you created. this helps managing all in-app order-related activities and processing them within your application. the controller receives post requests sent from samsung’s iap orders service ensuring the communication with your application. get payment and refund history to view all payments and refunds: you must make a post request to the samsung iap orders api endpoint with the required headers specified below. if you specify a date, all the payment history for this date is returned. otherwise, it only returns all the data from the day before the current date. api endpoint: https://devapi.samsungapps.com/iap/seller/orders method: post headers: add the following fields to the request header. for more information, see the create an access token page, which helps you understand how to create the access token in detail. the token is used for authorization. you can also get the service account id by clicking the assistance > api service tabs on seller portal. for more details, read the section create a service account and visit seller portal. header name description required/optional values content-type format of the request body required application/json authorization authorization security header required bearer: access_token service account id this id can be created in seller portal and is used to generate the json web token (jwt) required service-account-id parameters: the following parameters can be used to build your post request. name type required/optional description sellerseq string required your seller deeplink, which is found in your profile in seller portal and consists of a 12-digit number. packagename string optional used to view payment and refund data. you can provide the application package name. when a package name is not specified, the data for all applications is shown. requestdate string optional specify a date from which to view the payment and refund data. if the date is not specified, the data from a day before your current date is returned. continuationtoken string optional use this if you want to check if there is a continuation for the data on the next page. if there is no more data, the response is null. to implement rest api support, add the following okhttp library dependencies to your application's build.gradle file: implementation 'com.squareup.okhttp3:okhttp: version' implementation 'com.google.code.gson:gson: version' a detailed description of the request items can be found in the request section of the samsung iap orders api documentation. for more information on the server communication, see samsung iap server api. here is a brief summary of the code below: a post request is mapped to the /orders url, which logs the request. the previously described parameters containing the data you specified are formatted in a json body using the string.format() method. the outgoing request is logged in a json body format. a requestbody is instantiated containing the json data, formatted for an http request to be sent to the server with the specified token and service account id. this code also handles multiple results your request can return: the onfailure() method is called when the network request fails for some reason, providing any error details using the ioexception exception. if the request succeeds, the onresponse() method returns the response body or any response exception found. @restcontroller @requestmapping(value = "/iap", method = requestmethod.post) public class orderscontroller { private final okhttpclient client = new okhttpclient(); @getmapping("/orders") public void sendtoserver() { system.out.println("post request received"); // log the request // define parameters values, use according to your requirement // string packagename = "com.example.app_name "; // string requestdate = "20240615"; // string continuationtoken = "xxxxxxxxxxx…….xxxxxx"; string sellerseq = "0000000xxxxx"; // create the json body, use packagename, requestdate, continuationtoken according to your requirement string jsonbody = string.format( "{\"sellerseq\":\"%s\"}", sellerseq ); // create the request body requestbody body = requestbody.create(jsonbody, mediatype.parse("application/json; charset=utf-8")); // access token string token = "0djt9yzryukdogbvulxxxxxx"; // build the request request request = new request.builder() .url("https://devapi.samsungapps.com/iap/seller/orders") .post(body) .addheader("authorization","bearer " + token) .addheader("service-account-id", "85412253-21b2-4d84-8ff5-xxxxxxxxxxxx") .addheader("content-type", "application/json") .build(); client.newcall(request).enqueue(new callback() { @override public void onfailure(@notnull call call, @notnull ioexception e) { system.err.println("request failed: " + e.getmessage()); } @override public void onresponse(@notnull call call, @notnull response response) throws ioexception { if (response.issuccessful()) { string responsebody = response.body().string(); system.out.println("response: " + responsebody); } else { system.err.println("unexpected response code: " + response.code()); system.err.println("response body: " + response.body().string()); } response.close(); // close the response body } }); } } congratulations! you have just built the spring boot server to handle api post requests using the okhttpclient to manage http requests and responses for your sample application. example response as previously mentioned, a json-formatted response is returned to your request. for detailed descriptions of each response body element, see the “response” section of the samsung iap orders api documentation. the following output format is a sample in which only some of the response-body data is presented. in this case, the continuationtoken parameter key returns null because there is no continuation for the data on the next page. the orderitemlist parameter key lists all the orders with specific details, such as orderid, countryid, packagename, among others. { "continuationtoken": null, "orderitemlist": [ { "orderid": "s20230210kr019xxxxx", "purchaseid": "a778b928b32ed0871958e8bcfb757e54f0bc894fa8df7dd8dbb553cxxxxxxxx", "contentid": "000005059xxx", "countryid": "usa", "packagename": "com.abc.xyz" }, { "orderid": "s20230210kr019xxxxx", "purchaseid": "90a5df78f7815623eb34f567eb0413fb0209bb04dad1367d7877edxxxxxxxx", "contentid": "000005059xxx", "countryid": "usa", "packagename": "com.abc.xyz" }, ] } usually, the responses contain all the relevant information about user purchases, such as the in-app item title, price, and payment status. therefore, you can use the information and create views for an easier order management. noteif the iap operating mode is configured to test mode, the api response is empty. this is because the api is configured to operate and return a response only in production mode. conclusion you have learned how to implement item purchase, consumption, and registration, as well as how to integrate the samsung iap orders api and configure a server to fetch all the payment and refund history within specific dates. integrating the samsung iap orders api functionality into your server is an essential step in managing your application payments history to ensure a seamless experience to users. now, you can implement the samsung iap orders api into your application to track all payments, refunds and make your business more manageable. related resources for additional information on this topic, see the resources below: download the android sample application source code add samsung in-app purchase service to your app samsung iap orders api integration of samsung iap services in android apps
Md. Hossain
Develop Samsung IAP
docsamsung iap orders api the samsung in-app purchase iap orders api is used to view all payments and refunds on a specific date before you can start using the iap orders api, you must meet all requirements and use the required authorization header parameters in your requests see get started with the iap apis for more information view payments and refunds view all payments and refunds on a specific date request post /iap/seller/orders name type description sellerseq string required your seller deeplink in seller portal, a 12-digit number to find your seller deeplink, log in to seller portal and go to profile > information for seller page packagename string optional the package name of the app for which you want to view payment and refund data if no packagename is specified, data is returned for all apps to find an app's package name, log in to seller portal, go to apps, select the app, open the binary tab, and click the file name requestdate string optional the specific day for which you want to view payments and refunds if no date is specified, yesterday's date is used format yyyymmdd continuationtoken string optional request the next page of payment/refund data a page contains up to 100 items if a continuationtoken is not specified, the first page of data is displayed if more than one page of data is available, the response includes a continuationtoken use this token to request the next page of data if the continuationtoken returned in the response is null, this means the previous page of data is the last page to contain item information curl \ -x post \ -h "content-type application/json" \ -h "authorization bearer <your-access-token>" \ -h "service-account-id <your-service-account-id>" \ -d '{"sellerseq" "000123456789","packagename" "com samsung android sample","requestdate" "20230615","continuationtoken" "e5ec039730164c50277f9a231b74c1b6e035d9184160d8b3d6b3de1f62691328fbe4c0c4863da52b3bcecef44a4c7acb974c674728c3cb173cb339bd41783f2c"}' \ "https //devapi samsungapps com/iap/seller/orders" use cases parameters included data retrieved sellerseq yesterday's payments and refunds for all apps sellerseq, packagename yesterday's payments and refunds for the specified app sellerseq, requestdate payments and refunds for all apps for the specified date sellerseq, packagename, requestdate payments and refunds for the specified app and the specified date response parameters name type description continuationtoken string if more than 1 page of data 100 items is available to view, a continuationtoken is sent in order to request and view the next page of data if the continuationtoken is null, this means the previous page of data is the last page to contain item information orderid string unique identifier assigned to the purchase receipt purchaseid string unique identifier of the in-app item purchase transaction contentid string content id of the application registered in seller portal countryid string three-character country code iso 3166 of the country where the item is sold packagename string package name of the application registered in seller portal itemid string unique identifier of the in-app item registered in seller portal itemtitle string title of the in-app item registered in seller portal status string order status 2 payment successfully completed3 payment canceled refund if you want to test the "payment canceled" status, contact customer support at seller portal > help > contact us > contact us at the customer center include the orderid of the purchase so that we can change the order status to "payment canceled " ordertime datetime timestamp utc when the order was requested completiontime datetime timestamp utc when the payment was successfully completed refundtime datetime timestamp utc when the payment was canceled by the admin localcurrency string currency symbol of the country's currency where the item was purchased for example, $ localcurrencycode string three-character currency code iso 4217 of the country's currency where the item was purchased for example, eur, gbp, usd localprice string price of the item in the country where the item was purchased usdprice string price in u s dollars usd exchangerate string usd exchange rate at the time of purchase mcc string sim card country code subscriptionorderid string if the purchased item is a subscription, the origin order id of the subscription freetrialyn string if the item is purchased during a free trial period y the item was purchased during a free trial period n the item was not purchased during a free trial period tieredsubscriptionyn string if the item is purchased as a lower-tier/introductory or regular-tier/regular subscription y the item was purchased as a lower-tier or introductory subscription n the item was purchased as a regular-tier or regular subscription { "continuationtoken" "5b5496f44417c9f6b42c8768cbd3f5b5621cdd4021308af81c1e49b77602e9074ab", "orderitemlist" [ { "orderid" "s20230210kr01922227", "purchaseid" "a778b928b32ed0871958e8bcfb757e54f0bc894fa8df7dd8dbb553c81b048343", "contentid" "000005059222", "countryid" "usa", "packagename" "com samsung android sample" }, { "orderid" "s20230210kr01922227", "purchaseid" "90a5df78f7815623eb34f567eb0413fb0209bb04dad1367d7877edfa136321", "contentid" "000005059222", "countryid" "usa", "packagename" "com samsung android sample" }, ] } see failure response codes for a list of possible response codes when a request fails failure response codes the following are response codes you may see when the request fails status code and message 400bad request slr_4001 seller is not matchedslr_4009 continuation token is invalidslr_4010 decrypted continuation token consists of invalid data typeslr_4011 date format is invalid use the format yyyymmdd 401unauthorized slr_4008 failed to verify gateway server authorization
Develop Samsung IAP
docget started with the samsung iap apis the samsung in-app purchase iap apis provide the following functionality orders - view payments and refunds for a specific date publish - view, register, modify, and remove iap items subscription - cancel, refund, revoke or check the status of iap subscription items to start using the iap apis, you must meet certain requirements and use the required authorization header parameters described below requirements in order to use the iap apis, the following is required the iap apis are part of the galaxy store developer api you must meet all of the requirements of the galaxy store developer api including, but not limited to, creating the access token, including the access token in the authorization header of every iap api call, and having commercial seller status to manage in-app purchase items the iap apis must be connected with the content in the in app purchase tab area of seller portal to create this connection, you must either initially distribute your content using the content publish api or the content must be in the for sale state in seller portal if this connection does not exist, matching product information cannot be retrieved you must integrate the iap sdk into your app all binaries registered in your content must support iap if these requirements are not met, error code 106 is returned authorization header parameters every request must include authorization header parameters which specify the content type, your access token, and service account id see create an access token for more information about how to create an access token and service account id attribute description authorization required use bearer <your-access-token> where <your-access-token> is the access token you requested from the galaxy store authentication server service-account-id required the service account id used to create the jwt associated with the access token can be found in the assistance > api service area of seller portal content-type required must be application/json the following example shows the header used with the iap apis curl -x <iap_publish-or-iap_order-or-iap_subscription_api_request> \ -h "content-type application/json" \ -h "authorization bearer <your-access-token>" \ -h "service-account-id <your-service-account-id>" url path parameters the url path for every iap publish and subscription api request must contain the package name for the iap orders api, the package name may be required in the body parameter for the iap subscription api, the in-app item purchase transaction identifier is also required attribute description packagename required for iap order and subscription apis the app's package name purchaseid required for iap subscription api unique identifier of the in-app item purchase transaction the following example shows the url path for creating an item using the iap publish api https //devapi samsungapps com/iap/v6/applications/<packagename>/items the following example shows the url path for canceling, refunding, or revoking a subscription using the iap subscription api https //devapi samsungapps com/iap/seller/v6/applications/<packagename>/items/purchases/subscriptions/<purchaseid>
Develop Smart TV
apivoiceinteraction 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 ;optional boolean onplaylist listitem list ;optional boolean onbrowselist listitem list ;optional boolean onskipad ; 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 ; optional boolean onplaylist listitem list ; optional boolean onbrowselist listitem list ; optional boolean onskipad ; }; 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 / list_preference preference / list_subscription subscription 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; case "list_preference" console log "like this context" ; break; case "list_subscription" console log "subscribe to context" ; 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 / list_preference preference / list_subscription subscription 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; case "list_preference" console log "dislike this context" ; break; case "list_subscription" console log "unsubscribe from this context" ; break; default break; } return true; } } ; onplaylist in order to handle requests to play this context from list via voice, the application should override the onplaylist callback optional boolean onplaylist listitem list ; product tv privilege level public privilege http //developer samsung com/privilege/voicecontrol parameters list list_preference preference / list_subscription subscription / 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"; }, onplaylist function list { console log "onplaylist" ; switch list { case "list_preference" console log "play liked content" ; break; case "list_subscription" console log "play subscription content" ; break; case "list_watch_later" console log "play watch later content" ; break; default break; } return true; } } ; onbrowselist in order to handle requests to browse this context from list via voice, the application should override the onbrowselist callback optional boolean onbrowselist listitem list ; product tv privilege level public privilege http //developer samsung com/privilege/voicecontrol parameters list list_preference preference / list_subscription subscription / 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"; }, onbrowselist function list { console log "onbrowselist" ; switch list { case "list_preference" console log "browse liked content" ; break; case "list_subscription" console log "browse subscription content" ; break; case "list_watch_later" console log "browse watch later content" ; break; default break; } return true; } } ; onskipad in order to handle requests to skip ad content via voice, the application should override the onskipad callback optional boolean onskipad ; 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 tv may perform its basic function since 6 5 code example webapis voiceinteraction setcallback { onupdatestate function { return "player"; }, onskipad function { console log "onskipad" ; 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 ; optional boolean onplaylist listitem list ; optional boolean onbrowselist listitem list ; optional boolean onskipad ; }; [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 ; }; };
Develop Smart TV
apipreview api to use samsung product api, <script type="text/javascript" src="$webapis/webapis/webapis js"></script> should be loaded in index html this module defines the preview functionalities provided by the tizen samsung product api since 2 3 product tv, av, b2b htv summary of interfaces and methods interface method previewmanagerobject previewmanager void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ;domstring getversion ;bool setactiondataeventlistener deeplinkcallback deeplinkcallback ;void unactiondataeventlistener ; 1 interfaces 1 1 previewmanagerobject defines a webapi object instance of the tizen samsung product api the webapis preview object enables access to preview api functionality [nointerfaceobject] interface previewmanagerobject { readonly attribute previewmanager preview; }; webapi implements previewmanagerobject; attributes readonly previewmanager preview preview api namespace 1 2 previewmanager provides methods for preview functionalities [nointerfaceobject] interface previewmanager { void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ; domstring getversion ; bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; void unactiondataeventlistener ; }; methods setpreviewdata sets the preview data each application can have 1 preview the preview consists of at least 1 section, which contains at least 1 tile prerequisites using tag in config xml for example, <tizen metadata key="http //samsung com/tv/metadata/use preview" value="bg_service"/> void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ; parameters previewdata_json preview properties sections mandatory object properties array title optional string shown at the top of the section position optional number defining the position of the section within the preview panel sections are shown in ascending position order tiles mandatory tile object properties array title optional string shown on a highlighted tile subtitle optional string shown below the title image_url mandatory string with the thumbnail image url the supported formats are png and jpg image_ratio mandatory string defining the thumbnail image aspect ratio the valid strings are "16by9", "4by3", "1by1" default , and "2by3" the thumbnail height is fixed at 250 px action_data mandatory string defining the data to be passed to the application when it is launched from this tile is_playable mandatory boolean defining whether selecting the tile starts media playback if "true", a "play" button icon is shown over the thumbnail image display_from optional timestamp defining the time to begin showing the tile display_until optional timestamp defining the time to stop showing the tile position optional number defining the position of the tile within the section tiles are shown in ascending position order successcallback [optional][nullable] callback method to invoke when the call is successful errorcallback [optional][nullable] callback method to invoke if the request fails exceptions webapiexception with error type invalidvalueserror, if any input parameter contains an invalid value with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror, for any other error code example var previewdata = { "sections" [{ "title" "popular now", "tiles" [{ "title" "parks and recreation", "subtitle" "pawnee pony", "display_from" 1422766800, "display_until" 1441937400, "image_url" "http //yourserver com/image jpg", "action_url" "myapp //playvideo?videoid=185595-0324", "is_playable" true }] }] } function successcallback { console log "success" ; } function errorcallback error { console log error message ; } try { webapis preview setpreviewdata json stringify previewdata , successcallback, errorcallback ; } catch ex { console log ex message ; } getversion retrieves the preview api version domstring getversion ; return value domstring plugin version exceptions webapiexception with error type unknownerror, for any error code example try { var result = webapis preview getversion ; console log result ; } catch ex { console log ex message ; } setactiondataeventlistener register callback function which is called when the preview tiles are clicked bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; parameters deeplinkcallback callback method to invoke when action event is occured return value bool output of callback registeration exceptions webapiexception with error type unknownerror, for any error deprecated 4 0 code example this method doesnot have sample code because of @deprecated 4 0 unactiondataeventlistener unregister callback function which is called when the preview tiles are clicked void unactiondataeventlistener ; exceptions webapiexception with error type unknownerror, for any error deprecated 4 0 code example this method doesnot have sample code because of @deprecated 4 0 2 full webidl module preview { [nointerfaceobject] interface previewmanagerobject { readonly attribute previewmanager preview; }; webapi implements previewmanagerobject; [nointerfaceobject] interface previewmanager { void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ; domstring getversion ; bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; void unactiondataeventlistener ; }; };
Develop Smart Hospitality Display
apipreview api to use samsung product api, <script type="text/javascript" src="$webapis/webapis/webapis js"></script> should be loaded in index html this module defines the preview functionalities provided by the tizen samsung product api since 2 3 product tv, av, b2b htv summary of interfaces and methods interface method previewmanagerobject previewmanager void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ;domstring getversion ;bool setactiondataeventlistener deeplinkcallback deeplinkcallback ;void unactiondataeventlistener ; 1 interfaces 1 1 previewmanagerobject defines a webapi object instance of the tizen samsung product api the webapis preview object enables access to preview api functionality [nointerfaceobject] interface previewmanagerobject { readonly attribute previewmanager preview; }; webapi implements previewmanagerobject; attributes readonly previewmanager preview preview api namespace 1 2 previewmanager provides methods for preview functionalities [nointerfaceobject] interface previewmanager { void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ; domstring getversion ; bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; void unactiondataeventlistener ; }; methods setpreviewdata sets the preview data each application can have 1 preview the preview consists of at least 1 section, which contains at least 1 tile prerequisites using tag in config xml for example, <tizen metadata key="http //samsung com/tv/metadata/use preview" value="bg_service"/> void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ; parameters previewdata_json preview properties sections mandatory object properties array title optional string shown at the top of the section position optional number defining the position of the section within the preview panel sections are shown in ascending position order tiles mandatory tile object properties array title optional string shown on a highlighted tile subtitle optional string shown below the title image_url mandatory string with the thumbnail image url the supported formats are png and jpg image_ratio mandatory string defining the thumbnail image aspect ratio the valid strings are "16by9", "4by3", "1by1" default , and "2by3" the thumbnail height is fixed at 250 px action_data mandatory string defining the data to be passed to the application when it is launched from this tile is_playable mandatory boolean defining whether selecting the tile starts media playback if "true", a "play" button icon is shown over the thumbnail image display_from optional timestamp defining the time to begin showing the tile display_until optional timestamp defining the time to stop showing the tile position optional number defining the position of the tile within the section tiles are shown in ascending position order successcallback [optional][nullable] callback method to invoke when the call is successful errorcallback [optional][nullable] callback method to invoke if the request fails exceptions webapiexception with error type invalidvalueserror, if any input parameter contains an invalid value with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror, for any other error code example var previewdata = { "sections" [{ "title" "popular now", "tiles" [{ "title" "parks and recreation", "subtitle" "pawnee pony", "display_from" 1422766800, "display_until" 1441937400, "image_url" "http //yourserver com/image jpg", "action_url" "myapp //playvideo?videoid=185595-0324", "is_playable" true }] }] } function successcallback { console log "success" ; } function errorcallback error { console log error message ; } try { webapis preview setpreviewdata json stringify previewdata , successcallback, errorcallback ; } catch ex { console log ex message ; } getversion retrieves the preview api version domstring getversion ; return value domstring plugin version exceptions webapiexception with error type unknownerror, for any error code example try { var result = webapis preview getversion ; console log result ; } catch ex { console log ex message ; } setactiondataeventlistener register callback function which is called when the preview tiles are clicked bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; parameters deeplinkcallback callback method to invoke when action event is occured return value bool output of callback registeration exceptions webapiexception with error type unknownerror, for any error deprecated 4 0 code example this method doesnot have sample code because of @deprecated 4 0 unactiondataeventlistener unregister callback function which is called when the preview tiles are clicked void unactiondataeventlistener ; exceptions webapiexception with error type unknownerror, for any error deprecated 4 0 code example this method doesnot have sample code because of @deprecated 4 0 2 full webidl module preview { [nointerfaceobject] interface previewmanagerobject { readonly attribute previewmanager preview; }; webapi implements previewmanagerobject; [nointerfaceobject] interface previewmanager { void setpreviewdata domstring previewdata_json, optional successcallback? successcallback, optional errorcallback? errorcallback ; domstring getversion ; bool setactiondataeventlistener deeplinkcallback deeplinkcallback ; void unactiondataeventlistener ; }; };
Develop Samsung IAP
docsamsung iap isn payload the samsung in-app purchase iap instant server notification isn contains registered and private claims because event types and content within the payload is continually added content that already exists is not deleted , handling the notifications that are sent to your server requires some flexibility the payload is encoded in base64 format when it is decoded, it is in json format the following events are reported in the notification and are explained in the data claims section below item purchased item refunded subscription started subscription ended subscription refunded subscription renewed subscription price change accepted subscription in grace period subscription not in grace period order history deleted test example encoded payload eyjpc3mioijpyxauc2ftc3vuz2fwchmuy29tiiwic3viijoirvzftlrftkfnrsisimf1zci6wyjjb20ucgfja2fnzs5uyw1lil0sim5izii6mtcxnziwncwiawf0ijoxnze3mja0lcjkyxrhijp7innlbgxlck5hbwuiom51bgwsimnvbnrlbnroyw1lijoitwfydgluzsj9lcj2zxjzaw9uijoimi4win0 example decoded payload { "iss" "iap samsungapps com", "sub" "event_name", "aud" [ "com package name" ], "nbf" 1717204200, "iat" 1717204200, "data" { }, "version" "2 0" } claims set properties claim name claim type value type description iss registered string always iap samsungapps com sub registered string type of event that occurred item_purchased the user successfully purchased the item item_refunded the purchased item is refunded to the customer ars_subscribed the subscription has started ars_unsubscribed the subscription has ended or is cancelled ars_refunded the subscription payment, at any point during the current subscription period, is refunded to the subscriber ars_renewed the subscription has been renewed by the subscriber ars_pricechange_agreed the subscriber has consented or not consented to a subscription price change ars_in_grace_period the subscription is in a grace period, allowing the subscriber time to update their payment method and renew the subscription ars_out_grace_period the subscription is not in a grace period order_history_deleted the listed order details are deleted receipts and subscriptions cannot be retrieved using the specified id test this is a test notification sent using seller portal aud registered string the package name of the content iat registered number the time at which the jwt was issued unix epoch time nbf registered number the time at which the jwt can be accepted for processing unix epoch time data private json detailed payload for each notification based on the event type sub see data claims for more information about the data claims payload version private string the version of the samsung iap isn service the current version, which is jwt-based, is 2 0 data claims the following are the data claims that may be included in the isn, based on the event type item purchased item refunded subscription started subscription ended subscription refunded subscription renewed subscription price change accepted subscription in grace period subscription not in grace period order history deleted test item purchased the user successfully purchased the item example "data" { "itemid" "one_gallon_gas", "orderid" "s20240601kra0010001", "purchaseid" "579cc7245d57cc1ba072b81d06e6f86cd49d3da63854538eea68927378799a37", "testpayyn" "n", "betatestyn" "n", "passthroughparam" null } properties name value description itemid string id of item purchased orderid string order id on the receipt delivered to the user purchaseid string the purchase id you used with the receipt verification api testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information passthroughparam string transaction id you created as a security enhancement when requesting a payment, and is delivered only when entered when requesting a payment item refunded the purchased item is refunded to the customer example "data" { "orderid" "s20240601kra0010001", "purchaseid" "579cc7245d57cc1ba072b81d06e6f86cd49d3da63854538eea68927378799a37", "testpayyn" "n", "betatestyn" "n" } properties name value description orderid string order id on the receipt delivered to the user purchaseid string the purchase id you used with the receipt verification api testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information subscription started the subscription has started example "data" { "itemid" "weekly_fuel", "orderid" "s20240601kra0010009", "purchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "paymentplan" "regular", "scheduledtimeofrenewal" 1717809005, "testpayyn" "n", "betatestyn" "n" } properties name value description itemid string id of item purchased orderid string order id on the receipt delivered to the user purchaseid string the purchase id you used with the receipt verification api paymentplan string product plan applied to the current user for example, freetrial / tieredprice / regular scheduledtimeofrenewal number the next subscription renewal date, in unix epoch time testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information subscription ended the subscription has ended or is cancelled and is not renewed the subscription is still available until the end of the current subscription period example "data" { "firstorderid" "s20240601kra0010009", "firstpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "testpayyn" "n", "betatestyn" "n", "validuntil" 1717809005 } properties name value description firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information validuntil number the subscription expiration date, in unix epoch time subscription refunded the subscription payment, at any point during the current subscription period, is refunded to the subscriber example "data" { "firstorderid" "s20240601kra0010009", "firstpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "refundedorderid" "s20240608kra0110009", "refundedpurchaseid" "3b3a885281926494dd23273da39dd62a4de7e088b0cc284acbb463b91b95310e", "refundedpurchasedate" 1596573209, "testpayyn" "n", "betatestyn" "n" } properties name value description firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api refundedorderid string the order id of the refunded payment refundedpurchaseid string the purchase id of the refunded payment refundedpurchasedate number the purchase date of the refunded payment, in unix epoch time testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information subscription renewed the subscription has been renewed by the subscriber example "data" { "itemid" "weekly_fuel", "firstorderid" "s20240601kra0010009", "firstpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "renewedorderid" "s20240608kra0110009", "renewedpurchaseid" "3b3a885281926494dd23273da39dd62a4de7e088b0cc284acbb463b91b95310e", "paymentplan" "regular", "scheduledtimeofrenewal" 1720415824, "testpayyn" "y", "betatestyn" "n" } properties name value description firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api renewedorderid string the order id of the most recent renewal payment renewedpurchaseid string the purchase id of the most recent renewal payment paymentplan string the product plan applied to the current subscriber for example, freetrial / tieredprice / regular scheduledtimeofrenewal number the next subscription renewal date, in unix epoch time testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information subscription price change accepted the subscriber has consented or not consented to a subscription price change example "data" { "itemid" "weekly_fuel", "firstorderid" "s20240601kra0010009", "firstpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "agreeyn" "y", "testpayyn" "n", "betatestyn" "n" } properties name value description itemid string id of item purchased firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api agreeyn string y the subscriber consented to the subscription price increase and the subscription will be renewed at the increased price at the beginning of the subscription period when the price increase is applied n the subscriber did not consent to the subscription price increase and the subscription will be cancelled at the end of the final subscription period that charges the current price testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information subscription is in a grace period there is an issue with the subscriber's payment method and the subscriber is given time to update their payment method before the subscription is cancelled example "payload" { "itemid" "ars_with_tiered", "firstorderid" "s20210126gba1918788", "firstpurchaseid" "5665c5e42e1888fe82cd57111f5f8374a87f96623585ffef9bc03a58cecca508", "testpayyn" "y", "betatestyn" "n", "graceperiodstartdate" 1720415824, "graceperiodenddate" 1721020624 } properties name value description itemid string id of item purchased firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information graceperiodstartdate number starting date of the grace period, in unix epoch time graceperiodenddate number ending date of the grace period, in unix epoch time subscription is not in a grace period the subscription is not in a grace period example "payload" { "itemid" "ars_with_tiered", "firstorderid" "s20210126gba1918788", "firstpurchaseid" "5665c5e42e1888ee87cd57111f5f8674a87f96623585ffef9bd03a58cecca508", "renewedorderid" "s20200805kra1910361", "renewedpurchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2", "paymentplan" "regular", "scheduledtimeofrenewal" 1720415824, "testpayyn" "n", "betatestyn" "n" } properties name value description itemid string id of item purchased firstorderid string the order id on the first receipt delivered to the subscriber firstpurchaseid string the purchase id you used with the receipt verification api renewedorderid string the order id of the most recent renewal payment renewedpurchaseid string the purchase id of the most recent renewal payment paymentplan string the product plan applied to the current subscriber for example, freetrial / tieredprice / regular scheduledtimeofrenewal number the next subscription renewal date, in unix epoch time testpayyn string y the item was purchased by a licensed tester in iap test mode n the item was purchased in iap production mode see iap test mode conditions for more information betatestyn string y the item was purchased during a closed beta test n the item was not purchased during a closed beta test see iap test mode conditions for more information order history deleted delete order details when the order details are deleted, receipt and subscription information for the specified order and purchase ids are no longer available example "data" { "count" 3, "orderlist" [ { "orderid" "s20240601kra0010001", "purchaseid" "579cc7245d57cc1ba072b81d06e6f86cd49d3da63854538eea68927378799a37" }, { "orderid" "s20240601kra0010009", "purchaseid" "9c7a73ec46aaf1fb7e3792c23633f3f227005d6a6c716f1869ca41b9e4f17fe2" }, { "orderid" "s20240608kra0110009", "purchaseid" "3b3a885281926494dd23273da39dd62a4de7e088b0cc284acbb463b91b95310e" } ] } properties name value description orderid string order id on the receipt delivered to the user purchaseid string the purchase id you used with the receipt verification api test this is a test notification sent using seller portal example "data" { "sellername" "martine", "contentname" "driving game" } properties name value description sellername string the name of the person selling the item contentname string the name of the item iap test mode conditions the following table describes the conditions status of content in seller portal and the iap operating mode that apply for the testpayyn and betatestyn property values content status in seller portal registering with licensed tester closed beta for sale iap operating mode operation_mode_test operation_mode_production testpayyn y n betatestyn n y n
Develop Health
apioverviewpackageclasstreedeprecatedindex com samsung android sdk healthdata enum healthdataresolver sortorder java lang object java lang enum<healthdataresolver sortorder> com samsung android sdk healthdata healthdataresolver sortorder all implemented interfaces serializable, comparable<healthdataresolver sortorder> enclosing class healthdataresolver public static enum healthdataresolver sortorder extends enum<healthdataresolver sortorder> this enum defines sort orders since 1 0 0 enum constant summary enum constants enum constant and description asc the ascending order desc the descending order method summary all methods static methods concrete methods modifier and type method and description static healthdataresolver sortorder valueof string name returns the enum constant of this type with the specified name static healthdataresolver sortorder[] values returns an array containing the constants of this enum type, in the order they are declared enum constant detail asc public static final healthdataresolver sortorder asc the ascending order desc public static final healthdataresolver sortorder desc the descending order method detail values public static healthdataresolver sortorder[] values returns an array containing the constants of this enum type, in the order they are declared this method may be used to iterate over the constants as follows for healthdataresolver sortorder c healthdataresolver sortorder values system out println c ; returns an array containing the constants of this enum type, in the order they are declared valueof public static healthdataresolver sortorder valueof string name returns the enum constant of this type with the specified name the string must match exactly an identifier used to declare an enum constant in this type extraneous whitespace characters are not permitted parameters name - the name of the enum constant to be returned returns the enum constant with the specified name throws illegalargumentexception - if this enum type has no constant with the specified name nullpointerexception - if the argument is null
Develop Mobile PENUP
apioverview package class tree deprecated index help com samsung android penup enum period java lang object java lang enum<period> com samsung android penup period all implemented interfaces java io serializable, java lang comparable<period> public enum period extends java lang enum<period> this enum provides periods for calculating popularities of artworks since pen up 1 0 enum constant summary enum constants enum constant and description all the whole period month the period for a month week the period for a week method summary methods modifier and type method and description static period valueof java lang string name returns the enum constant of this type with the specified name static period[] values returns an array containing the constants of this enum type, in the order they are declared enum constant detail all public static final period all the whole period since pen up 1 0 month public static final period month the period for a month since pen up 1 0 week public static final period week the period for a week since pen up 1 0 method detail values public static period[] values returns an array containing the constants of this enum type, in the order they are declared this method may be used to iterate over the constants as follows for period c period values system out println c ; returns an array containing the constants of this enum type, in the order they are declared valueof public static period valueof java lang string name returns the enum constant of this type with the specified name the string must match exactly an identifier used to declare an enum constant in this type extraneous whitespace characters are not permitted parameters name - the name of the enum constant to be returned returns the enum constant with the specified name throws java lang illegalargumentexception - if this enum type has no constant with the specified name java lang nullpointerexception - if the argument is null
Develop Mobile PENUP
apioverview package class tree deprecated index help com samsung android penup enum scope java lang object java lang enum<scope> com samsung android penup scope all implemented interfaces java io serializable, java lang comparable<scope> public enum scope extends java lang enum<scope> this enum provides oauth 2 0 scopes of pen up since pen up 1 0 enum constant summary enum constants enum constant and description post_resources the scope for posting resources such as an artwork and a collection read_my_resources the scope for reading the user's resources such as the profile, followings, and followers read_resources the scope for reading resources such as an artist, an artwork, a collection, and a tag method summary methods modifier and type method and description static scope valueof java lang string name returns the enum constant of this type with the specified name static scope[] values returns an array containing the constants of this enum type, in the order they are declared enum constant detail read_my_resources public static final scope read_my_resources the scope for reading the user's resources such as the profile, followings, and followers since pen up 1 0 read_resources public static final scope read_resources the scope for reading resources such as an artist, an artwork, a collection, and a tag since pen up 1 0 post_resources public static final scope post_resources the scope for posting resources such as an artwork and a collection since pen up 1 0 method detail values public static scope[] values returns an array containing the constants of this enum type, in the order they are declared this method may be used to iterate over the constants as follows for scope c scope values system out println c ; returns an array containing the constants of this enum type, in the order they are declared valueof public static scope valueof java lang string name returns the enum constant of this type with the specified name the string must match exactly an identifier used to declare an enum constant in this type extraneous whitespace characters are not permitted parameters name - the name of the enum constant to be returned returns the enum constant with the specified name throws java lang illegalargumentexception - if this enum type has no constant with the specified name java lang nullpointerexception - if the argument is null
We use cookies to improve your experience on our website and to show you relevant advertising. Manage you settings for our cookies below.
These cookies are essential as they enable you to move around the website. This category cannot be disabled.
These cookies collect information about how you use our website. for example which pages you visit most often. All information these cookies collect is used to improve how the website works.
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and tailor the website to provide enhanced features and content for you.
These cookies gather information about your browser habits. They remember that you've visited our website and share this information with other organizations such as advertisers.
You have successfully updated your cookie preferences.