puneet
February 16, 2024, 10:43am
1
Web3auth social not working in iphone,
Please find configuration below, and attached screenshot, its stuck on this screen
Initialising snippet
const web3auth = new Web3Auth({
clientId: WEB_3_AUTH_CLIENT_ID,
chainConfig: {
chainId: numberToHex(CHAIN_ID),
chainNamespace: "eip155",
},
uiConfig: {
dark: true,
},
web3AuthNetwork: web3AuthNetwork[CHAIN_ID],
});
await web3auth.initModal({
modalConfig: {
[WALLET_ADAPTERS.OPENLOGIN]: allowedSocialMethods,
},
});
await web3auth.connect();
const web3Instance = new Web3(web3auth.provider);
const accounts = await web3Instance.eth.getAccounts();
vjgee
February 16, 2024, 11:34am
2
@puneet Thanks for reaching out.
Which web3AuthNetwork
has been confirgured for your Dapp?
Please upgrade to the latest version as you are using outdated packages:
“@web3auth /base”: “^7.3.2 ”,
“@web3auth /modal”: “^7.3.2 ”
If you still face issues, please provide the console logs How to debug iOS devices? and share your entire implementation code.
vjgee
February 16, 2024, 11:49am
4
Not the chainconfig, is your dapp on Sapphire_Mainnet, Sapphire_devnet,etc.? Please confirm if you are on Growth plan or higher.
puneet
February 16, 2024, 2:02pm
5
We have both dev and prod environments, so both Sapphire_Mainnet and Sapphire_devnet.
We are on Base plan.
Even after updating the version , its not working.
puneet
February 16, 2024, 5:10pm
6
I got the issue, its because of Popup block, but unware about the solution,
Please check the screenshot
vjgee
February 16, 2024, 6:23pm
7
Please refer to this post and setup a redirect instead of popup
Hi @one2all.test , please see here , how redirect mode is selected instead of popup. If your user base has a lot of safari users, please use redirect instead of popup.
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
uxMode: "redirect", // "popup", "redirect"
// ...
puneet
February 17, 2024, 9:43am
8
When using uxMode “redirect”, after login when it redirects back website, the website page loads again and we are losing the web3instance.
How to get user info, how to make user log in ?
I do get widget_user_auth_token in localstorage after redirect, how to use it?
Please find the code snippet here and the library versions
“@web3auth /base”: “^7.3.2”,
“@web3auth /modal”: “^7.3.2”,
const handleSocialLogins = async () => {
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
clientId: WEB_3_AUTH_CLIENT_ID,
network: web3AuthNetwork[CHAIN_ID],
uxMode: "redirect"
},
privateKeyProvider: new CommonPrivateKeyProvider({
config: {
chainConfig: {
chainId: numberToHex(CHAIN_ID),
chainNamespace: "eip155",
rpcTarget: RPC_URL,
},
},
}),
});
const web3auth = new Web3Auth({
clientId: WEB_3_AUTH_CLIENT_ID,
chainConfig: {
chainId: numberToHex(CHAIN_ID),
chainNamespace: "eip155",
},
uiConfig: {
dark: true,
},
web3AuthNetwork: web3AuthNetwork[CHAIN_ID],
});
web3auth.configureAdapter(openloginAdapter);
await web3auth.initModal({
modalConfig: {
[WALLET_ADAPTERS.OPENLOGIN]: allowedSocialMethods,
},
});
if (web3auth.connected) {
// setLoggedIn(true);
const idToken = await web3auth.authenticateUser();
console.log(idToken, "idtoken");
} else {
await web3auth.connect();
}
const web3Instance = new Web3(web3auth.provider);
const accounts = await web3Instance.eth.getAccounts();
};
```.
vjgee
February 22, 2024, 2:44pm
9
@puneet I have forwarded your feedback to our team to review and get back with further updates. Please avoid creating duplicate threads for the same issue . Please track this issue on this thread. Thanks!