Skip to content

backend + mobile: implement full WebView Follow Engine for LinkedIn in-app connect #36

@ShantKhatri

Description

@ShantKhatri

Summary

Product doc section 6.9 specifies a WebView Interaction Engine for LinkedIn since LinkedIn's API does not allow programmatic connection requests. Implement the complete end-to-end flow: the mobile Follow Engine that routes LinkedIn connects through the in-app WebView, session management, and graceful fallback.

Context

apps/mobile/src/screens/WebViewScreen.tsx exists. apps/mobile/src/screens/DevCardViewScreen.tsx has connect buttons. The follow routing backend is at apps/backend/src/routes/follow.ts.

Tasks

  • in apps/backend/src/routes/follow.ts, update the LinkedIn platform handler:
    • when followStrategy === 'webview', return { strategy: 'webview', url: '...linkedin profile url...' } instead of an error.
  • in apps/mobile/src/screens/DevCardViewScreen.tsx, handle the webview strategy response by navigating to WebViewScreen with the resolved URL.
  • update apps/mobile/src/screens/WebViewScreen.tsx:
    • accept { url, platformName } route params.
    • render the URL in a react-native-webview with session cookie sharing enabled.
    • inject a small JS snippet that waits for LinkedIn's 'Connect' button to appear and scrolls it into view (no auto-click — user must tap).
    • show a banner 'You are viewing this profile in DevCard — tap Connect on LinkedIn to send your request'.
    • on WebView URL change, detect if the LinkedIn invite-sent confirmation page loaded and auto-dismiss with success toast.
  • add a timeout fallback that opens the LinkedIn deep link if WebView fails to load within 10s.
  • document the architecture in apps/backend/README.md section on Follow Engine.

Acceptance Criteria

  • tapping 'Connect on LinkedIn' in DevCardViewScreen opens WebViewScreen with the LinkedIn profile.
  • user taps LinkedIn's native Connect button to send request.
  • success state is detected and communicated back to the app.
  • fallback to deep link works on WebView timeout.

Difficulty

advanced — requires WebView session management, JS injection, navigation state detection, and platform compliance awareness.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions