Skip to content

Commit 55cb85b

Browse files
committed
Update to v0.4.1 to fix Insights breakdown issue and add recent features
Update to v0.4.1 to fix Insights breakdown issue and add recent features
1 parent 6526990 commit 55cb85b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+6121
-339
lines changed

LICENSE.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2015 Facebook, Inc.
1+
Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
22

33
You are hereby granted a non-exclusive, worldwide, royalty-free license to
44
use, copy, modify, and distribute this software in source code or binary
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1616
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1818
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19-
DEALINGS IN THE SOFTWARE.
19+
DEALINGS IN THE SOFTWARE.

examples/image.png.zip

6.21 KB
Binary file not shown.

pom.xml

+98-98
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,98 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.facebook.ads.sdk</groupId>
5-
<artifactId>facebook-java-ads-sdk</artifactId>
6-
<packaging>jar</packaging>
7-
<version>0.4.0</version>
8-
<name>${project.groupId}:${project.artifactId}</name>
9-
<description>Facebook Ads SDK for Java</description>
10-
<url>https://developers.facebook.com/docs/marketing-api/sdks</url>
11-
<licenses>
12-
<license>
13-
<name>Facebook Platform License</name>
14-
<url>https://github.com/facebook/facebook-java-ads-sdk/blob/master/LICENSE.txt</url>
15-
</license>
16-
</licenses>
17-
<developers>
18-
<developer>
19-
<name>Jiaming Liu</name>
20-
<email>[email protected]</email>
21-
<organization>Facebook Inc.</organization>
22-
<organizationUrl>https://www.facebook.com</organizationUrl>
23-
</developer>
24-
</developers>
25-
<scm>
26-
<connection>scm:git:git://github.com/facebook/facebook-java-ads-sdk.git</connection>
27-
<developerConnection>scm:git:ssh://github.com:facebook/facebook-java-ads-sdk.git</developerConnection>
28-
<url>https://github.com/facebook/facebook-java-ads-sdk</url>
29-
</scm>
30-
<build>
31-
<plugins>
32-
<plugin>
33-
<!-- Create sources.jar -->
34-
<groupId>org.apache.maven.plugins</groupId>
35-
<artifactId>maven-source-plugin</artifactId>
36-
<executions>
37-
<execution>
38-
<id>attach-sources</id>
39-
<goals>
40-
<goal>jar</goal>
41-
</goals>
42-
</execution>
43-
</executions>
44-
</plugin>
45-
<plugin>
46-
<groupId>org.sonatype.plugins</groupId>
47-
<artifactId>nexus-staging-maven-plugin</artifactId>
48-
<version>1.6.7</version>
49-
<extensions>true</extensions>
50-
<configuration>
51-
<serverId>ossrh</serverId>
52-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
53-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
54-
</configuration>
55-
</plugin>
56-
<plugin>
57-
<groupId>org.apache.maven.plugins</groupId>
58-
<artifactId>maven-javadoc-plugin</artifactId>
59-
<version>2.9.1</version>
60-
<executions>
61-
<execution>
62-
<id>attach-javadocs</id>
63-
<goals>
64-
<goal>jar</goal>
65-
</goals>
66-
</execution>
67-
</executions>
68-
</plugin>
69-
<plugin>
70-
<groupId>org.apache.maven.plugins</groupId>
71-
<artifactId>maven-gpg-plugin</artifactId>
72-
<version>1.5</version>
73-
<executions>
74-
<execution>
75-
<id>sign-artifacts</id>
76-
<phase>verify</phase>
77-
<goals>
78-
<goal>sign</goal>
79-
</goals>
80-
</execution>
81-
</executions>
82-
</plugin>
83-
</plugins>
84-
</build>
85-
<dependencies>
86-
<dependency>
87-
<groupId>com.google.code.gson</groupId>
88-
<artifactId>gson</artifactId>
89-
<version>2.5</version>
90-
</dependency>
91-
</dependencies>
92-
<distributionManagement>
93-
<snapshotRepository>
94-
<id>ossrh</id>
95-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
96-
</snapshotRepository>
97-
</distributionManagement>
98-
</project>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.facebook.ads.sdk</groupId>
5+
<artifactId>facebook-java-ads-sdk</artifactId>
6+
<packaging>jar</packaging>
7+
<version>0.4.1</version>
8+
<name>${project.groupId}:${project.artifactId}</name>
9+
<description>Facebook Ads SDK for Java</description>
10+
<url>https://developers.facebook.com/docs/marketing-api/sdks</url>
11+
<licenses>
12+
<license>
13+
<name>Facebook Platform License</name>
14+
<url>https://github.com/facebook/facebook-java-ads-sdk/blob/master/LICENSE.txt</url>
15+
</license>
16+
</licenses>
17+
<developers>
18+
<developer>
19+
<name>Jiaming Liu</name>
20+
<email>[email protected]</email>
21+
<organization>Facebook Inc.</organization>
22+
<organizationUrl>https://www.facebook.com</organizationUrl>
23+
</developer>
24+
</developers>
25+
<scm>
26+
<connection>scm:git:git://github.com/facebook/facebook-java-ads-sdk.git</connection>
27+
<developerConnection>scm:git:ssh://github.com:facebook/facebook-java-ads-sdk.git</developerConnection>
28+
<url>https://github.com/facebook/facebook-java-ads-sdk</url>
29+
</scm>
30+
<build>
31+
<plugins>
32+
<plugin>
33+
<!-- Create sources.jar -->
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-source-plugin</artifactId>
36+
<executions>
37+
<execution>
38+
<id>attach-sources</id>
39+
<goals>
40+
<goal>jar</goal>
41+
</goals>
42+
</execution>
43+
</executions>
44+
</plugin>
45+
<plugin>
46+
<groupId>org.sonatype.plugins</groupId>
47+
<artifactId>nexus-staging-maven-plugin</artifactId>
48+
<version>1.6.7</version>
49+
<extensions>true</extensions>
50+
<configuration>
51+
<serverId>ossrh</serverId>
52+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
53+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
54+
</configuration>
55+
</plugin>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-javadoc-plugin</artifactId>
59+
<version>2.9.1</version>
60+
<executions>
61+
<execution>
62+
<id>attach-javadocs</id>
63+
<goals>
64+
<goal>jar</goal>
65+
</goals>
66+
</execution>
67+
</executions>
68+
</plugin>
69+
<plugin>
70+
<groupId>org.apache.maven.plugins</groupId>
71+
<artifactId>maven-gpg-plugin</artifactId>
72+
<version>1.5</version>
73+
<executions>
74+
<execution>
75+
<id>sign-artifacts</id>
76+
<phase>verify</phase>
77+
<goals>
78+
<goal>sign</goal>
79+
</goals>
80+
</execution>
81+
</executions>
82+
</plugin>
83+
</plugins>
84+
</build>
85+
<dependencies>
86+
<dependency>
87+
<groupId>com.google.code.gson</groupId>
88+
<artifactId>gson</artifactId>
89+
<version>2.5</version>
90+
</dependency>
91+
</dependencies>
92+
<distributionManagement>
93+
<snapshotRepository>
94+
<id>ossrh</id>
95+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
96+
</snapshotRepository>
97+
</distributionManagement>
98+
</project>

src/main/java/com/facebook/ads/sdk/APIConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ public class APIConfig {
2727
public static final String DEFAULT_API_VERSION = "v2.8";
2828
public static final String DEFAULT_API_BASE = "https://graph.facebook.com";
2929
public static final String DEFAULT_VIDEO_API_BASE = "https://graph-video.facebook.com";
30-
public static final String USER_AGENT = "fb-java-ads-api-sdk-v2.8.0";
30+
public static final String USER_AGENT = "fb-java-ads-api-sdk-v2.8.1";
3131
};

src/main/java/com/facebook/ads/sdk/Ad.java

+55-17
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ public List<AdLabel> getFieldAdlabels() {
341341
}
342342

343343
public AdSet getFieldAdset() {
344+
if (mAdset != null) {
345+
mAdset.context = getContext();
346+
}
344347
return mAdset;
345348
}
346349

@@ -361,6 +364,9 @@ public EnumBidType getFieldBidType() {
361364
}
362365

363366
public Campaign getFieldCampaign() {
367+
if (mCampaign != null) {
368+
mCampaign.context = getContext();
369+
}
364370
return mCampaign;
365371
}
366372

@@ -432,6 +438,8 @@ public APINodeList<AdCreative> getLastResponse() {
432438
};
433439

434440
public static final String[] FIELDS = {
441+
"account_id",
442+
"actor_id",
435443
"adlabels",
436444
"applink_treatment",
437445
"body",
@@ -457,10 +465,12 @@ public APINodeList<AdCreative> getLastResponse() {
457465
"product_set_id",
458466
"run_status",
459467
"template_url",
468+
"template_url_spec",
460469
"thumbnail_url",
461470
"title",
462471
"url_tags",
463472
"use_page_actor_override",
473+
"video_id",
464474
};
465475

466476
@Override
@@ -532,6 +542,20 @@ public APIRequestGetAdCreatives requestField (String field, boolean value) {
532542
return this;
533543
}
534544

545+
public APIRequestGetAdCreatives requestAccountIdField () {
546+
return this.requestAccountIdField(true);
547+
}
548+
public APIRequestGetAdCreatives requestAccountIdField (boolean value) {
549+
this.requestField("account_id", value);
550+
return this;
551+
}
552+
public APIRequestGetAdCreatives requestActorIdField () {
553+
return this.requestActorIdField(true);
554+
}
555+
public APIRequestGetAdCreatives requestActorIdField (boolean value) {
556+
this.requestField("actor_id", value);
557+
return this;
558+
}
535559
public APIRequestGetAdCreatives requestAdlabelsField () {
536560
return this.requestAdlabelsField(true);
537561
}
@@ -707,6 +731,13 @@ public APIRequestGetAdCreatives requestTemplateUrlField (boolean value) {
707731
this.requestField("template_url", value);
708732
return this;
709733
}
734+
public APIRequestGetAdCreatives requestTemplateUrlSpecField () {
735+
return this.requestTemplateUrlSpecField(true);
736+
}
737+
public APIRequestGetAdCreatives requestTemplateUrlSpecField (boolean value) {
738+
this.requestField("template_url_spec", value);
739+
return this;
740+
}
710741
public APIRequestGetAdCreatives requestThumbnailUrlField () {
711742
return this.requestThumbnailUrlField(true);
712743
}
@@ -735,6 +766,13 @@ public APIRequestGetAdCreatives requestUsePageActorOverrideField (boolean value)
735766
this.requestField("use_page_actor_override", value);
736767
return this;
737768
}
769+
public APIRequestGetAdCreatives requestVideoIdField () {
770+
return this.requestVideoIdField(true);
771+
}
772+
public APIRequestGetAdCreatives requestVideoIdField (boolean value) {
773+
this.requestField("video_id", value);
774+
return this;
775+
}
738776
}
739777

740778
public static class APIRequestDeleteAdLabels extends APIRequest<APINode> {
@@ -1743,6 +1781,7 @@ public APINodeList<Lead> getLastResponse() {
17431781
"id",
17441782
"is_organic",
17451783
"post",
1784+
"retailer_item_id",
17461785
};
17471786

17481787
@Override
@@ -1905,6 +1944,13 @@ public APIRequestGetLeads requestPostField (boolean value) {
19051944
this.requestField("post", value);
19061945
return this;
19071946
}
1947+
public APIRequestGetLeads requestRetailerItemIdField () {
1948+
return this.requestRetailerItemIdField(true);
1949+
}
1950+
public APIRequestGetLeads requestRetailerItemIdField (boolean value) {
1951+
this.requestField("retailer_item_id", value);
1952+
return this;
1953+
}
19081954
}
19091955

19101956
public static class APIRequestGetPreviews extends APIRequest<AdPreview> {
@@ -1916,13 +1962,13 @@ public APINodeList<AdPreview> getLastResponse() {
19161962
}
19171963
public static final String[] PARAMS = {
19181964
"ad_format",
1919-
"dynamic_creative_spec",
1965+
"end_date",
19201966
"height",
1921-
"interactive",
19221967
"locale",
19231968
"place_page_id",
19241969
"post",
19251970
"product_item_ids",
1971+
"start_date",
19261972
"width",
19271973
};
19281974

@@ -1972,12 +2018,8 @@ public APIRequestGetPreviews setAdFormat (String adFormat) {
19722018
return this;
19732019
}
19742020

1975-
public APIRequestGetPreviews setDynamicCreativeSpec (Object dynamicCreativeSpec) {
1976-
this.setParam("dynamic_creative_spec", dynamicCreativeSpec);
1977-
return this;
1978-
}
1979-
public APIRequestGetPreviews setDynamicCreativeSpec (String dynamicCreativeSpec) {
1980-
this.setParam("dynamic_creative_spec", dynamicCreativeSpec);
2021+
public APIRequestGetPreviews setEndDate (String endDate) {
2022+
this.setParam("end_date", endDate);
19812023
return this;
19822024
}
19832025

@@ -1990,15 +2032,6 @@ public APIRequestGetPreviews setHeight (String height) {
19902032
return this;
19912033
}
19922034

1993-
public APIRequestGetPreviews setInteractive (Boolean interactive) {
1994-
this.setParam("interactive", interactive);
1995-
return this;
1996-
}
1997-
public APIRequestGetPreviews setInteractive (String interactive) {
1998-
this.setParam("interactive", interactive);
1999-
return this;
2000-
}
2001-
20022035
public APIRequestGetPreviews setLocale (String locale) {
20032036
this.setParam("locale", locale);
20042037
return this;
@@ -2031,6 +2064,11 @@ public APIRequestGetPreviews setProductItemIds (String productItemIds) {
20312064
return this;
20322065
}
20332066

2067+
public APIRequestGetPreviews setStartDate (String startDate) {
2068+
this.setParam("start_date", startDate);
2069+
return this;
2070+
}
2071+
20342072
public APIRequestGetPreviews setWidth (Long width) {
20352073
this.setParam("width", width);
20362074
return this;

0 commit comments

Comments
 (0)