I am unable to get private key and public address in Flutter for iOS.
When trying to get key using SingleFactorAuthFlutterPlugin.getKey() we are getting both privateKey and publicAddress in Android, but not getting anything in iOS. Nothing, no return no exception.
Could you please guide me on how to resolve this?
Additional context
SDK Version: single_factor_auth_flutter 1.0.0
Platform: macOS
Flutter doctor
Click To Expand
[!] Flutter (Channel stable, 3.13.9, on macOS 13.3.1 22E261 darwin-arm64, locale en-IN)
! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.1.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/cumulations/fvm/versions/3.13.9. Consider adding /Users/cumulations/fvm/versions/3.13.9/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.85.0)
Unknown architecture undefined_arch, defaulting to arm64
[✓] Connected device (1 available)
[✓] Network resources
I’m facing a similar issue with Swift. I can get the user’s private key, but I only want their public address.
Seems like its the inverse of what it should be, far from what I would want as a user to have the private key so accessible and the address nowhere to be found lol.
@samyak.b Have you tried running example attached with flutter sdk? It absoutely working fine.
Pls try running once at your end. Also web3Auth PnP sdk’s only provides user private key and userInfo() after successful login not the public address.
@huntertdiamond Web3Auth PnP sdk’s only provides user’s private key and userInfo() after successful login not the public address. Pls go through documentation once (Web3Auth PnP Flutter SDK | Documentation | Web3Auth). Also you can derive public address from private key.
I have tried the example mentioned in your documentations. The thing is that example is using web3auth_flutter whereas I want to use single_factor_auth_flutter.
When using the Flutter SFA SDK, I am unable to get any response from SingleFactorAuthFlutterPlugin.getKey() in iOS.
Also web3Auth PnP sdk’s only provides user private key and userInfo() after successful login not the public address.
When building the Flutter SFA for Android, and calling SingleFactorAuthFlutterPlugin.getKey(), I am getting a JSON Object having both private key and public address, like this: