Monday, December 23, 2024

Carry Your Customized Card to Samsung Pockets

Samsung Pockets is introducing a brand new characteristic referred to as “Generic Card” for companions who can’t use different card varieties to satisfy their enterprise necessities. This gives flexibility to switch numerous area labels for the cardboard, in line with the companions’ enterprise wants.

Different playing cards, corresponding to boarding passes and coupons serve a particular goal, and their area labels can’t be modified. Nonetheless, with a generic card, the label may be modified so it may be used for a number of functions.

On this article, you learn to modify a generic card to make use of it as an insurance coverage card. We are going to clarify the small print specification with instance of the generic card. On the finish of the article a information will probably be offered to implement this card on your reference, that will help you modify your generic card in line with your wants.

Card setup

Earlier than you start creating a brand new card template, log in to the Samsung Pockets Companion web site and create a generic card.

  1. Log in to the Samsung Pockets Companion web site.
  2. Go to the Pockets Playing cards after which Create Pockets Card. For extra particulars about making a card, test the Handle Pockets Playing cards documentation.
  3. Choose Generic Card from the accessible card templates.
  4. Modify the cardboard info.

When you will have completed modifying card info, launch the cardboard to finish card setup. For extra info on launch the cardboard, see Launch Pockets Playing cards.

Template editor

Use the template editor to switch the cardboard template.

  1. From the “CardArt” view, you possibly can modify the cardboard shade, set a background picture or change the brand picture properties.
  2. From the “Enlarge” view, you possibly can modify the {{text1}} and {{text2}} labels. Nonetheless, solely the label itself may be modified within the Template Editor. To set the label worth, it’s worthwhile to replace the JSON file.
  3. From the “Element” view, you possibly can modify the “TextGroup” and “AppLink” properties. Modify the textual content label in line with your wants. It’s also potential so as to add new textual content fields, with a most of 12 textual content fields allowed.

After each modification, click on Save. Lastly, apply all modifications by clicking Apply. If you wish to preview your modifications, simply click on Preview.

Add to Samsung Pockets

Now that the cardboard has been created within the web site, it is able to be distributed to satisfy your corporation wants.

  1. Implement the “Add to Samsung Pockets” performance to the platform the place you’re planning to distribute the playing cards.
  2. When customers click on “Add to Samsung Pockets,” the cardboard is added to the Pockets software on the consumer’s Galaxy system. This performance may be added by the appliance/cellular net, MMS, or e mail.
  3. Moreover, you should use a QR code on a pc net browser and KIOSK. Samsung gives a Codelab information for builders in order that they will simply perceive the implementation. For added info on the Codelab information, learn Make the most of the Add to Samsung Pockets service for digital playing cards. Additional particulars will also be discovered within the Implementing ATW button documentation.

Card specs

To finish the “Add to Samsung Pockets” button implementation, you should generate the Card Knowledge token and create a last URL. For extra info, see Add to Samsung Pockets. Let’s begin by reviewing the generic card specs to generate the Card Knowledge token. The generic card follows the specs under. For extra info on them, see the Generic Card part.

Title Description
Title The primary title of the generic card. Within the pattern card, the title is “Card Title.” Within the picture under, the title is “Insurance coverage Identification Card.”
Subtitle The subtitle of the generic card. Within the pattern card, it’s “Card Subtitle”.
providerName Use this area to set the cardboard supplier identify. For extra info, test the Card JSON Instance under. Nonetheless, the supplier identify depends upon your card kind and must be modified accordingly.
eventId Enter an ID as an occasion identifier. In case your card is pay as you go, for instance a present card, or you probably have vouchers to occasions, corresponding to concert events, it’s potential to outline an occasion ID. As an illustration: “event-001”.
groupingId Enter an identifier to group associated playing cards.
startDate Enter the beginning date and the epoch timestamp in milliseconds.
startDate.relativeNotiTime Enter the period of time inside which you need to present a notification to the consumer. The notification time is the relative time from the startDate. The worth may be as much as 2880 milliseconds.
endDate Enter the tip date and the epoch timestamp in milliseconds.
endDate.relativeNotiTime Enter the period of time inside which you need to present a notification to the consumer. The notification time is the relative time from the endDate. The worth may be as much as 2880 milliseconds.
logoImage Set the brand picture URL. The file dimension should not exceed 256 KB. Additionally this picture may be set from the Template Editor.
logoImage.darkUrl Set the brand picture URL for the darkish mode. The file dimension should not exceed 256 KB.
logoImage.lightUrl Set the brand picture URL for the sunshine mode. The file dimension should not exceed 256 KB.
bgImage Set the background picture URL. The file dimension should not exceed 512 KB.
textual content{i} Set the label-text worth that must be displayed for every area containing the small print of your card. The label is outlined within the Template Editor, proven within the picture under.

To set the worth of the label, replace the JSON file.

picture{i} Enter the picture URL, corresponding to: “https://www.samsung.com/photographs/image1.png”. This URL is simply an instance, you should replace it in line with your wants. This area solely works in Generic Card Type3. We now have used a Type1 card within the instance. So this area within the instance JSON has no impact on the cardboard. You will discover all three card kind pattern UIs right here.
picture{i}.lightUrl Enter the picture URL in gentle mode, corresponding to: “https://www.samsung.com/photographs/gentle.png”. This URL is simply an instance, you should replace it in line with your wants.
picture{i}.darkUrl Enter the picture URL in darkish mode, corresponding to: “https://www.samsung.com/photographs/darkish.png”. This URL is simply an instance, you should replace it in line with your wants.
serial{i} Set the serial for barcode or QR code.
serial{i}.serialType Serial presentation kind. For extra info on the Presentation Varieties (serialType), see References.
serial{i}.ptFormat Set the presentation format. For extra particulars on the presentation codecs (ptFormat), see References.
serial{i}.ptSubFormat Set the presentation subformat right here. For extra particulars on the barcode codecs (ptSubFormat), see References.
serial{i}.errorCorrectionLevel Set the error correction ranges on this area. The quantity of redundancy or error correction information included within the code varies. QR codes provide 4 ranges of error correction: L, M, Q, and H. The QR area appears to be like like the next in your card:

  • undefined
  • undefined
privacyModeYn Set the consumer authentication if required. Set the worth to “Y” or “N”
bgColor Set the cardboard artwork shade.
fontColor Set the cardboard artwork font shade.
noNetworkSupportYn Set the worth to “Y” to open the pockets card when below the “No community” standing. In any other case, set the worth to “N”
noticeDesc Set the the discover description right here. See the picture under of how it’s added to card.
appLinkLogo Add the appliance hyperlink brand URL on this area.
appLinkName Add the appliance hyperlink identify on this area.
appLinkData Add the appliance hyperlink URL on this area.
places Listing of places the place the cardboard will probably be used. This info can be utilized to offer location-based providers. Samsung Pockets can use this info to point out maps, names of locations, and addresses. For extra info on the places area and JSON format, test References.

Card JSON instance

In earlier sections, you will have discovered concerning the card specs. Subsequent, let’s implement the generic card fields in line with your wants. On this part, because the purpose is to create an insurance coverage card, you should use the fields accordingly.

Samsung gives a particularly formatted JSON construction. It’s worthwhile to configure the cardboard information objects throughout the construction’s information array. For extra particulars, see the Generic Card part.

{
    "card": {
        "kind": "generic",
        "subType": "others",
        "information": [
            {
                "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 material":["DESCRIPTION1","DESCRIPTION2"]}]}",
                    "appLinkLogo": "https://www.samsung.com/brand.png",
                    "appLinkData": "https://www.samsung.com/",
                    "appLinkName": "Samsung Insurance coverage Co.",
                    "places": "[{"lat": 37.2573276, "lng": 127.0528215, "address": "Suwon", "name": "Digital City"}]"
                }
            }
        ]
    }
}

Now, you possibly can check the generic card with the “Add to Pockets” check instrument offered by Samsung. Simply observe these steps:

  1. Check in to the Add to Pockets check instrument. For extra info, see the Samsung Pockets Take a look at Device.
  2. Enter the personal key within the “Enter Companion Personal Key” area.
  3. On this instrument, you discover all playing cards that you’ve got created from the Samsung Pockets Companion web site within the “Choose Card” part. For extra info, see the Samsung Pockets Companion web site.
  4. Choose the generic card that you’ve got simply created.
  5. Now choose JSON from the Knowledge area and modify the present JSON information fields in line with the cardboard specification particulars.
  6. After modifying the JSON information fields, test if the JSON is legitimate.
  7. Lastly, if the personal secret is legitimate, the “Add to Samsung Pockets” button turns into lively on the backside of the web page. Then, simply click on Add to Samsung Pockets to complete including the generic card.

If you happen to use the offered instance JSON and add the cardboard to the pockets, the cardboard appears to be like like the next:

Server integration

On this step, server configuration is required as a result of the generated JWT token expires after 30 seconds. Builders are suggested to solely generate this token after a consumer has clicked the “Add to Pockets” button. As you will have already carried out testing with the “Add to Pockets” check instrument, it’s worthwhile to configure your server.

For extra info on the implementation of each the “Add to Samsung Pockets” button and server-side logic, see Implementing “Add to Pockets” in an Android Software. This text explains how one can distribute your card along with your Android software and generate the JWT token at runtime, after urgent the “Add to Samsung Pockets” button.

Conclusion

You could have now discovered the fundamentals for arrange a generic card and check it for your corporation wants. In case you will have additional questions, contact Samsung Developer Assist.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles