Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/wild-redirects-validate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@onflow/fcl-core": patch
"@onflow/fcl-react-native": patch
---

Remove the unused `DEEPLINK/RPC` strategy and its associated redirect handling.
18 changes: 3 additions & 15 deletions packages/fcl-core/src/wallet-utils/send-msg-to-fcl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import {
FCL_REDIRECT_URL_PARAM_NAME,
FCL_RESPONSE_PARAM_NAME,
} from "../utils/constants"
import {onMessageFromFCL} from "./on-message-from-fcl"

export interface PollingResponse {
Expand All @@ -14,8 +10,8 @@ export interface PollingResponse {

/**
* @description Sends messages from a wallet or service back to the parent FCL application. This function
* handles communication between wallet UIs (running in iframes, popups, or redirects) and the main FCL
* application. It automatically detects the communication method (redirect, iframe, or popup) and sends
* handles communication between wallet UIs (running in iframes or popups) and the main FCL
* application. It automatically detects the communication method (iframe or popup) and sends
* the message accordingly.
*
* @param type The message type identifier (e.g., "FCL:VIEW:RESPONSE", "FCL:VIEW:READY")
Expand All @@ -41,15 +37,7 @@ export interface PollingResponse {
* })
*/
export const sendMsgToFCL = (type: string, msg?: PollingResponse): void => {
const data = {...msg, type}

const urlParams = new URLSearchParams(window.location.search)
const redirectUrl = urlParams.get(FCL_REDIRECT_URL_PARAM_NAME)
if (redirectUrl) {
const url = new URL(redirectUrl)
url.searchParams.append(FCL_RESPONSE_PARAM_NAME, JSON.stringify(data))
window.location.href = url.href
} else if (window.location !== window.parent.location) {
if (window.location !== window.parent.location) {
window.parent.postMessage({...msg, type}, "*")
} else if (window.opener) {
window.opener.postMessage({...msg, type}, "*")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useServiceDiscovery = ({fcl}) => {
const requestBody = {
fclVersion: VERSION,
userAgent: "ReactNative",
supportedStrategies: ["WC/RPC", "DEEPLINK/RPC"],
supportedStrategies: ["WC/RPC"],
}

// Fetch wallets from Discovery API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import {CORE_STRATEGIES, getExecHttpPost} from "@onflow/fcl-core"
import {execLocal} from "./exec-local"
import {execDeeplinkRPC} from "./strategies/deeplink-rpc"
import {execDiscoveryRN} from "./strategies/discovery-rn"
import {DISCOVERY_RN_METHOD} from "./constants"

export const coreStrategies = {
[CORE_STRATEGIES["HTTP/RPC"]]: getExecHttpPost(execLocal),
[CORE_STRATEGIES["HTTP/POST"]]: getExecHttpPost(execLocal),
[CORE_STRATEGIES["DEEPLINK/RPC"]]: execDeeplinkRPC,
[DISCOVERY_RN_METHOD]: execDiscoveryRN,
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {FCL_REDIRECT_URL_PARAM_NAME, URL} from "@onflow/fcl-core"
import {URL} from "@onflow/fcl-core"
import * as WebBrowser from "expo-web-browser"
import * as Linking from "expo-linking"

/**
*
Expand All @@ -9,12 +8,7 @@ import * as Linking from "expo-linking"
* @returns {[object, () => void]}
*/
export async function renderBrowser(src, opts = {}) {
const redirectUrl = Linking.createURL("$$fcl_auth_callback$$", {
queryParams: {},
})

const url = new URL(src.toString())
url.searchParams.append(FCL_REDIRECT_URL_PARAM_NAME, redirectUrl)

const webbrowser = WebBrowser.openAuthSessionAsync(url.toString())

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {config} from "@onflow/config"
* 4. This function executes → shows ConnectModal with wallet list
* 5. User selects wallet
* 6. Returns {status: "REDIRECT", data: walletService}
* 7. FCL core executes the wallet service (WC/RPC or DEEPLINK/RPC)
* 7. FCL core executes the wallet service (WC/RPC)
*
* @param {object} params - Strategy execution parameters
* @param {object} params.service - The discovery service to execute
Expand Down

This file was deleted.

Loading