Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Deep Linking #127

Open
earth2travis opened this issue Mar 6, 2025 · 2 comments
Open

Implement Deep Linking #127

earth2travis opened this issue Mar 6, 2025 · 2 comments
Assignees
Milestone

Comments

@earth2travis
Copy link
Contributor

earth2travis commented Mar 6, 2025

Allow embedding deeplinks into casts and sharing them from various applications. The implementation supports both simple versions with dynamic button text and more complex versions with dynamic images.

Implementation Details

1. Embed Deeplinks into Casts

Two routes are now available for deeplinking:

  • /dao route
  • /proposal route

Examples

-Simple Version (Dynamic Button Text):

  • Shows fetching DAO data in the page component to populate button text content
  • Embed URL example: https://proposals.farcastle.net/dao/0xa/0x2a244bb4ccd4eb0897cf61e0c61963e1e1d161e3/POST_SIGNAL
  • Code reference: page.tsx meta

Image

  • Complex Version (Dynamic Image):
    • Uses the opengraph_image component to generate dynamic images
    • Embed URL examples:
      • https://proposals.farcastle.net/dao/0xa/0x2a244bb4ccd4eb0897cf61e0c61963e1e1d161e3
      • https://proposals.farcastle.net/dao/0x2105/0x8cd82fc448e714e1bd540ddb679f5269e10d3aa6
    • Code references: page.tsx and opengraph-image.tsx

Image

2. Sharing Deeplinks

  • Works from any app
  • URL format: https://warpcast.com/~/frames/launch?url={{your_deeplink}}
  • Example: https://warpcast.com/~/frames/launch?url=https://proposals.farcastle.net/dao/0x2105/0xf546247ae6eed166f96d910ea22d42054acbd8cd

Technical Notes

  • For URL parameters, encoding is required:
const proposalFrameDeeplink = encodeURI(
  `https://warpcast.com/~/frames/launch?url=https://proposals.farcastle.net/dao/${chainid}/${daoid}`
);
  • Confirmed working URL format in browser: https://warpcast.com/?launchFrameUrl=https://proposals.farcastle.net/dao/0x2105/0xf546247ae6eed166f96d910ea22d42054acbd8cd

Possible Enhancements

Launching from a v1 Frame Intent

Currently, both approaches open new windows:

<Button.Link
  // href={`https://warpcast.com/~/frames/launch?url=https://proposals.farcastle.net/dao/${chainid}/${daoid}`}
  href={`https://warpcast.com/?launchFrameUrl=https://proposals.farcastle.net/dao/${chainid}/${daoid}`}
>
  Make Proposal
</Button.Link>

Further exploration needed to:

  1. Find optimal frame embed that launches to a deeplink
  2. Determine if launch frame URL can be used in a v1 frame intent
  3. Handle desktop vs. mobile detection (temporary solution: isDesktop = () => window.self !== window.top;)

References

@earth2travis
Copy link
Contributor Author

Updated complex version to display the DAO avatar and use placeholder if no image is found:

Hollow Servants

Image

Placeholder (fallback.svg)

Image

@earth2travis
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants