Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

googleAdsService.SearchStream response callback doesn't work #197

Closed
mithun146 opened this issue Jun 10, 2020 · 3 comments
Closed

googleAdsService.SearchStream response callback doesn't work #197

mithun146 opened this issue Jun 10, 2020 · 3 comments
Assignees
Labels
bug Something isn't working P1 usability This issue is related to a usability issue with the client library.

Comments

@mithun146
Copy link

I'm trying to get all campaigns by using the below code

` GoogleAdsServiceClient googleAdsService = client.GetService(Services.V3.GoogleAdsService);

    // Create a query that will retrieve all campaigns.
    string query = @"SELECT
                    campaign.id,
                    campaign.name,
                    campaign.network_settings.target_content_network
                FROM campaign
                ORDER BY campaign.id";

    try
    {
        // Issue a search request.
        googleAdsService.SearchStream(customerId.ToString(), query,
            delegate (SearchGoogleAdsStreamResponse resp)
            {
                foreach (GoogleAdsRow googleAdsRow in resp.Results)
                {
                    Console.WriteLine("Campaign with ID {0} and name '{1}' was found.",
                        googleAdsRow.Campaign.Id, googleAdsRow.Campaign.Name);
                }
                rowResult = resp.Results;
            }
        );


    }

`

the response callback on the googleAdsService.SearchStream method doesn't fire and no error is thrown.

@AnashOommen
Copy link
Member

Hi Mithun, I wonder if the rowcount being zero is the issue. Let me try.

@AnashOommen
Copy link
Member

Yep, https://github.com/googleads/google-ads-dotnet/blob/master/src/V3/ServiceHelperMethods.cs#L56 doesn't enter the loop if there are no results.

Perhaps I can modify the code to invoke it at least once, with an empty result?

@AnashOommen AnashOommen self-assigned this Jun 18, 2020
@AnashOommen AnashOommen added bug Something isn't working P1 usability This issue is related to a usability issue with the client library. labels Jun 18, 2020
@AnashOommen
Copy link
Member

Fixed in v4.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 usability This issue is related to a usability issue with the client library.
Projects
None yet
Development

No branches or pull requests

2 participants