Automattic\WooCommerce\Internal\PushNotifications

PushNotifications::should_be_enabled │ public │ WC 10.4.0

Determines if local push notification functionality should be enabled. The module runs on the remote proxy driver, so it is enabled exactly when that driver can send (feature not disabled and Jetpack connected). Memoize the value so we only check once per request.

Method of the class: PushNotifications{}

No Hooks.

Returns

bool.

Usage

$PushNotifications = new PushNotifications();
$PushNotifications->should_be_enabled(): bool;

Changelog

Since 10.4.0 Introduced.

PushNotifications::should_be_enabled() code WC 11.3.0

public function should_be_enabled(): bool {
	if ( null !== $this->enabled ) {
		return $this->enabled;
	}

	$this->enabled = wc_get_container()->get( DriverAvailabilityService::class )->is_remote_proxy_available();

	return $this->enabled;
}