Automattic\WooCommerce\Internal\Orders

MobileMessagingHandler::get_closer_mobile_usage_date()private staticWC 1.0

Returns the closest date of last usage of any mobile app platform.

Method of the class: MobileMessagingHandler{}

No Hooks.

Return

?DateTime.

Usage

$result = MobileMessagingHandler::get_closer_mobile_usage_date(): ?DateTime;

MobileMessagingHandler::get_closer_mobile_usage_date() code WC 7.1.1

private static function get_closer_mobile_usage_date(): ?DateTime {
	$mobile_usage = WC_Tracker::get_woocommerce_mobile_usage();

	if ( ! $mobile_usage ) {
		return null;
	}

	$last_ios_used     = self::get_last_used_or_null( 'ios', $mobile_usage );
	$last_android_used = self::get_last_used_or_null( 'android', $mobile_usage );

	return max( $last_android_used, $last_ios_used );
}