{"id":11512,"date":"2018-10-22T10:16:27","date_gmt":"2018-10-22T10:16:27","guid":{"rendered":"https:\/\/passkit.com\/blog\/?p=11512"},"modified":"2021-01-22T18:21:36","modified_gmt":"2021-01-22T18:21:36","slug":"how-to-engage-your-customers-with-the-apple-wallet-changemsg","status":"publish","type":"post","link":"https:\/\/passkit.com\/blog\/how-to-engage-your-customers-with-the-apple-wallet-changemsg\/","title":{"rendered":"How to engage your customers with the Apple Wallet changeMsg"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">A few months ago one of our client&#8217;s wanted a solution that would push engaging messages to their customers passes based on their activity. Using the <a href=\"https:\/\/passkit.com\/api\/\">Passkit API<\/a> this is a very straightforward task but I thought it would be good to document the use case in the hopes that it might inspire someone else to utilize the same features.<\/span><\/p>\n<p>This post won\u2019t go into how our clients CRM system works or the technology we used to handle the processing. I will only be going over the features in Apple Wallet and the Passkit API that allowed the solution to work. Also, this post assumes that you already have the knowledge on how to create and update passes and templates.<\/p>\n<p>Firstly, for the sake of the demo, I should point out that our client&#8217;s customer database had fields that could drive actions. Let\u2019s assume that\u00a0we have a data model for customers that includes a birthday. We can use that to drive meaningful push notifications to our customers.<\/p>\n<hr \/>\n<p><strong> Apple Wallet changeMsg<\/strong><br \/>\n<span style=\"font-weight: 400;\">Apple Wallet extends a very useful field called changeMsg. When changeMsg is updated, a push message notification is sent to the user&#8217;s device with a message that you can define.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The change message field is defined in your pass template on the back of the pass. More information can be found <a href=\"https:\/\/passkit.com\/api\">here<\/a><\/span><\/p>\n<p>Let\u2019s say that\u00a0we wanted to add the changeMsg to you current pass template, all\u00a0we need to do is update\u00a0our template to include this field to\u00a0the backfields:<br \/>\n[javascript]<br \/>\n{<br \/>\n&#8220;back&#8221;: [{<br \/>\n&#8220;defaultValue&#8221;: [{<br \/>\n&#8220;changeMsg&#8221;: &#8220;%@&#8221;,<br \/>\n&#8220;defaultLabel&#8221;: &#8220;Latest updates&#8221;,<br \/>\n&#8220;defaultValue&#8221;: &#8220;#{message}&#8221;,<br \/>\n&#8220;format&#8221;: {<br \/>\n&#8220;type&#8221;: &#8220;text&#8221;,<br \/>\n&#8220;dateFormat&#8221;: &#8220;medium&#8221;,<br \/>\n&#8220;numberFormat&#8221;: &#8220;decimal&#8221;<br \/>\n}<br \/>\n}]<br \/>\n}]<br \/>\n}<br \/>\n[\/javascript]<\/p>\n<p style=\"text-align: center;\">Updating\u00a0the template will add a new backfield with the label Latest Updates to\u00a0our pass as seen below<\/p>\n<p><a href=\"https:\/\/dxjl3qy52c1o9.cloudfront.net\/wp-content\/uploads\/2018\/10\/22040155\/Screen-Shot-2018-10-22-at-11.58.58-AM.png\" target=\"_blank\" rel=\"noopener\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-11521 aligncenter\" src=\"https:\/\/dxjl3qy52c1o9.cloudfront.net\/wp-content\/uploads\/2018\/10\/22040155\/Screen-Shot-2018-10-22-at-11.58.58-AM.png\" alt=\"Screen Shot 2018-10-22 at 11.58.58 AM\" width=\"427\" height=\"769\" title=\"\"><\/a><\/p>\n<hr \/>\n<p>Now that we have updated our template, the next thing to do is update the field with the message that we want.<\/p>\n<p>Let\u2019s say that\u00a0we decide to run a batch job every day that checks all of your customers to see if it anyone&#8217;s birthday if it is, they should receive a personalized push notification on their device.<\/p>\n<p>To send a push notification to the customer&#8217;s device, all\u00a0we have to do is update the message field in the dynamicData of the pass:<br \/>\n[javascript]<br \/>\n{<br \/>\n&#8220;dynamicData&#8221;: {<br \/>\n&#8220;message&#8221;: &#8220;Happy Birthday Jesse! Come in today for a free gift&#8221;<br \/>\n}<br \/>\n}<br \/>\n[\/javascript]<\/p>\n<p style=\"text-align: center;\">A push message notification will be sent to the user with your specified message<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/dxjl3qy52c1o9.cloudfront.net\/wp-content\/uploads\/2018\/10\/22040635\/Screen-Shot-2018-10-22-at-12.06.08-PM.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"alignnone size-full wp-image-11523\" src=\"https:\/\/dxjl3qy52c1o9.cloudfront.net\/wp-content\/uploads\/2018\/10\/22040635\/Screen-Shot-2018-10-22-at-12.06.08-PM.png\" alt=\"Screen Shot 2018-10-22 at 12.06.08 PM\" width=\"422\" height=\"766\" title=\"\"><\/a><\/p>\n<p style=\"text-align: center;\">The back of the pass will then be updated with the latest message<\/p>\n<p><a href=\"https:\/\/dxjl3qy52c1o9.cloudfront.net\/wp-content\/uploads\/2018\/10\/22040201\/Screen-Shot-2018-10-22-at-11.59.27-AM.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"size-full wp-image-11522 aligncenter\" src=\"https:\/\/dxjl3qy52c1o9.cloudfront.net\/wp-content\/uploads\/2018\/10\/22040201\/Screen-Shot-2018-10-22-at-11.59.27-AM.png\" alt=\"Screen Shot 2018-10-22 at 11.59.27 AM\" width=\"408\" height=\"769\" title=\"\"><\/a><br \/>\n<strong>**The change message filed will only update if the message field is\u00a0different from the one currently there, so be careful not to send duplicate messages, as they will not trigger the lock screen notification**<\/strong><\/p>\n<p>Please feel free to let us know any other interesting use cases that you have found where the changeMsg\u00a0made a big difference. We love to hear about the cool stuff people are building.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few months ago one of our client&#8217;s wanted a solution that would push engaging messages to their customers passes based on their activity. Using the Passkit API this is a very straightforward task but I thought it would be good to document the use case in the hopes that it might inspire someone else [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":13754,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,15,16,31,33,37],"tags":[55,57,58,61,138,163,212,231,249,264,266,274],"class_list":["post-11512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apple-wallet","category-blog","category-case-studies","category-mobile-wallet-2","category-passkit-api","category-tech","tag-apple","tag-apple-passbook","tag-apple-pay","tag-apple-wallet","tag-digital-wallet","tag-how-to-use-passkit","tag-mobile-marketing","tag-pass-kit-api","tag-passbook-ideas","tag-passbook-samples","tag-passbook-solutions","tag-passkit"],"_links":{"self":[{"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/posts\/11512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/comments?post=11512"}],"version-history":[{"count":2,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/posts\/11512\/revisions"}],"predecessor-version":[{"id":15959,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/posts\/11512\/revisions\/15959"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/media\/13754"}],"wp:attachment":[{"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/media?parent=11512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/categories?post=11512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/tags?post=11512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}