Skip to content

Commit

Permalink
Merge pull request #34 from gandalf-network/chore/update-universal-ur…
Browse files Browse the repository at this point in the history
…l-handling

Add Query Parameter to Indicate Android URLs
  • Loading branch information
TosinJs authored Sep 5, 2024
2 parents a3ff12f + 9abadac commit f917560
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gandalf-network/connect",
"version": "1.0.12",
"version": "1.0.13",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
4 changes: 4 additions & 0 deletions src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ class Connect {
url.searchParams.append(key, params[key]),
);

if (this.platform !== Platform.IOS) {
url.searchParams.append('isUniversal', 'true');
}

return url.toString();
}

Expand Down
6 changes: 3 additions & 3 deletions tests/connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ describe("Connect SDK", () => {
});
const generatedURL = await connect.generateURL();
expect(generatedURL).toEqual(
`${UNIVERSAL_APP_CLIP_BASE_URL}/?publicKey=${encodedPublicKey}&redirectUrl=${encodedRedirectURL}&data=${encodedData}`,
`${UNIVERSAL_APP_CLIP_BASE_URL}/?publicKey=${encodedPublicKey}&redirectUrl=${encodedRedirectURL}&data=${encodedData}&isUniversal=true`,
);
});

Expand All @@ -254,7 +254,7 @@ describe("Connect SDK", () => {
});
const generatedURL = await connect.generateURL();
expect(generatedURL).toEqual(
`${ANDROID_APP_CLIP_BASE_URL}/?publicKey=${encodedPublicKey}&redirectUrl=${encodedRedirectURL}&data=${encodedData}`,
`${ANDROID_APP_CLIP_BASE_URL}/?publicKey=${encodedPublicKey}&redirectUrl=${encodedRedirectURL}&data=${encodedData}&isUniversal=true`,
);
});

Expand Down Expand Up @@ -381,7 +381,7 @@ describe("Connect SDK", () => {
});
const generatedURL = await connect.generateURL();
expect(generatedURL).toEqual(
`${UNIVERSAL_APP_CLIP_BASE_URL}/?publicKey=${encodedPublicKey}&redirectUrl=${encodedRedirectURL}&data=${encodedData}`,
`${UNIVERSAL_APP_CLIP_BASE_URL}/?publicKey=${encodedPublicKey}&redirectUrl=${encodedRedirectURL}&data=${encodedData}&isUniversal=true`,
);
});
});
Expand Down

0 comments on commit f917560

Please sign in to comment.