Skip to content

Commit

Permalink
Merge pull request #203 from WalletConnect/fix/send-bundle-id-ws
Browse files Browse the repository at this point in the history
fix: send packageName or bundleId in socket opts for react native
  • Loading branch information
ignaciosantise authored Nov 22, 2024
2 parents b031bf0 + 57fa907 commit 2e00459
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jsonrpc/ws-connection/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ export class WsConnection implements IJsonRpcConnection {
this.registering = true;

return new Promise((resolve, reject) => {
const origin = new URLSearchParams(url).get("origin");
const packageName = new URLSearchParams(url).get("packageName");
const bundleId = new URLSearchParams(url).get("bundleId");
const opts = isReactNative()
? { headers: { origin } }
? { headers: { bundleId, packageName } }
: { rejectUnauthorized: !isLocalhostUrl(url) };
const socket: WebSocket = new WS(url, [], opts);
if (hasBuiltInWebSocket()) {
Expand Down

0 comments on commit 2e00459

Please sign in to comment.