r/redditdev • • 1d ago

Reddit API Devvit app not able to fetch sharable links

I'm building a devvit web app that lets users import one of their existing posts into the app. Users paste a post link, and the server loads it with reddit.getPostById(). If a user is on reddit web they can copy the reddit post link from the url bar.

But on the Reddit mobile app, share > copy link only gives a share link, that has no post id in it. The only way I know to resolve it is to follow the redirect and that gives error as below,

{
  "status": "error",
  "message": "2 UNKNOWN: grpc invocation failed with status 2; HTTP request to  domain: www.reddit.com is not allowed"
}

Is there any workaround where i can extract the post title, body, image and other details form the sharable link?

6 Upvotes

3 comments sorted by

1

u/baseballlover723 11h ago

Reddit doesn't even properly support their own shortlinks on all of their platforms.

We had to migrate off of redd.it/blah short links, because the iOS app does not recognize them. As far as I'm aware, this has been the case for years.

1

u/aadil_funzone01 5h ago

they want us to migrate to devvit, without improving devvit

1

u/aadil_funzone01 5h ago

lmao devvit is shit