protected function sendOneSignal(): bool 	{ 		if (!setting('onesignal_app_id')) { 			return false; 		}  		$filters = []; 		$segments = $this->notification->segments?->toArray() ?? [];  		$data = [ 			'headings' => $this->notification->getTranslations('title'), 			'contents' => $this->notification->getTranslations('body'), 			'data' => $this->notification->resourceArray(), 		];  		if ($this->notification->shouldIncludeUrlParam()) { 			$data['url'] = $this->notification->url; 		}  		if ($this->notification->scheduled_at > now()) { 			$data['send_after'] = $this->notification->scheduled_at; 		}  		if ($this->notification->delivery_time_of_day) { 			$data['delayed_option'] = 'timezone'; 			$data['delivery_time_of_day'] = $this->notification->delivery_time_of_day; 		}  		if ($this->notification->collapse_id) { 			$data['collapse_id'] = $this->notification->collapse_id; 		}  		foreach ($segments as &$segment) { 			$segment = $segment->value; 		}  		foreach (($this->notification->countries ?? []) as $country) { 			$filters[] = ['field' => 'country', 'relation' => '=', 'value' => $country]; 			$filters[] = ['operator' => 'OR']; 		}  		if ($this->notification->radius) { 			$filters[] = ['field' => 'location', 'radius' => $this->notification->radius, 'lat' => $this->notification->location_lat, 'long' => $this->notification->location_lng]; 		}  		if ($segments) { 			$data['included_segments'] = $segments; 		} elseif ($filters !== []) { 			$data['filters'] = $filters; 		} elseif ($targets = $this->notification->getTargets()) { 			$data['include_player_ids'] = $targets; 		} else { 			return false; 		}  		$onesignal = new OneSignalHandler; 		$onesignal = $onesignal->addNotification($data);  		$onesignalId = $onesignal['id'] ?? null;  		if (!is_string($onesignalId)) { 			return false; 		}  		if ($onesignalId === '') { 			return false; 		}  		return $this->notification->update([ 			'external_id' => $onesignal['id'], 			'completed_at' => formatTimestamp(), 		]); 	}