public void GetPayload_ShouldReturnPayloadWithSoundWhenSoundIsDefault() { const PushSounds sound = PushSounds.Default; var message = new PushMessage(Token, sound: sound); var json = JsonConvert.SerializeObject(message, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); var payload = JsonConvert.DeserializeObject <dynamic>(json); Assert.Equal(PushSounds.Default.ToString().ToLower(), (string)payload.sound); }
public PushMessage(string to, object data = null, string title = null, string body = null, PushSounds sound = PushSounds.None, int?ttl = null, int?expiration = null, PushPriotities priority = PushPriotities.Default, int?badge = null, string channelId = null) { To = to; Data = data; Title = title; Body = body; Sound = sound; Ttl = ttl; Expiration = expiration; Priority = priority; Badge = badge; ChannelId = channelId; }
public PushMessage(string to, object data = null, string title = null, string body = null, PushSounds sound = PushSounds.None, int?ttl = null, int?expiration = null, PushPriorities priority = PushPriorities.Default, int?badge = null, string category = null, bool displayInForeground = false, string channelId = null) { Badge = badge; Body = body; Category = category; ChannelId = channelId; Data = data; DisplayInForeground = displayInForeground; Expiration = expiration; Priority = priority; Sound = sound; Title = title; To = to; Ttl = ttl; }