Closed nikitaeverywhere closed 2 years ago
Hey @ZitRos,
Our iOS app returns the signed txns in base64 format(which is expected), so you need to handle that on your own. I'd suggest you switch to @perawallet/connect
package as soon as possible, so you don't have to deal with the signing infra on your side.
Anyways, here is an example to fix your implementation
const signed = result
.filter(txn => txn != undefined)
.map(txn => typeof txn === "string" ? base64ToUint8Array(txn) : btoa(String.fromCharCode.apply(null, txn)));
function base64ToUint8Array(data: string) {
return Uint8Array.from(window.atob(data), (value) => value.charCodeAt(0));
}
I hope that helps.
@mohammad-beheshti worked on this so he might provide further details.
Let's please identify whether:
@ZitRos @mohammad-beheshti We strongly recommend that you switch to Pera's official WalletConnect library (https://github.com/perawallet/connect). It fixes several issues that we've encountered with other libraries and will bring new features in the upcoming months.
We will nevertheless investigate any discrepancies between iOS and Android apps. However as long as you use the official Pera Connect library you should be OK.
Thank you for details. Noted.
Hello!
You have iOS doing not quite good as Android when it comes to signing transactions. Our DApp integrated with Pera Android throws an error on iOS since it doesn't follow the same protocol and returns strings instead of an encoded object. Please fix!
Below some context from our engineers.
Reference code of the client application:
This should be enough for engineers to test and fix the issue.