diff --git a/lib/rpush/client/active_model/fcm/notification.rb b/lib/rpush/client/active_model/fcm/notification.rb index c2d0b7b65..dc16ef894 100644 --- a/lib/rpush/client/active_model/fcm/notification.rb +++ b/lib/rpush/client/active_model/fcm/notification.rb @@ -66,9 +66,8 @@ def as_json(options = nil) # rubocop:disable Metrics/PerceivedComplexity end def android_config - json = { - 'notification' => android_notification, - } + json = {} + json['notification'] = android_notification if notification json['collapse_key'] = collapse_key if collapse_key json['priority'] = priority_str if priority json['ttl'] = "#{expiry}s" if expiry