For use Message's interface, I have to unmarshal this json to Message struct.
So I tried to:
// 1st way
message := &messaging.Message{}
err = message.UnmarshalJSON(messageJsonString)
if err != nil {
fmt.Println(err.Error())
}
// 1st way's error:
json: cannot unmarshal bool into Go struct field APNSConfig.apns.payload of type int
// 2nd way
message := &messaging.Message{}
err = json.Unmarshal(messageJsonString)
if err != nil {
fmt.Println(err.Error())
}
// 2nd way's error:
json: cannot unmarshal bool into Go struct field APNSConfig.apns.payload of type int
I did some testing and found that it works fine without "content-available" and "mutable-content" in the json.
How can I parse content-available and mutable-content?
This fields are from apple reference
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
I've deal with json like:
For use
Message
's interface, I have to unmarshal this json toMessage
struct. So I tried to:I did some testing and found that it works fine without "content-available" and "mutable-content" in the json. How can I parse content-available and mutable-content? This fields are from apple reference