{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"iOS: Relevance Score","type":"basic","slug":"ios-relevance-score","excerpt":"A guide to relevance scores in iOS push notifications.","body":"From iOS 15, Apple has introduced the `relevance-score` field for iOS push notification payloads. It is designed to be used in conjunction with the new 'Notification Summary' that can be used to group notifications received into regularly scheduled summaries. The relevance score helps the device to determine the relative importance of your notifications and display them accordingly in the summary. Note that other factors, including adding an image, will also impact the importance.\n\n## Adding Relevance Scores\n### Notification Builder Interface\nRelevance Scores can be added when building a push notification by selecting 'Relevance Score' from the iOS Only options:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2ea39c5-Screen_Shot_2021-11-09_at_10.51.37.png\",\n        \"Screen Shot 2021-11-09 at 10.51.37.png\",\n        470,\n        650,\n        \"#333\"\n      ]\n    }\n  ]\n}\n[/block]\nYou can then drag the slider to select the desired relevance score in a range from 0 to 1 with an accuracy of two decimal places.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/02fe65f-Screen_Shot_2021-11-09_at_10.52.50.png\",\n        \"Screen Shot 2021-11-09 at 10.52.50.png\",\n        470,\n        780,\n        \"#333\"\n      ]\n    }\n  ]\n}\n[/block]\n### REST API\nRelevance Scores can be added to notifications sent through our [Notifications](doc:notifications), [Transactional Notifications](doc:transactional-notifications) and [Messages](doc:messages) API endpoints by using the key `relevance_score` with the a value between 0 and 1 inclusive. This should be added to the `notification.payload` field:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"notification\\\": {\\n    \\\"payload\\\": {\\n\\t    \\\"title\\\": \\\"hello\\\",\\n      \\\"alert\\\": \\\"there\\\",\\n\\t    \\\"relevance_score\\\": 0.34\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","updates":[],"order":999,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"618998382d90a20010a9c4a2","createdAt":"2021-11-08T21:35:52.590Z","user":"5b0b7a46a26e6400036604fd","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"iOS Techniques","slug":"ios-techniques","order":9999,"from_sync":false,"reference":false,"_id":"5e6986ca2c6652006791b6e8","createdAt":"2020-03-12T00:48:10.039Z","version":"5e6156bf5e4a51006dcd818c","project":"55e67aaa9cc7c62b00c4a1ea","__v":0},"version":{"version":"1.5","version_clean":"1.5.0","codename":"ST Rebrand","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5e6156bf5e4a51006dcd8120","5e6156bf5e4a51006dcd8121","5e6156bf5e4a51006dcd8122","5e6156bf5e4a51006dcd8123","5e6156bf5e4a51006dcd8124","561c61b4ad272c0d00a892df","586c014c0abf1d0f000d04d4","58991d2ad207df0f0002186b","5e6156bf5e4a51006dcd8125","5e6156bf5e4a51006dcd8126","5af0fe494ca2730003cbc98a","5af0fe55ec80af0003804ca2","5e69868cbd5dcb006b35867b","5e6986ca2c6652006791b6e8"],"_id":"5e6156bf5e4a51006dcd818c","project":"55e67aaa9cc7c62b00c4a1ea","__v":2,"forked_from":"5b720760c44b7600034b7a08","createdAt":"2015-09-02T04:27:23.612Z","releaseDate":"2015-09-02T04:27:23.612Z"},"project":"55e67aaa9cc7c62b00c4a1ea","__v":0}

iOS: Relevance Score

A guide to relevance scores in iOS push notifications.

From iOS 15, Apple has introduced the `relevance-score` field for iOS push notification payloads. It is designed to be used in conjunction with the new 'Notification Summary' that can be used to group notifications received into regularly scheduled summaries. The relevance score helps the device to determine the relative importance of your notifications and display them accordingly in the summary. Note that other factors, including adding an image, will also impact the importance. ## Adding Relevance Scores ### Notification Builder Interface Relevance Scores can be added when building a push notification by selecting 'Relevance Score' from the iOS Only options: [block:image] { "images": [ { "image": [ "https://files.readme.io/2ea39c5-Screen_Shot_2021-11-09_at_10.51.37.png", "Screen Shot 2021-11-09 at 10.51.37.png", 470, 650, "#333" ] } ] } [/block] You can then drag the slider to select the desired relevance score in a range from 0 to 1 with an accuracy of two decimal places. [block:image] { "images": [ { "image": [ "https://files.readme.io/02fe65f-Screen_Shot_2021-11-09_at_10.52.50.png", "Screen Shot 2021-11-09 at 10.52.50.png", 470, 780, "#333" ] } ] } [/block] ### REST API Relevance Scores can be added to notifications sent through our [Notifications](doc:notifications), [Transactional Notifications](doc:transactional-notifications) and [Messages](doc:messages) API endpoints by using the key `relevance_score` with the a value between 0 and 1 inclusive. This should be added to the `notification.payload` field: [block:code] { "codes": [ { "code": "{\n \"notification\": {\n \"payload\": {\n\t \"title\": \"hello\",\n \"alert\": \"there\",\n\t \"relevance_score\": 0.34\n }\n }\n}", "language": "json" } ] } [/block]