Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase dynamic link preview link not working with facebook messenger

Created firebase dynamic short link will not preview correctly in facebook messenger. It puts up the message and link as expected and shows a preview image with url.

The url included in the message is working but not the url if I click on the preview.

The url should be : https://q3zbm.app.goo.gl/8f7b but the preview link becomes https://q3zbm.app.goo.gl/s?socialDescription=Welcome&socialImageUrl=http://andreasandersson.nu/images/awesome-photo.jpg&socialTitle=Gooo

I was able to reproduce this in a very small program

private void generate() {
    DynamicLink.SocialMetaTagParameters.Builder params = new DynamicLink.SocialMetaTagParameters.Builder();
    params.setImageUrl(Uri.parse("http://andreasandersson.nu/images/awesome-photo.jpg"));
    params.setDescription("Welcome");
    params.setTitle("Gooo");

    FirebaseDynamicLinks.getInstance()
        .createDynamicLink()
        .setLink(Uri.parse("http://andreasandersson.nu"))
        .setDynamicLinkDomain("q3zbm.app.goo.gl")
        .setIosParameters(new DynamicLink.IosParameters.Builder("ios.app.example").build())
        .setAndroidParameters(new DynamicLink.AndroidParameters.Builder().build())
        //.setSocialMetaTagParameters(params.build())
        .buildShortDynamicLink(SHORT)
        .addOnCompleteListener(new OnCompleteListener<ShortDynamicLink>() {
            @Override
            public void onComplete(@NonNull Task<ShortDynamicLink> task) {
                if (task.isSuccessful()) {
                    Uri shortLink = task.getResult().getShortLink();
                    Uri flowchartLink = task.getResult().getPreviewLink();
                    Intent shareIntent = new Intent();
                    shareIntent.setAction(Intent.ACTION_SEND);
                    shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    shareIntent.putExtra(Intent.EXTRA_TEXT, "check this:" + shortLink.toString());
                    shareIntent.setType("text/plain");
                    startActivity(Intent.createChooser(shareIntent, "share"));
                }
            }
        });
}

I know that the app values are not correct but inputting correct ones gives no difference in the result.

Is this an error on the firebase dynamic link or is the problem with facebook messenger? When doing the exact same thing from ios it is working as intended which should mean that this is a android related issue with the sharer?

Update: Thanks for contacting FIrebase support. This is an issue with Facebook that we already raised to them. As of now, we are yet to hear any updates from them, but once we do, we'll let you know.

like image 841
Andreas Andersson Avatar asked Apr 03 '18 19:04

Andreas Andersson


1 Answers

I think that Facebook will not allow this because it would be in violation of their Fake news issue. The ability to change the image used when sharing links was removed and the Firebase meta info would allow you to circumvent this.

Update

After playing around with URL's it turns out I had a trailing "/" before "?" which was preventing the link working with Facebook. Using firebase links we can now set all meta info and provide custom thumbnails again.

like image 148
user1846591 Avatar answered Nov 13 '22 06:11

user1846591