support subtitle for apple watch.

Signed-off-by: Bo-Yi Wu (吳柏毅) <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu (吳柏毅)
2016-11-26 14:42:49 +08:00
parent acd027bdc1
commit 40dabf75c5
3 changed files with 10 additions and 0 deletions

View File

@@ -132,6 +132,7 @@ func TestIOSAlertNotificationStructure(t *testing.T) {
LaunchImage: test,
LocArgs: []string{"a", "b"},
LocKey: test,
Subtitle: test,
TitleLocArgs: []string{"a", "b"},
TitleLocKey: test,
},
@@ -153,6 +154,7 @@ func TestIOSAlertNotificationStructure(t *testing.T) {
launchImage, _ := jsonparser.GetString(data, "aps", "alert", "launch-image")
locKey, _ := jsonparser.GetString(data, "aps", "alert", "loc-key")
title, _ := jsonparser.GetString(data, "aps", "alert", "title")
subtitle, _ := jsonparser.GetString(data, "aps", "alert", "subtitle")
titleLocKey, _ := jsonparser.GetString(data, "aps", "alert", "title-loc-key")
aps := dat["aps"].(map[string]interface{})
alert := aps["alert"].(map[string]interface{})
@@ -165,6 +167,7 @@ func TestIOSAlertNotificationStructure(t *testing.T) {
assert.Equal(t, test, launchImage)
assert.Equal(t, test, locKey)
assert.Equal(t, test, title)
assert.Equal(t, test, subtitle)
assert.Equal(t, test, titleLocKey)
assert.Contains(t, titleLocArgs, "a")
assert.Contains(t, titleLocArgs, "b")