diff --git a/interfaces/kits/napi/ans/src/common.cpp b/interfaces/kits/napi/ans/src/common.cpp index b3aa845a19cd4405357f7a4f7f0bf9b7a90bbe98..1965a7db4269af44b14c61ca95749e3314bab41e 100644 --- a/interfaces/kits/napi/ans/src/common.cpp +++ b/interfaces/kits/napi/ans/src/common.cpp @@ -173,7 +173,11 @@ napi_value Common::SetNotificationByDistributedOptions( NotificationDistributedOptions options = notification->GetNotificationRequest().GetNotificationDistributedOptions(); napi_value value = nullptr; // isDistributed?: boolean - napi_get_boolean(env, options.IsDistributed(), &value); + if (notification->GetDeviceId().empty()) { + napi_get_boolean(env, false, &value); + } else { + napi_get_boolean(env, options.IsDistributed(), &value); + } napi_set_named_property(env, result, "isDistributed", value); // supportDisplayDevices?: Array