React-native-branch-deep-linking-attribution: contentImageUrl not working

Created on 12 Apr 2019  路  6Comments  路  Source: BranchMetrics/react-native-branch-deep-linking-attribution

const linkProperties = {
feature: "share",
campaign: "referral"
};
const controlParams = {
$ios_url:
"https://itunes.apple.com/us/app/rent-my-wardrobe/id1375748670?ls=1&mt=8",
$fallback_url:
"https://itunes.apple.com/us/app/rent-my-wardrobe/id1375748670?ls=1&mt=8"
};

const { name, description, photos } = item;
branch
  .createBranchUniversalObject(`shareItem/${item.id}`, {
    locallyIndex: true,
    title: name,
    contentDescription: description,
    contentImageUrl: photos[0].url
  })
  .then(buo => {
    const {
      id = "",
      firstname = "",
      lastname = "",
      email = ""
    } = this.currentUser;

    new BranchEvent(SHARE_ITEM_EVENT, buo, {
      sharedBy: id,
      firstname,
      lastname,
      email,
      itemId: item.id,
      itemName: item.name
    }).logEvent();

    this.buo = buo;
    return buo.generateShortUrl(linkProperties, controlParams);
  })
  .then(response => {
    callback(response.url);
    if (this.buo && typeof this.buo.release === "function") {
      this.buo.release();
    }
  })
  .catch(error => {
    console.log("createBranchUniversalObject error: ", error);
    callback(null);
  });

The content image never show. The image url: https://firebasestorage.googleapis.com/v0/b/rmw-auth-dev.appspot.com/o/items%2F888da249-2172-4a05-8208-72091f7d6fd1.jpeg?alt=media&token=1c05790c-107b-40a6-a6a5-b8e2f8955e71

Most helpful comment

I am facing the same issue with RN 0.61.5 and "react-native-branch": "^4.2.1"

Any news on this?

Can you maybe help us? 馃挭 @jdee

All 6 comments

Which version of react-native-branch are you using?

Where is the contentImageUrl not showing up? In previews of the link?

@jdee .I used version 2.3.5. Here my code:

branch .createBranchUniversalObject("shareItem/${id}", { locallyIndex: true, title: name, contentDescription: description, contentImageUrl: photos[0].url, contentMetadata: { customMetadata: { referrer: JSON.stringify(fromUser), item: JSON.stringify(item), type: "Share Item" } } })

And link preview generated: https://link.rentmywardrobe.com/qS9ENdRPLX

Thank you.

I am facing the same issue with RN 0.61.5 and "react-native-branch": "^4.2.1"

Any news on this?

Can you maybe help us? 馃挭 @jdee

Same here. contentImageUrl not working. When opening the deep link the $og_image_url comes in empty!

It appears that the presence of a fallback url causes the image to stop working. @jdee can you please comment on this?

@jcharbo I can confirm this

Was this page helpful?
0 / 5 - 0 ratings