iOS消息推送研究

1,mutable-content:1 才会进入notifcaitonservice扩展。
友盟,推送勾选内容链接,则自动增加mutable-content:1
mutable-content
2,友盟的自定义参数,为加到aps之外。

UNNotificationResponse = {
  "actionIdentifier" : "com.apple.UNNotificationDefaultActionIdentifier",
  "UNNotificationResponse" : {
    "date" : "2017-07-26  23:34:09",
    "UNNotificationRequest" : {
      "UNNotificationContent" : {
        "userInfo" : {
          "d" : "us11522150108324571311",
          "mutable-content" : "1",
          "p" : 0,
          "aps" : {
            "sound" : "default",
            "alert" : {
              "title" : "sfdasdf",
              "subtitle" : "asdfas",
              "body" : "dfasdf"
            }
          }
        },
        "badge" : 0,
        "launchImageName" : "",
        "subtitle" : "asdfas",
        "threadIdentifier" : "",
        "title" : "sfdasdf",
        "body" : "dfasdf",
        "categoryIdentifier" : "",
        "UNNotificationAttachment" : [

        ]
      },
      "identifier" : "us11522150108324571311"
    }
  }
}




{
    "aps":{
        "alert":{
            "title":"3",
            "subtitle":"sdfashello",
            "body":"你有新的消息请注意查收"
        },
        "sound":"11.aif",
        "badge":0,
        "mutable-content":1,
        "category":"myNotificationCategory"
    },
    "sound":"2.jpeg",
    "sound2":"01.mp3"
}



UNNotificationRequest = {
    UNNotificationContent =     {
        UNNotificationAttachment =         (
        );
        badge = 0;
        body = "\U4f60\U6709\U65b0\U7684\U6d88\U606f\U8bf7\U6ce8\U610f\U67e5\U6536";
        categoryIdentifier = myNotificationCategory;
        launchImageName = "";
        subtitle = sdfashello;
        threadIdentifier = "";
        title = 3;
        userInfo =         {
            aps =             {
                alert =                 {
                    body = "\U4f60\U6709\U65b0\U7684\U6d88\U606f\U8bf7\U6ce8\U610f\U67e5\U6536";
                    subtitle = sdfashello;
                    title = 3;
                };
                badge = 0;
                category = myNotificationCategory;
                "mutable-content" = 1;
                sound = "11.aif";
            };
            sound = "2.jpeg";
            sound2 = "01.mp3";
        };
    };
    identifier = "E1B3D9D5-4EF7-4551-B697-A67FB0B52DB4";
}


UNNotification = {
  "date" : "2017-06-29  22:32:27",
  "UNNotificationRequest" : {
    "UNNotificationContent" : {
      "userInfo" : {
        "aps" : {
          "badge" : 0,
          "mutable-content" : 1,
          "alert" : {
            "title" : "3",
            "subtitle" : "sdfashello",
            "body" : "你有新的消息请注意查收"
          },
          "category" : "myNotificationCategory",
          "sound" : "11.aif"
        },
        "sound" : "2.jpeg",
        "sound2" : "01.mp3"
      },
      "badge" : 0,
      "launchImageName" : "",
      "subtitle" : "sdfashello",
      "threadIdentifier" : "",
      "title" : "3 [modified]",
      "body" : "你有新的消息请注意查收",
      "categoryIdentifier" : "myNotificationCategory",
      "UNNotificationAttachment" : [
        {
          "URL" : "file:\/\/\/var\/mobile\/Library\/SpringBoard\/PushStore\/Attachments\/com.lanqxyihhenguisleu.1\/56cac0f0c13a47ce9483d994427f5c381db40cc1.mp3",
          "type" : "public.mp3",
          "identifier" : "attachmentid"
        }
      ]
    },
    "identifier" : "2867A40B-A0B6-4451-98A5-457744292EEC"
  }
}



UNNotification = {
  "date" : "2017-06-29  22:34:08",
  "UNNotificationRequest" : {
    "UNNotificationContent" : {
      "userInfo" : {
        "aps" : {
          "sound" : "11.aif",
          "mutable-content" : 1,
          "alert" : {
            "title" : "3",
            "subtitle" : "sdfashello",
            "body" : "你有新的消息请注意查收"
          },
          "category" : "myNotificationCategory",
          "badge" : 0
        },
        "sound" : "2.jpeg",
        "sound2" : "01.mp3"
      },
      "badge" : 0,
      "launchImageName" : "",
      "subtitle" : "sdfashello",
      "threadIdentifier" : "",
      "title" : "3 [modified]",
      "body" : "你有新的消息请注意查收",
      "categoryIdentifier" : "myNotificationCategory",
      "UNNotificationAttachment" : [
        {
          "URL" : "file:\/\/\/var\/mobile\/Library\/SpringBoard\/PushStore\/Attachments\/com.lanqxyihhenguisleu.1\/56cac0f0c13a47ce9483d994427f5c381db40cc1.mp3",
          "type" : "public.mp3",
          "identifier" : "attachmentid"
        }
      ]
    },
    "identifier" : "2C0FF4EE-286A-4739-BB0F-BBD7889A236B"
  }
}



UNNotificationResponse = {
  "actionIdentifier" : "查看",
  "UNNotificationResponse" : {
    "date" : "2017-06-29  22:32:27",
    "UNNotificationRequest" : {
      "UNNotificationContent" : {
        "userInfo" : {
          "aps" : {
            "badge" : 0,
            "mutable-content" : 1,
            "alert" : {
              "title" : "3",
              "subtitle" : "sdfashello",
              "body" : "你有新的消息请注意查收"
            },
            "category" : "myNotificationCategory",
            "sound" : "11.aif"
          },
          "sound" : "2.jpeg",
          "sound2" : "01.mp3"
        },
        "badge" : 0,
        "launchImageName" : "",
        "subtitle" : "sdfashello",
        "threadIdentifier" : "",
        "title" : "3 [modified]",
        "body" : "你有新的消息请注意查收",
        "categoryIdentifier" : "myNotificationCategory",
        "UNNotificationAttachment" : [
          {
            "URL" : "file:\/\/\/var\/mobile\/Library\/SpringBoard\/PushStore\/Attachments\/com.lanqxyihhenguisleu.1\/56cac0f0c13a47ce9483d994427f5c381db40cc1.mp3",
            "type" : "public.mp3",
            "identifier" : "attachmentid"
          }
        ]
      },
      "identifier" : "2867A40B-A0B6-4451-98A5-457744292EEC"
    }
  }
}

你可能感兴趣的:(iOS消息推送研究)