Allow APNS expiration to be 0 (#436)
This commit is contained in:
		
							parent
							
								
									3bfcd1e822
								
							
						
					
					
						commit
						d9aa8cb408
					
				| 
						 | 
				
			
			@ -81,7 +81,7 @@ type PushNotification struct {
 | 
			
		|||
	Notification          fcm.Notification `json:"notification,omitempty"`
 | 
			
		||||
 | 
			
		||||
	// iOS
 | 
			
		||||
	Expiration  int64    `json:"expiration,omitempty"`
 | 
			
		||||
	Expiration  *int64   `json:"expiration,omitempty"`
 | 
			
		||||
	ApnsID      string   `json:"apns_id,omitempty"`
 | 
			
		||||
	CollapseID  string   `json:"collapse_id,omitempty"`
 | 
			
		||||
	Topic       string   `json:"topic,omitempty"`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -175,8 +175,8 @@ func GetIOSNotification(req PushNotification) *apns2.Notification {
 | 
			
		|||
		CollapseID: req.CollapseID,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if req.Expiration > 0 {
 | 
			
		||||
		notification.Expiration = time.Unix(req.Expiration, 0)
 | 
			
		||||
	if req.Expiration != nil {
 | 
			
		||||
		notification.Expiration = time.Unix(*req.Expiration, 0)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if len(req.Priority) > 0 && req.Priority == "normal" {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue