Skip to content

Commit

Permalink
Merge pull request #2 from anotherdev/pk/add-firebase-dynamic-links
Browse files Browse the repository at this point in the history
Add SocialMetaTagParameters support
  • Loading branch information
anotherdev authored Nov 12, 2020
2 parents a32c5df + 0de2d91 commit 6632ca6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/src/main/res/layout/home_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<TextView
android:id="@+id/link_textview"
android:autoLink="all"
android:textIsSelectable="true"
android:layout_margin="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
classpath "com.android.tools.build:gradle:4.1.1"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion buildsystem/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
// Manifest version information!
def versionMajor = 0
def versionMinor = 2
def versionMinor = 3
def versionPatch = 0
def versionBuild = 0 // bump for dogfood builds, public betas, etc.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ interface DynamicLinkInfo {
@SerializedName("androidInfo")
AndroidInfo getAndroidInfo();

@Nullable
@SerializedName("socialMetaTagInfo")
SocialMetaTagInfo getSocialMetaTagInfo();


@Value.Immutable
@Value.Style(strictBuilder = true)
Expand All @@ -49,6 +53,22 @@ interface AndroidInfo {
@SerializedName("androidFallbackLink")
String getAndroidFallbackLink();
}


@Value.Immutable
@Value.Style(strictBuilder = true)
@Gson.TypeAdapters
interface SocialMetaTagInfo {

@SerializedName("socialTitle")
String getSocialTitle();

@SerializedName("socialDescription")
String getSocialDescription();

@SerializedName("socialImageLink")
String getSocialImageLink();
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,17 @@ Task<ShortDynamicLink> buildShortDynamicLink(
.androidFallbackLink(android.getFallbackUrl().toString())
.build();

DynamicLinkInfo.SocialMetaTagInfo socialMetaTagInfo = ImmutableSocialMetaTagInfo.builder()
.socialTitle(social.getTitle())
.socialDescription(social.getDescription())
.socialImageLink(social.getImageUrl().toString())
.build();

DynamicLinkInfo dynamicLinkInfo = ImmutableDynamicLinkInfo.builder()
.domainUriPrefix(linkBuilder.getDomainUriPrefix())
.link(linkBuilder.getLink().toString())
.androidInfo(androidInfo)
.socialMetaTagInfo(socialMetaTagInfo)
.build();

FdlRequest request = ImmutableFdlRequest.builder()
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

0 comments on commit 6632ca6

Please sign in to comment.