Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
tutorials
bloggift card coupon id card generic card pay as you go (in progress) reservation (in progress) digital key (in progress) notice generic card supports unstructured forms of cards. be a samsung wallet partner partner onboarding to begin offering content through samsung wallet, you must first register as a partner on the samsung wallet partner portal. the integration process is detailed on the samsung developer portal. to join the samsung wallet partner portal, create a samsung account that is used as the service administrator. wallet card management once enrolled, you can create service cards on the wallet cards menu. each card is assigned a card id representing the service, and you can set the card type and linking information. you can manage cards according to their status – test or live. configuring wallet card notice after completing all required forms for the wallet card, click the launch button to request card activation. before providing the service to actual users, remember to turn off the 'test mode.' how to safely secure user data key generation and certificate request the registration process includes certificate exchange to securely transmit service data. refer to the diagram and developer guide, security key & certificate creation guide, to complete the certificate registration and partner enrollment smoothly. certificates exchange process ensuring data security to prevent forgery and leakage of user card data, secure tokenization processing is required. json web token (jwt), which includes encryption and signature, has a validity time basis for verification, thus providing enhanced security. in particular, when generating this token, the key and certificate previously obtained through the certificate exchange process are used. process of generating and verifying security tokens notice depending on how partners provide content services to users, you can choose how to deliver data to the samsung wallet service. two ways to transfer wallet card data add to samsung wallet interface provides two methods for partners to deliver users digital content as wallet cards. data transmit link the general way to transfer wallet card data is to organize tokenized data in the link attached to the button, and the card data is transmitted to the samsung wallet service when the user clicks the button. as long as samsung wallet support is confirmed, you can generate a link containing the user's card data and configure the "add to samsung wallet" button to run the link when pressed, either on an application or web page. data transmit process data fetch link another method to transfer wallet card data is to include only the refid, which represents the user's content, in the "add to samsung wallet" link and transmit it to the samsung wallet service. when a user clicks the "add to samsung wallet" button, samsung servers refer to the get card data api information set on the wallet card and retrieve user content using the received refid to complete registration. data fetch process this method is suitable for providing user's data through email or mms messages where static links cannot be avoided. there is an option to secure these static links. data fetch process for static links setting up data synchronization on the partner portal, you can set up the wallet card information and configure the server interaction api that the content provider needs to prepare. this api is an interface for managing card registrations, deletions, information, and state changes to sync with those registered on samsung wallet. register wallet cards when a user card is added to samsung wallet, samsung wallet servers use the send card state api to communicate card registration and deletion status to the content provider, allowing them to manage content that needs to be synchronized with samsung wallet. when a wallet card is registered, added event is sent to the partner's server update wallet cards changes to the synchronization target content can be notified to the samsung wallet service through the update notification api. here, the value that distinguishes each piece of content is the refid that the partner must provide when registering the users’ wallet card. through the get card data api, samsung wallet servers can check the latest content information any time. if updates occur on the partner's side, updated event notifications should be sent to the samsung server in case users withdraw content from the partner's side in case users delete cards from samsung wallet notice both servers should verify requests using the authorization header of the api request. this authorization token is in jwt format, familiar from card data security. effortless wallet card registration with just one click this feature is primarily composed of a link-connected button and can be provided through the content provider's application, web page, email, or mms message. various service channels javascript library for web developers we provide a javascript library and a user guide, implement the button, to help integrate your web pages. creating buttons and links in your app for configuring buttons in applications, utilize the button image resources. providing services via mms, email, or qr codes to provide services through fixed links, check out the details of the data fetch link. these static links can also be used by scanning qr codes. experience the service and practice you can experience service integration development using the codelab and use the testing tool to preregister the wallet cards created on the partner portal, which could be helpful. conclusion we've looked at how to provide digital content through the "add to samsung wallet" feature. we continuously update the guides on the developer portal, so please refer to them when preparing for integration. summary the "add to samsung wallet" service welcomes participation from content service partners and developers. for inquiries or technical support, please contact us through the form provided on the developer portal. i hope this post has been helpful, and now i'll conclude my writing here. thank you. this post was written based on the sdc23 korea session.
Choi, Jonghwa
tutorials mobile
bloggift card loyalty card id card create your wallet card at the samsung wallet portal. you can create as many cards as you need. the samsung wallet portal also allows you to manage your cards and monitor their performance. testing wallet cards use the “add to wallet” test tool to test the card at any time, before or after launching it: in the samsung wallet portal, enable testing mode for the card you want to test. skip this step if you have already launched the card. on your samsung device, go to the “add to wallet” test tool and sign in with your samsung account. select the card from the list and provide test data in the appropriate fields. in the “partner’s private key” field, paste your decrypted private key. this must be the same private key that was used during onboarding. noteif your private key is encrypted, you must first decode it with the ssl command. an encrypted key starts with the following text: -----begin encrypted private key----- once decoded, the key starts with the following text: -----begin private key----- 5. tap the “add to samsung wallet” button to add the card to samsung wallet on your device. for more information about testing wallet cards, see “add to wallet” test tool. launching wallet cards when you are ready to make the wallet card accessible to users, click “launch” to start the verification process. launching a card cannot be canceled. figure 1: wallet card launched the samsung wallet administrator reviews the card and approves or rejects it. if your card is rejected, check the rejection email for the reason. modify the card to address the issue and launch it again. for more information about wallet card verification, see launch wallet cards (verifying status) and launch wallet cards (rejected status). implementing “add to wallet” links after launching your wallet card, create a link that users can click to add the content to their samsung wallet. to include the card data in tokenized form, use the following url format: https://a.swallet.link/atw/v1/{card id}#clip?cdata={cdata token} where: {card id} path parameter is the unique identifier for the wallet card in the samsung wallet portal. #clip hash parameter is case-sensitive. cdata query parameter contains the encrypted card data in jwt format. for more information, see the "cdata token generation" section below. if the encrypted card data is longer than 2048 bytes, or you do not want to include the tokenized data in the url, store and reference the card data on your server. create the url in the following format: https://a.swallet.link/atw/v1/{card id}#clip?pdata={reference id} where: {card id} path parameter is the unique identifier for the wallet card in the samsung wallet portal. #clip hash parameter is case-sensitive. pdata query parameter is the unique identifier for the card data stored on your server. for more information on “add to wallet” links, see add to wallet interface. cdata token generation the card data in basic json format must be provided as a jwt (json web token). for token generation details, see security. you can also study the cdata generation sample code. to ensure your cdata token is valid, keep the following requirements in mind: pay attention to the mandatory fields in the card object. all timestamps are utc epoch time in milliseconds. card data attributes vary based on the card type. for detailed card data specifications, see wallet cards. your private key must match the key used for the security certificate signed by samsung. if you are using the correct private key, the following commands generate the same hash: $ openssl rsa -noout -modulus -in partner.key | openssl md5 $ openssl x509 -noout -modulus -in partner.crt | openssl md5 generated jwt tokens expire in 30 seconds. the “add to wallet” link must be used within this time. otherwise, you must generate a new token and new link. next steps to integrate the “add to wallet” feature as a button in your application or website, see implement the button. you can update the information on a card that has been stored in a user’s samsung wallet by communicating between your server and the samsung server. for information, see server interaction. if you have any questions or face difficulties implementing the content in this article, you can contact samsung developer support. related resources samsung wallet documentation integrate “add to samsung wallet” button into partner services code lab
M. A. Hasan Molla
tutorials mobile
bloggift card, or if you have vouchers to events, such as concerts, it is possible to define an event id. for instance: "event-001". groupingid enter an identifier to group related cards. startdate enter the starting date and the epoch timestamp in milliseconds. startdate.relativenotitime enter the amount of time within which you want to provide a notification to the user. the notification time is the relative time from the startdate. the value can be up to 2880 milliseconds. enddate enter the end date and the epoch timestamp in milliseconds. enddate.relativenotitime enter the amount of time within which you want to provide a notification to the user. the notification time is the relative time from the enddate. the value can be up to 2880 milliseconds. logoimage set the logo image url. the file size must not exceed 256 kb. also this image can be set from the template editor. logoimage.darkurl set the logo image url for the dark mode. the file size must not exceed 256 kb. logoimage.lighturl set the logo image url for the light mode. the file size must not exceed 256 kb. bgimage set the background image url. the file size must not exceed 512 kb. text{i} set the label-text value that should be displayed for each field containing the details of your card. the label is defined in the template editor, shown in the image below. to set the value of the label, update the json file. image{i} enter the image url, such as: "https://www.samsung.com/images/image1.png". this url is just an example, you must update it according to your needs. this field only works in generic card type3. we have used a type1 card in the example. so this field in the example json has no effect on the card. you can find all three card type sample uis here. image{i}.lighturl enter the image url in light mode, such as: "https://www.samsung.com/images/light.png". this url is just an example, you must update it according to your needs. image{i}.darkurl enter the image url in dark mode, such as: "https://www.samsung.com/images/dark.png". this url is just an example, you must update it according to your needs. serial{i} set the serial for barcode or qr code. serial{i}.serialtype serial presentation type. for more information on the presentation types (serialtype), see references. serial{i}.ptformat set the presentation format. for more details on the presentation formats (ptformat), see references. serial{i}.ptsubformat set the presentation subformat here. for more details on the barcode formats (ptsubformat), see references. serial{i}.errorcorrectionlevel set the error correction levels in this field. the amount of redundancy or error correction data included in the code varies. qr codes offer four levels of error correction: l, m, q, and h. the qr field looks like the following in your card: privacymodeyn set the user authentication if required. set the value to "y" or "n" bgcolor set the card art color. fontcolor set the card art font color. nonetworksupportyn set the value to "y" to open the wallet card when under the "no network" status. otherwise, set the value to "n" noticedesc set the the notice description here. see the image below of how it is added to card. applinklogo add the application link logo url in this field. applinkname add the application link name in this field. applinkdata add the application link url in this field. locations list of locations where the card will be used. this information can be used to provide location-based services. samsung wallet can use this information to show maps, names of places, and addresses. for more information on the locations field and json format, check references. card json example in previous sections, you have learned about the card specifications. next, let’s implement the generic card fields according to your needs. in this section, as the aim is to create an insurance card, you must use the fields accordingly. samsung provides a specifically formatted json structure. you need to configure the card data objects within the structure’s data array. for more details, see the generic card section. { "card": { "type": "generic", "subtype": "others", "data": [ { "createdat": 1709712961000, "updatedat": 1709712961000, "language": "en ", "refid": "933533e1-9284-461c-905f-bc177526a8d1", "attributes": { "title": "insurance identification card", "subtitle": "insurance card", "providername": "samsung insurance co.", "eventid": "1", "groupingid":"1", "startdate": 1731299205000, "startdate.relativenotitime": 500, "enddate": 1731320805000, "enddate.relativenotitime": 400, "logoimage": "https://us-cdn-gpp.stg.mcsvc.samsung.com/mcp25/resource/2023/12/20/55ea769f-d14d-4c47-94cc-50cade36cdd9.png", "logoimage.darkurl": "https://us-cdn-gpp.stg.mcsvc.samsung.com/mcp25/resource/2023/12/20/55ea769f-d14d-4c47-94cc-50cade36cdd9.png", "logoimage.lighturl": "https://us-cdn-gpp.stg.mcsvc.samsung.com/mcp25/resource/2023/12/20/55ea769f-d14d-4c47-94cc-50cade36cdd9.png", "bgimage": "", "text1": "1234567", "text2": "samsung insurance co.", "text3": "jaqueline m", "text4": "samsung motors 2014 galaxy5", "text5": "11sam23sung3t", "text6": "(031)000-1235", "image1": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2024/3/5/b9445e3f-2ef5-4d81-9fca-b7a8a7cd599f.png", "image1.darkurl": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2024/3/5/b9445e3f-2ef5-4d81-9fca-b7a8a7cd599f.png", "image1.lighturl": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2024/3/5/b9445e3f-2ef5-4d81-9fca-b7a8a7cd599f.png", "serial1.value": ">1180mm2241b7c 0000000000000298060000000000 0 090870907 ", "serial1.serialtype": "qrcode", "serial1.ptformat": "qrcode", "serial1.ptsubformat": "qr_code", "serial1.errorcorrectionlevel": "m", "privacymodeyn": "y", "bgcolor": "#3396ff", "fontcolor": "#ffffff", "nonetworksupportyn": "n", "noticedesc": "{\"count\":2,\"info\":[{\"title\":\"notice1\",\"content\":[\"description1\",\"description2\"]},{\"title\":\"notice2\",\"content\":[\"description1\",\"description2\"]}]}", "applinklogo": "https://www.samsung.com/logo.png", "applinkdata": "https://www.samsung.com/", "applinkname": "samsung insurance co.", "locations": "[{\"lat\": 37.2573276, \"lng\": 127.0528215, \"address\": \"suwon\", \"name\": \"digital city\"}]" } } ] } } generic card testing with the "add to wallet" test tool now, you can test the generic card with the "add to wallet" test tool provided by samsung. just follow these steps: sign in to the add to wallet test tool. for more information, see the samsung wallet test tool. enter the private key in the "enter partner private key" field. in this tool, you find all cards that you have created from the samsung wallet partner site in the "select card" section. for more information, see the samsung wallet partner site. select the generic card that you have just created. now select json from the data field and modify the existing json data fields according to the card specification details. after modifying the json data fields, check if the json is valid. finally, if the private key is valid, the "add to samsung wallet" button becomes active at the bottom of the page. then, just click add to samsung wallet to finish adding the generic card. if you use the provided example json and add the card to the wallet, the card looks like the following: server integration in this step, server configuration is needed because the generated jwt token expires after 30 seconds. developers are advised to only generate this token after a user has clicked the "add to wallet" button. as you have already performed testing with the "add to wallet" test tool, you need to configure your server. for more information on the implementation of both the "add to samsung wallet" button and server-side logic, see implementing "add to wallet" in an android application. this article explains how you can distribute your card with your android application and how to generate the jwt token at runtime, after pressing the "add to samsung wallet" button. conclusion you have now learned the basics for how to set up a generic card and test it for your business needs. in case you have further questions, contact samsung developer support. related resources utilize the add to samsung wallet service for digital cards introduce loyalty cards to your application with samsung wallet implementing "add to wallet" in an android application seamlessly integrate "add to wallet" for samsung wallet
M. A. Hasan Molla
tutorials mobile
bloggift cards and loyalty cards, for your service and issue them to users who can add them to the samsung wallet application on their device. samsung wallet cards are signed with the rs256 asymmetric algorithm. the rs256 signing algorithm requires a private key, which is a personal credential that must never be shared in the application. consequently, a separate server application is needed to store the key and sign the wallet card data (cdata). when the user taps the "add to samsung wallet" button in the application, the server application creates and signs the wallet card data, then returns a jwt token that is used to add the wallet card to the user's samsung wallet application. figure 1: "add to wallet" flow this tutorial uses kotlin to demonstrate how to implement the "add to wallet" feature in an android mobile application that adds movie tickets to samsung wallet. it also shows how to generate the wallet cards using a spring boot server. you can follow along with the tutorial by downloading the sample code files. develop the mobile application to implement the "add to wallet" button in the mobile application, you must configure the application, implement the application ui, and define the application logic for the button. configuring the mobile application project create an application project and configure it to connect to and communicate with the server through rest api requests: in android studio, create a new project. to implement rest api support in the application, add the following retrofit library dependencies to the application's "build.gradle" file: 'com.squareup.retrofit2:retrofit:2.11.0' 'com.squareup.retrofit2:converter-gson: 2.11.0' to enable communication with the server, add the following permissions to the "androidmanifest.xml" file: <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.access_network_state"/> <uses-permission android:name="android.permission.access_wifi_state"/> to enable testing with a local non-https server, add the following attribute to the "application" element in the "androidmanifest.xml" file: android:usescleartexttraffic="true" implementing the application ui the application ui consists of two screens: the movie tickets list and a ticket detail page. in the application code, define a movie data class that contains details for the movie tickets that can be added to samsung wallet. data class movie( val name:string, val studio:string, val ticketnumber:string, ) create a recyclerview that displays the list of movie tickets as buttons on the main screen. each button has a listener that opens the detail page for the ticket. you can study the implementation details in the sample code. to check whether the device supports samsung wallet, send an http get request to the following endpoint, where build.model is the model of the device: https://api-us3.mpay.samsung.com/wallet/cmn/v2.0/device/available?servicetype=wallet&modelname=${build.model} create the ticket detail page layout in the "activity_movie_detail.xml" file. the "add to wallet" button is implemented on this page. figure 2: detail page layout implement the ticket detail page functionality in the moviedetailactivity activity class in the application code. for this demonstration, the movie ticket data is predefined in the application code. in a real application, the data is usually retrieved in real time from an external database. val movielists = listof<movie>( movie("the wallet", "samsung studios", "a-01"), movie("crying sea", "laplace studio","h-07"), movie("canoe", "terra productions", "r-03") ) val position:int = intent.getintextra("movieposition", 0) val movie:movie = movielists[position] binding.mvnametext.text = movie.name binding.mvstudiotext.text = movie.studio binding.mvticketnumber.text = "ticket: ${movie.ticketnumber}" binding.addtowalletbutton.setonclicklistener { // request server to generate card data // retrieve signed card data from server // add card to samsung wallet application } when the user taps the "add to wallet" button, onclicklistener() is triggered. its functionality is defined later in this tutorial. connecting to the server to communicate with the server: in the tokenresponse class, define the structure of the json response to be received from the server. the status field indicates whether the token generation request was successful, and the jwt field contains the generated cdata in the form of a jwt token. data class tokenresponse( val status: string, val jwt:string ) in the "apiclient.kt" file, define a retrofitclient object that is used to establish the connection with the server. define the apiinterface interface, which defines the api request and response: the api endpoint url is base_url/movie/{id}, where {id} is the movie ticket id to be added the expected response from the endpoint is a tokenresponse object. define an apiclient object that extends apiinterface and creates a retrofitclient instance to establish the server connection. object retrofitclient { private const val base_url = "http://192.xxx.xxx.xxx:8080" // define your server url val retrofit: retrofit by lazy { retrofit.builder() .baseurl(base_url) .addconverterfactory(gsonconverterfactory.create()) .build() } } interface apiinterface { @get("/movie/{id}") suspend fun getmovie(@path("id") movieid:int): response<tokenresponse> } object apiclient { val apiservice: apiinterface by lazy { retrofitclient.retrofit.create(apiinterface::class.java) } } adding card data to samsung wallet to request cdata generation from the server and add the wallet card to samsung wallet: in the addtowalletbutton.setonclicklistener() method within the moviedetailactivity class, send a request to the server to generate cdata for the selected movie ticket. if cdata generation is successful, to add the movie ticket to samsung wallet, send an http request containing the cdata token to the following endpoint url: https://a.swallet.link/atw/v1/{card id}#clip?cdata={cdata token} for more information about this endpoint, see data transmit link. binding.addtowalletbutton.setonclicklistener { coroutinescope(dispatchers.main).launch { val response = apiclient.apiservice.getmovie(position) if(response.issuccessful && response.body()!=null){ startactivity(intent( intent.action_view, uri.parse("http://a.swallet.link/atw/v1/3aabbccddee00#clip?cdata=${response.body()!!.jwt}"))) // replace '3aabbccddee00' part with your card id } } } notethe generated cdata is valid for 30 seconds, so it is recommended to generate the cdata only when the "add to samsung wallet" button is clicked. if the cdata has expired by the time the token is sent to samsung wallet, the user can receive a "request timed out" error. generate signed wallet card data the server application must be configured to receive the card data request from the mobile application and return a signed jwt token. this part of the tutorial uses the spring boot framework. configuring the server project to create and configure a server application to generate and sign wallet card data: in the spring initializr tool or any supported java ide, create a spring boot project and open the sample code. to configure the server to receive rest api requests from the mobile application, add the "spring web" dependency to the project. define a token data class. make sure it has the same attributes as the tokenresponse data class defined in the mobile application. data class token(val status:string, val jwt:string initialize a tokencontroller class that receives the incoming requests and returns a token object in response. @restcontroller @requestmapping("movie") class tokencontroller { @getmapping(path = ["/{movieid}"]) fun getmovie(@pathvariable movieid:int): token { return token("success", "{dummy_cdata}") // cdata generation logic } } the cdata generation and signing logic is described in the next section. implementing card data signing logic for easier understanding, this section describes a simplified implementation of the cdata generation sample code. in the server application project, copy the following credential files to the "sample/securities/" directory. samsung public key from the samsung certificate ("samsung.crt") partner public key from your partner certificate ("partner.crt") partner private key from the private key file ("partner.key") to handle the certificate files and signing algorithms, add the following dependencies to the server application's "build.gradle" file: implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3' implementation 'org.bouncycastle:bcprov-jdk18on:1.77' in a new "jwtgen.kt" file, define a readcertificate() method that reads the public keys from the certificates and a readprivatekey() method that reads the private key from the key file. private val partner_id = "4048012345678912345" // replace with your partner id private val samsungpublickey = readcertificate(getstringfromfile("sample/securities/samsung.crt")) private val partnerpublickey = readcertificate(getstringfromfile("sample/securities/partner.crt")) private val partnerprivatekey = readprivatekey(getstringfromfile("sample/securities/partner.key")) fun readprivatekey(key: string): privatekey { val keybyte = readkeybyte(key) lateinit var privatekey: privatekey val pkcs8spec = pkcs8encodedkeyspec(keybyte) try { val kf = keyfactory.getinstance("rsa") privatekey = kf.generateprivate(pkcs8spec) } catch (e: invalidkeyspecexception) { e.printstacktrace() } catch (e: nosuchalgorithmexception) { e.printstacktrace() } return privatekey } fun readcertificate(cert: string): publickey { lateinit var certificate: certificate val keybyte = readkeybyte(cert) val `is`: inputstream = bytearrayinputstream(keybyte) try { val cf = certificatefactory.getinstance("x.509") certificate = cf.generatecertificate(`is`) } catch (e: certificateexception) { e.printstacktrace() } return certificate.publickey } private fun readkeybyte(key: string): bytearray { val keybyte: bytearray val bais = bytearrayinputstream(key.tobytearray(standardcharsets.utf_8)) val reader: reader = inputstreamreader(bais, standardcharsets.utf_8) val pemreader = pemreader(reader) var pemobject: pemobject? = null try { pemobject = pemreader.readpemobject() } catch (e: ioexception) { e.printstacktrace() } keybyte = if (pemobject == null) { base64.getdecoder().decode(key) } else { pemobject.content } return keybyte } fun getstringfromfile(path: string?): string { try { val file = file(objects.requirenonnull(classloader.getsystemclassloader().getresource(path)).file) return string(files.readallbytes(file.topath())) } catch (e: ioexception) { throw runtimeexception(e) } } generating card data cdata token generation is implemented in the "jwtgen.kt" file: read the file containing raw json data that defines the ticket data structure. for this demonstration, use the "ticket.json" file in the "sample/payload/" directory of the cdata generation sample code. generate or fill in the required ticket details. for example, the "{title}" and "{seatnumber}" fields are replaced with the movie title and seat number. for information about the complete json structure, see wallet cards. convert the json data to a jwe object. encrypt the jwe object with the samsung public key. build the custom jws header for samsung wallet cards. sign and validate the complete jws object with your partner private and public key using the rs256 asymmetric algorithm. this is the cdata token. private val currenttimemillis = system.currenttimemillis() private val plaindata:string = getstringfromfile("sample/payload/ticket.json") .replace("{refid}", uuid.randomuuid().tostring()) .replace("{language}", "en") .replace("{createdat}", currenttimemillis.tostring()) .replace("{updatedat}", currenttimemillis.tostring()) .replace("{issuedate}", currenttimemillis.tostring()) .replace("{startdate}", (currenttimemillis + timeunit.days.tomillis(1)).tostring()) .replace("{enddate}", (currenttimemillis + timeunit.days.tomillis(1) + +timeunit.hours.tomillis(2)).tostring()) fun generatecdata(moviename: string, movieticktno:string): string{ // modify data as needed val data = plaindata.replace("{title}", "\"$moviename\"") .replace("{seatnumber}","\"$movieticktno\"") //print(data) return generate(partner_id, samsungpublickey, partnerpublickey, partnerprivatekey, data) } private fun generate(partnerid: string, samsungpublickey: publickey, partnerpublickey: publickey, partnerprivatekey: privatekey, data: string): string { val jweenc = encryptionmethod.a128gcm val jwealg = jwealgorithm.rsa1_5 val jweheader = jweheader.builder(jwealg, jweenc).build() val encryptor = rsaencrypter(samsungpublickey as rsapublickey) val jwe = jweobject(jweheader, payload(data)) try { jwe.encrypt(encryptor) } catch (e: joseexception) { e.printstacktrace() } val payload = jwe.serialize() val jwsalg = jwsalgorithm.rs256 val utc = system.currenttimemillis() val jwsheader = jwsheader.builder(jwsalg) .contenttype("card") .customparam("partnerid", partnerid) .customparam("ver", "2") .customparam("utc", utc) .build() val jwsobj = jwsobject(jwsheader, payload(payload)) val rsajwk = rsakey.builder(partnerpublickey as rsapublickey) .privatekey(partnerprivatekey) .build() val signer: jwssigner try { signer = rsassasigner(rsajwk) jwsobj.sign(signer) } catch (e: joseexception) { e.printstacktrace() } return jwsobj.serialize() } returning the signed token in the server application code, when the server receives a request at the movie/{movieid} endpoint, the tokencontroller class calls the jwtgen.generatecdata() method with the movie id, which generates and returns the cdata jwt token in the api response. in this tutorial, since the movie ticket list was predefined in the mobile application project, make sure the same movie data class and list are defined here too. @restcontroller @requestmapping("movie") class tokencontroller { @getmapping(path = ["/{movieid}"]) fun getmovie(@pathvariable movieid:int): token { val movielists = listof<movie>( movie("the wallet", "samsung studios", "a-01"), movie("crying sea", "laplace studio","h-07"), movie("canoe", "terra productions", "r-03") ) if( movieid>2){ // implement your verification logic return token("failure", "") } else{ val cdata = jwtgen.generatecdata(movielists[movieid].name, movielists[movieid].ticketnumber) return token("success", cdata) } } } testing the application to test your "add to wallet" integration: connect the server and the mobile device to the same network. launch the server and mobile applications. in the mobile application, tap a movie ticket in the list. its detail page opens. tap add to samsung wallet. the server generates and returns the cdata token. the samsung wallet application launches on the device and the movie ticket information is added to it. figure 3: ticket added to samsung wallet summary implementing the "add to wallet" feature enables your users to add your digital content, such as tickets, passes, and loyalty cards, to the samsung wallet application on their mobile device as wallet cards. in addition to implementing the "add to samsung wallet" button in your mobile application, you must also create a server application that securely generates and signs the wallet card data and returns it to the mobile application for transmitting to samsung wallet. for more information about adding "add to wallet" to your application, see implementing atw button. you can also study the extended sample application (clicking this link downloads the sample code) and the api reference. if you have questions about or need help with the information presented in this article, you can share your queries on the samsung developers forum. you can also contact us directly for more specialized support through the samsung developer support portal. resources click the links below to download the sample code. android app sample code extended android app sample code cdata generation server sample code
Mobassir Ahsan
success story mobile
blogjeanne hsu, senior marketing manager for developer relations at samsung, chatted with yuki he, chairperson, ceo and founder of joyme. jeanne hsu (jh): yuki, what was your professional journey that led you to joyme? yuki he (yh): i entered the internet industry in 2003 and joined tencent in product management when they started their product team. i was doing entertainment and social apps like qq and qq pets. i enjoyed working in this industry and developed a more profound interest in social products. later on in 2013, i started working on overseas products, got familiar with the global internet market, and was responsible for a utility product. at that time, samsung also partnered with us to include our product. i also got a chance to visit samsung's south korean headquarters to discuss other partnership matters. in 2015, i participated in the entrepreneurial process of musical.ly (later became tiktok) as a director. i saw a promising future of combining live video and social interaction. i wanted to use both to connect people virtually and in real time no matter where they were located. i saw the vast opportunities in the u.s. market, so i left and decided to build my own company, joyme. jh: where is joyme located? yh: joyme is in various regions including the los angeles (u.s.), singapore, brazil, and the middle east. jh: how many employees work at joyme? yh: we have 500 people total including 300 employees and 200 contractors. jh: how did the relationship with samsung first start? yh: we published liveme in galaxy store in 2020. we already had a relationship with samsung from my previous work. so this was a natural extension of the partnership. jh: best of galaxy store award – 2021 best entertainment app for joyme's liveme app. what does it mean to win this award? yh: we take this award very seriously and especially thank samsung for the recognition. samsung has many users and is one of the largest store platforms in the world. samsung is a world-renowned company, with a prominent brand name. winning this award also gives us great motivation to continue creating even better products for samsung users. jh: in what ways have you promoted winning the award? yh: we have promoted this fantastic news through the media agency and received positive market feedback. we plan to promote the award-winning news through international media, liveme's social media, and the official website. we believe the recognition from samsung is going to boost our branding and let more samsung users get to know more about us. winning the award gives us great motivation to continue doing what we do best: give our users and the entertainment community the best service. liveme – 2021 best entertainment app jh: what have you noticed about mobile trends and liveme? yh: the mobile phone camera has changed people's lives when they interact with their phones. you can be anywhere in the world to connect online with people, show your talent, expand your circle of friends, and share parts of your life. bringing the community closer together is the original concept of liveme. i felt the video and interactive components were important. people can go online with liveme and feel happier. jh: are there any unique aspects or optimizations to the galaxy store version of liveme? yh: we integrated the payment channel sdk with the samsung iap (in-app purchase) sdk. our base operation is android. galaxy store is very good for the developer so we don't have to do different versions. it saves a lot of time and resources. in the future, we hope to have deeper integration with samsung. jh: how did you come up with the concept for liveme? yh: in 2015, livestream video was not as popular as it is now; people took pics. but the camera performance on mobile phones was becoming more sophisticated and advanced. i found that many users gradually developed taking videos on their mobile phones. video is a richer content carrier than still images or plain text. i could see the future of information transmission trends. then video transmission changed; it was faster and people could send full rich videos instead of choppy/frozen bits of pixels. now instead of just watching a video, people could interact with live video streams. users could respond with comments or emojis in real time. the live-stream video experience further enhanced the connection between people. for example, people can stay at home and make friends all over the world. they use this platform to show off their talents. having this vision of connecting the world was the original idea that inspired me to develop liveme. broadcasters and business model jh: i noticed on facebook that liveme's tagline reads: “create content, meet friends, and make money.” tell me more about liveme and the business model. how do the broadcasters make money? yh: broadcasters earn money by presenting engaging content in their livestream channel. they can build up a global fan base. then viewers can send virtual gifts to show their appreciation. they also encourage people to subscribe to their channel. for example, out of 100k people that enter a broadcaster's room, 20% could give them gifts like flower animations and virtual diamonds. the more gifts they receive from their fans, the better. it shows a very active community. some broadcasters see this as a hobby, but some make it their professional career. we're not talking about famous celebrities who have their own channels but rather the uber driver, bar singer or amateur dancer. they can use liveme as an entertainment channel and make money doing it as a living. we help 300,000 broadcasters earn money in the u.s. globally we have a million broadcasters that are making good money via liveme. it's a very powerful story. not only do they receive gifts from their fans, but they also get benefits from liveme. we also give the broadcasters gifts depending on the volume and activity of their fan base. it helps incent broadcasters to generate new content. every month, we give several millions of u.s. dollars to the broadcasters. what's more, we have an ongoing plan with a $60 million investment to support our broadcasters and creators. we're able to offer jobs to people all over: in the u.s., brazil, japan, and the middle east, just to mention a few. jh: what a strong message. “we believe in you, and are willing to pay you for your creativity attracting a large fan base.” it's an intriguing business model. what else are broadcasters doing to increase their audience? yh: we have talented broadcasters who create content and make friends by livestreaming. they can interact with viewers. fans can also beam in to the “room”, do challenges and play mini games with the broadcasters. there can be up to nine people in a livestreaming room. youtube cannot do that. fans then become part of the action with other community members. and there are more people who are commenting, giving gifts, and cheering these people on. having this very interactive community lends itself to many creative ideas. we can combine games with the livestreaming: in soccer, the broadcaster guards the goalpost and another person kicks the ball, in real-time. people can play casual games together. then the community interacts as they play games, dance or sing. it's very entertaining! app ideas, discoverability and reach jh: how many apps has joyme published, and how many are on galaxy store? yh: liveme and photogrid are the two main apps of joyme. liveme is a live video social app and photogrid is a video and photo editing app. both liveme and photogrid are on galaxy store. jh: where do you get your app ideas? yh: user feedback is important to us. they give us ideas and inspiration. we learn from other apps (funny and creative ideas from games and apps). we'll also run campaigns to celebrate special events like our 6th birthday this past april; fans sent us video birthday cards. we do marketing research to see if there is new technology we could use. for example, new technologies like virtual character ai improves the user creative experience in our apps. jh: what is the work flow when designing, developing and publishing an app? yh: there are six steps for our app development and publishing. first, we need to list out the product project needs. it is necessary to determine the project's overall plan, the timeline, the general framework, the main functions, and the core belief of the app. what are the needs of target users? what kind of value can this app create for the user? once the app has its primary functions defined, we research to understand potential competitors and competitive environment. for example, is it a saturated market or a competitive market? next is the realization of the app function by designing the first draft of ui and ux. after multiple meetings and rendering, we will have the final interface design ready. the product will then enter the research and development stage. while forming the app with programming, we prepare everything in the app store account for release. the next step is to test the app. we test the app thoroughly before release by having internal test users test the first version and extract user feedback to improve and optimize the user experience. finally, it is time to publish the app. we'll use the app store account to release and publish the tested app, and leave three to five days to fix any bugs after the app is released. jh: with all the competition for apps, what has been your strategy for discoverability? yh: we buy ads traditionally from google and meta, etc. every app developer does that. but we have a community of broadcasters who can promote our apps as well. they will share their live-steaming with their fans by cross-promoting from other channels they've cultivated. we can see that more people are making friends and enjoying the interaction with the broadcasters. friends are telling others about broadcasters that appeal to them. there's nothing more compelling than the “tell a friend” concept. we do some pr and marketing events. before covid, we used to do live in-person promotions with iheartradio; one was for the event music house. we hosted parties in la and san francisco with broadcasters, asking them to invite their friends to join in. we found that people share their experiences on social media. it was a fun way to promote the liveme app to their friends. now we hold other online events, building on our platform, so people worldwide can participate. jh: what has been your strategy for generating revenue? yh: liveme generates revenue by iap (in-app purchases) for virtual gifts to support favorite broadcasters or participate in in-app events. to encourage users to be more engaged, we create monthly competitions with different themes, holidays, and unique virtual 3d animation gifts to best express users' distinct support styles. jh: in the last five years, liveme is in 85 countries. how do you attribute your growth and expansion? yh: liveme started with multiple tests and trials in a few countries to build a solid foundation. in the early stages, it is necessary to confirm if the product provides valuable services for users that reflect the actual demand in a pilot before launching a large-scale expansion. the internet industry is getting so competitive that users' needs and requirements change every second. it is truly a great challenge for our developers. our fundamental strategy is making good products and services that genuinely exceed user expectations. joyme has also been exploring and improving under the same principle. jh: what is in the future for joyme / liveme? yh: our mission is to "connect the world and spread happiness." joyme will continue to devote itself to creating exciting pan-entertainment products. in the future, we will also develop immersive meta-universe experience products. everyone is facing different obstacles in life under the influence of the pandemic, so i hope joyme can create products that give more companionship, happiness, and love to bring our global users together. feedback and advice jh: what advice would you give developers looking to bring their apps to galaxy store? yh: for specifics about galaxy store, i recommend the following: become familiar with the policy for galaxy store. if developers ignore this, their apps will soon be off-line. understand how to control the risk of payments. different platforms have varying risks. get good feedback from users and cooperate with samsung. we do activities together with samsung and benefit from their promotions. incent galaxy store users. we give gifts to galaxy store users, such as free coins to buy gifts to send to broadcasters. it encourages users to buy more coins and engage with liveme. jh: why is it important to offer your app on galaxy store? yh: our main market is the u.s. and samsung has a major presence there. marketing jh: what are some of the ways you promote liveme? yh: here are our websites and channels: website - https://www.liveme.com/ facebook - https://www.facebook.com/streamliveme/ twitter - https://twitter.com/streamliveme (@streamlivem) youtube - https://www.youtube.com/c/livemeofficial/featured instagram - https://www.instagram.com/streamliveme/ diversity and inclusion jh: what is joyme doing related to diversity and inclusion? yh: joyme supports multiple languages and is available in many countries, so focusing on content localization based on local culture, trends, and holidays is essential. we are committed to meeting the needs of our diverse users and respecting different cultures and religions. our goal is to create a supportive community that includes all races, religions, and cultures to connect users in the various regions. our management team is 40% to 50% women; some of them have been with me for more than five years, building a good relationship with each other. we also have offices in eight countries with different nationalities and cultures, all working together. jh: i understand you were involved in the women's entrepreneurship day (wed) summit. tell us more about that. yh: yes, thanks for asking. this international annual wed summit empowers women and girls worldwide to alleviate poverty their communities. i spoke to encourage them to become active participants in the economy by becoming leaders, innovators, and entrepreneurs. it gave me an opportunity to share my story with young women from all over the world and highlight how liveme is empowering women to share their talents and follow their passions. fun jh: what do you do for fun outside of work? yh: i enjoy playing different sports and fitness; i am also into singing. i was the singer of the official theme song "song of tencent" for tencent. i participated in many singing competitions during my college years and was pretty good at it. if i didn't become a product manager in the internet industry, i would probably have become a singer. yuki singing in fact, that was one reason i launched liveme. i started out as a broadcaster and gained a lot of fans by singing and dancing. everyone has the opportunity to grow their channel. nobody knew i was the ceo of the company. once they found out, they said “i knew yuki before as a broadcaster.” now, i leave the broadcasting to the other talent. jh: it's great you started as a broadcaster. so you know firsthand how to showcase your singing and dancing talents. kudos to you! thank you so much for this interview yuki. yh: you're very welcome. i am happy to chat with you. additional resources on the samsung developers site the samsung developers site has many resources for developers looking to build for and integrate with samsung devices and services. stay in touch with the latest news by creating a free account and subscribing to our monthly newsletter. visit the marketing resources page for information on promoting and distributing your apps. finally, our developer forum is an excellent way to stay up-to-date on all things related to the galaxy ecosystem.
Jeanne Hsu
events game, mobile
blogbeing the host of the samsung developers podcast, i have had the opportunity to interview many great game developers over the years, but had yet to immerse myself in the gaming community. that was until i attended gdc 2022, the game developers conference held at moscone center in san francisco. gdc is the premiere conference related to the gaming industry. the annual conference brings together game designers, audio producers, programmers, artists, writers, and many more industry professionals from all around the world. networking at the expo as with most conferences, networking was one of the key benefits of being at an in-person conference. walking the expo floor allowed me to chat with so many amazing tech companies to learn about the latest game development tools and services. dolby. connecting with the reps at dolby, we talked about the different ways our team at samsung can help promote dolby atmos, their simulated surround sound technology available on samsung devices, to mobile game developers. wigi. the amazing people at wigi (women in games international) are doing great things. i learned how they are impacting the global games industry to advance economic equality and diversity for women and their allies. sequence. as i explored the expo, i was on the lookout for anything related to web3 and nfts. the team at sequence told me how they are helping game developers build for web3 and the world of nfts in the marketplace/metaverse, and simplifying crypto-transactions for gamers. sessions & sessions, and more sessions the expo floor was a great quick overload of everything game-tech-related, but the sessions allowed for a more comprehensive learning environment on many diverse game development topics. during the five-day conference, i attended over 25 sessions, learning in great detail from many inspirational speakers. sessions covered everything from designing and programming, to business and marketing, and so much more. below are highlights from several of my favorite sessions. free-to-play summit: the f2p game design challenge steve meretzky, abigail rindo, fawzi mesmar, shelby moledina, amanda schuckman free-to-play has dominated the gaming market and has intrigued me because it is a big part of mobile gaming. this session was very insightful as each of the different teams pitched their game ideas, explaining how they would generate revenue within a free-to-play game. the winners of this challenge quickly became audience favorites with their animal sanctuary game concept and real-world connection, giving players the opportunity to donate to their favorite animal foundation. session description: for many years, the game design challenge was one of the most popular sessions at the gdc. now, the advisory board of the free-to-play summit is proud to revive this gdc tradition, with a free-to-play focused version of the challenge. four free-to-play designers will have been given marching orders, and tasked with designing a game around that given problem. all four will present their idea to the summit audience, followed by an audience vote. innovative thinking and lively presentations are in store for all attendees! the theme of this year's challenge is designing for minnows. free-to-play games are almost always tuned to extract most of their revenue from "whales" -- those super-fans of the game who spend the big bucks, while the other 99.9% of the game's players spend little or nothing on it. we've challenged three free-to-play designers to come up with a design for a game that will extract the vast majority of its revenue not from "whales" but from "minnows" ... players who, over their entire lifetime, spend $10 or less. lost words: beyond the page dan gabriel of all the sessions that i attended, this one touched me the most. i wanted to learn more about the importance of narrative within the gameplay but received so much more from this session. dan gabriel’s approach to public speaking felt more like a storyteller than a conference speaker. lost words: beyond the page is not just a game, but a way for people to learn about themselves as they experience the challenges of life. session description: lost words: beyond the page leads the player into a rabbit hole of emotions to emerge, weary but fulfilled, on the other side of grief. attend to see how narrative and gameplay work together to create a deep, emotional bond. how metaphors pull the player deeper into the experience and how psychology shaped a story of a girl, a gran and a fantasy world. 'unpacking': the fun behind the foley jeff van dyck i love sound and everything that comes with the production of capturing sound effects (foley). seeing how this small team (husband, wife, and daughter) took on the challenge of not only creating 14,000 unique sounds, but also integrating all 14,000 sound files into the game and how that created its own set of challenges. session description: "unpacking has 14,000 foley audio files!" was a tweet that went viral in nov 2021. audio director and composer jeff van dyck (alien isolation, total war, ea sports) takes us through the unexpected complexity he and his wife angela encountered while they produced the foley for unpacking. understanding nfts: a sea-change for f2p games jordan blackman this session was exactly what i was hoping for: more insight into the new world of nfts (non-fungible tokens), blockchain, and crypto, and how they can impact f2p (free-to-play) games. as web3 games are developed, we will see more disruption to the current f2p space because these games are powered by the player community and not a single entity. session description: nfts are a consumer-driven phenomenon growing at dizzying speeds. more than merely a new way to offer iap, nft technology is set to disrupt game fundraising, community development, social media marketing, and even the very nature of the consumer/creator relationship. in this session, game designer jordan blackman will show the surprising ways nfts are already changing the game, as well as some predictions of what is to come. 'wordle': doing the opposite of what you're meant to josh wardle i am one who has definitely been swept up in the wordle craze, and getting to hear from the creator of wordle, josh wardle ... yes that is his name, was fascinating. the story of how he created the game was simple. the stories he shared about the simple connections people were making through sharing their daily wordle were absolutely wonderful. session description: wordle went from a personal gift to a global phenomenon in 3 months. this talk explores the decisions that were made throughout its development that run contrary to conventional wisdom around building successful mobile games, from wordle's origins to its seven-figure sale to the new york times. the talk also explores the human elements and considerations of creating, growing, and selling a game, both from the perspective of the developer and the game's audience. gdc vault: stream on-demand even though the conference has concluded, many of the sessions will be available to stream on-demand through the gdc vault. sponsored sessions are available for free, while technical sessions and gdc show content will require a paid subscription. if you are looking for samsung content, be sure to check out the following samsung sessions that were presented at gdc. you can view two of the sessions on youtube and all are available on the gdc vault. game performance optimization with causal models youtube · gdc vault what if your phone's avatar is in the game or metaverse? youtube · gdc vault new gpu, the ultimate reality! gdc vault unfolding your gaming potential with galaxy gamedev gdc vault awards show celebration the high point of the conference definitely was the awards show, presented by both the independent games festival and the game developers choice awards. the evening was full of recognizing not only the amazing winners, but all those nominated and truly how creative, innovative, and engaging the past year in game development has been. you can check out the full awards show below. inscryption the big winner of the evening was inscryption, taking home not only game of the year from game developers choice awards, but also the grand prize award from igf, along with awards for excellence in audio, excellence in design, and excellence in narrative. game description: from the creator of pony island and the hex comes the latest mind melting, self-destructing love letter to video games. inscryption is an inky black card-based odyssey that blends the deckbuilding roguelike, escape-room style puzzles, and psychological horror into a blood-laced smoothie. darker still are the secrets inscrybed upon the cards... unpacking the viral game with over 14,000 sounds somehow turned the painstaking task of unpacking boxes into an experience of peace and tranquility. unpacking won both the game developers choice award for best innovation and for best audio. game description: unpacking is a zen game about the familiar experience of pulling possessions out of boxes and fitting them into a new home. part block-fitting puzzle, part home decoration, you are invited to create a satisfying living space while learning clues about the life you're unpacking. over the course of eight house moves, you are given a chance to experience a sense of intimacy with a character you never see and a story you're never told. papetura the game i am most excited about is papetura, winners of igf’s excellence in visual art award. the mysterious and artistically quirky world is an absolute pleasure for the eyes, playing out in a real-life, stop-motion world. game description: papetura is an atmospheric point & click adventure game, handcrafted entirely out of paper. little creatures pape and tura will face monsters that will try to burn down their beloved paper world. closing these are just a few of the many highlights i experienced during gdc this past year. explore the gdc vault for yourself to experience gdc 2022 and impact the game developer community with whatever your expertise may be. see you at gdc 2023, march 20-24 in san francisco! official conference photos were made available via the gdc flickr account: www.flickr.com/photos/officialgdc. learn more about gaming trends and samsung’s participation at this year’s game developers conference here. be sure to also follow us on @samsung_dev to keep up-to-date on the latest developer news, and keep an eye on our blogs for other helpful resources. you can also sign up for the samsung developer program to take advantage of exclusive benefits and access helpful developer resources.
Tony Morelan
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.