facebook / facebook-java-business-sdk

Java SDK for Meta Marketing APIs

Home Page:https://developers.facebook.com/docs/business-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use Facebook SDK for Conversion API requests

galovics opened this issue · comments

Which SDK version are you using?

15.0.0

What's the issue?

The SDK cannot be used to send requests to the Conversion API due to a bug in the response processing where the code tries to upcast an APINode instance to an AdsPixel object.
The fix is already in place in the main branch yet there's no bugfix release yet.
The commit is this: 4cba80f

Since it's already fixed, I propose to create a bugfix release ASAP, otherwise the SDK is unusable to report pixel events.

Steps/Sample code to reproduce the issue

Send a regular API request to CAPI

Observed Results:

Exception occurs:

java.lang.ClassCastException: class com.facebook.ads.sdk.APINode cannot be cast to class com.facebook.ads.sdk.AdsPixel (com.facebook.ads.sdk.APINode and com.facebook.ads.sdk.AdsPixel are in unnamed module of loader 'app')
	at com.facebook.ads.sdk.serverside.EventRequest.sendToCAPIEndpoint(EventRequest.java:434) ~[facebook-java-business-sdk-15.0.0.jar:na]
	at com.facebook.ads.sdk.serverside.EventRequest.execute(EventRequest.java:401) ~[facebook-java-business-sdk-15.0.0.jar:na]

Expected Results:

Request goes to CAPI successfully.

commented

This happens to me as well.

+1 to me as well

We are targeting a release v15.0.1.