0

Lets imagine I have a backField with data below:

{
    key:"key-1",
    attributedValue:"<a href='https://somewhere.com'>Link</a>",
    changeMessage: "Key-1 field changed:%@"
}

I wish to display user friendly - Key-1 field changed:Link at the lock screen when push notification arrives, instead of - Key-1 field changed:<a href='https://somewhere.com'>Link</a>.

Is there any option to achieve it?

Maris
  • 4,608
  • 6
  • 39
  • 68

1 Answers1

0

Remove changeMessage from your back field.

Now, create a special back field with the content of your push message and set its changeMessage to %@.

alphageek
  • 770
  • 4
  • 15
  • So in my case I will have to add a saparate backField with next data: `{ key:"key-333", value:"Link", changeMessage: "%@" }` And in that case both back fields will appear in pass, one with the real link and one with the text- `Link`. – Maris May 27 '16 at 18:34
  • @Maris where should I add this link in pass.json ? can you please give example – M.A Jun 30 '17 at 04:07
  • @M.A Just add it to Backfields. – Maris Jun 30 '17 at 15:54
  • @Maris thanks for your response. this is how your saying ? `{ "key": "memberid", "value": "", "label": "ID# 123456", "textAlignment" : "PKTextAlignmentLeft" } ], "backFields": [ { "label": "MOBILE TERMS:", "key": "info", "value" : "MOBILE TERMS ", changeMessage: "%@" } ]` – M.A Jun 30 '17 at 16:01
  • Console : `xxx.xxx.xxx.xxx - - [30/Jun/2017:09:34:42 -0700] "GET /push.php HTTP/1.1" 200 188 xxx.xxx.xxx.xxx - - [30/Jun/2017:09:34:43 -0700] "GET /v1/devices/af56c0d12bdbnf6kkatt3aa5c10d0dg64/registrations/pass.test.com.mymobileDomain?passesUpdatedSince=2017-06-30%2009:23:06 HTTP/1.1" 200 68 ` – M.A Jun 30 '17 at 16:41
  • @M.A Yeap and if you then will send a push notification and change the Backfields to: `[ { "label": "MOBILE TERMS:", "key": "info", "value" : "New cool mobile terms", changeMessage: "%@" } ]` users will receive a popup message - `New cool mobile terms` – Maris Jun 30 '17 at 19:14
  • @Maris you are great.. one question you have any idea about this maybe you also encounter. im able to push new changes but doesn't appear on phone until I disable my auto update and enable ? – M.A Jun 30 '17 at 19:18
  • @M.A we have faced a lot of problems depending on platform/wallet application on platform/tons of different configuration on phone or wallet application/roaming settings/internet availability. Just keep in mind that you cannot guarantee that your customer will receive in push notification. Real facts about our experience, we have >100k passes in production, consumed by ~150k users and only ~145k end-users receives push notifications. You should leave with that pain. There is also tons of wallet specific things, you will find them in your development path. Good luck! :) – Maris Jul 02 '17 at 18:25
  • @M.A BTW, you can find my skype account in my profile. Feel free to contact in a case of questions. – Maris Jul 02 '17 at 18:31
  • Just Added on skype ... thank you so much... my problem is if im able to push new card only one time on one device successfully it will be great. i have no problem if 1k pushed 800 able to receive. minimum i know my code is working. – M.A Jul 03 '17 at 00:39