Unity iOS Error EntryPointNotFound + testnet Whitelist

I posted previously about this issue here, but it was never resolved and no one has replied on the post except me in a month.

To summarize:
-When using Web3Auth in Unity Editor, I get this error on start

EntryPointNotFoundException: web3auth_keystore_get assembly: type: member:(null)
KeyStoreManagerUtils.getPreferencesData (System.String key) (at Assets/Plugins/Web3AuthSDK/Keystore/KeyStoreManagerUtils.cs:69)
Web3Auth.authorizeSession (System.String newSessionId) (at Assets/Plugins/Web3AuthSDK/Web3Auth.cs:368)
Web3Auth.Awake () (at Assets/Plugins/Web3AuthSDK/Web3Auth.cs:89)

-I am using the Web3Auth SDK Version 2.1.1 and Unity Version 2022.3.18f1
-The code works fine without error on Android platform mode in Unity editor.
-When the script opens a tab in browser to login, I go through the process and return to the app. The code does not register that the login has occurred/succeeded.

When I test in-app on my iPhone with a build, I get this error:

There seems to be some bug in the code. Please contact support to fix this.
could not validate redirect, please whitelist your domain: <Domain> for provided clientId <clientID> at https://dashboard.web3auth.io. Also, this project is on testnet network. Please ensure the the used Client ID belongs to this network.

If i can provide any more information that would be helpful, please let me know.

hi @neardev ,

Sorry for not finding the solution the last time.
I’ll to try to reproduce the error in Unity and get back to you.

In the meantime, I would like to know:

thanks

The Unity example works fine for me when the build platform is not set to iOS. When it is set to iOS, the same EntryPointNotFoundException error appears on start, and logging in does not work. The browser opens and I go through the verification code but nothing happens in-app. (This was all tested in Unity Editor, if you believe I should also try it in an iOS build, I will.)

Because I am just using testnet, the dashboard will not allow me to whitelist any domain. Should I switch from testnet? I was just trying to verify that Web3Auth in it’s most basic form will even work for my app.

Any update on this? I’m working on other parts of my project in the meantime but if there are any troubleshooting steps I should take for this, let me know.

hi @neardev,

I hope you are doing well. I will try to help you so you can solve the problem as soon as possible.

"Because I am just using testnet, the dashboard will not allow me to whitelist any domain. " Please tellm me which environment are you using ? I can add a whitelist item into testnet and also devnet_sapphire.

Thank you for your reply,
I am currently using sapphire_devnet
I tried again to whitelist the domain as it appeared in the “please whitelist” error message from my original post.
It gave me a “Fail to whitelist the domain” error message.

hi @neardev

could you share with me in private the domain you are trying to enter ? (If you click in my user you will see the send message feature)

Also you can create a new test project and try to add the same domain.

I’m waiting for the message to try to find the issue.

I may be missing something but I do not see the option to send message when I click your page.


I did make another test project, this time on the legacy testnet and was able to add the domain without issue, so I tried again to add the domain on my project that is using sapphire devnet.

The whitelist was successful this time (frustrating as I verified I took the same steps as before).
However, when I tested a authentication call in Unity (iOS build platform), I received the same error in console as before.

I will be performing a test of this in a iOS build today and will reply with an update when I do.

I tested in an iOS build and got the same results as before. An error and no success state.


I verified that the domain the error tells me to whitelist and the client ID match with the whitelisted domain and client ID in my dashboard.

hi @neardev,

I hope everything’s going great. Could you please double-check if you’re using sapphire_devnet in your project and share the configuration code? Also, it’s crucial to make sure that the Client_Id you’re using refers to the same network. Based on some screenshots, there seems to be a mix-up there.

Looking forward to helping you sort this out!

Thank you for your help so far.


It’s definitely sapphire_devnet.

I may be being obtuse but I’m not sure what you’re referring to when you say “configuration code”. Here is the code I set up for testing following the Unity guide. Hopefully this is what you are looking for.

using System;
using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using Newtonsoft.Json;

public class Web3AuthTest : MonoBehaviour
{
    public Web3Auth web3Auth;

    public TextMeshProUGUI text;

    public enum providerenum
    {
        GOOGLE,
        FACEBOOK,
        REDDIT,
        DISCORD,
        TWITCH,
        APPLE,
        LINE,
        GITHUB,
        KAKAO,
        LINKEDIN,
        TWITTER,
        WEIBO,
        WECHAT,
        EMAIL_PASSWORDLESS,
        EMAIL_PASSWORD,
        JWT,
        CUSTOM_VERIFIER
    }
    public Provider providerchoice;

    void Start()
    {
        web3Auth = GetComponent<Web3Auth>();
        web3Auth.setOptions(new Web3AuthOptions()
        {
            redirectUrl = new Uri("https://com.Near8.Noded://auth"),
            clientId = "<My Client_ID>", //this seems to be the same as the client ID I have everywhere else.
            network = Web3Auth.Network.SAPPHIRE_DEVNET,
        });
        web3Auth.onLogin += onLogin;
        web3Auth.onLogout += onLogout;
    }

    public void login()
    {
        var selectedProvider = providerchoice;
        var options = new LoginParams()
        {
            loginProvider = selectedProvider
        };
        web3Auth.login(options);
    }

    private void onLogin(Web3AuthResponse response)
    {
        var userInfo = JsonConvert.SerializeObject(response.userInfo, Formatting.Indented);
        Debug.Log(userInfo);
        text.text = userInfo;
    }

    public void logout()
    {
        web3Auth.logout();
    }

    private void onLogout()
    {
        Debug.Log("Logged out!");

    }
}

Image 3-20-24 at 3.51 PM

I am new to a lot of this as I am primarily a Unity dev who doesn’t often work with 3rd party integrations, so there is a chance I am missing something obvious. Hope we can figure this out together + prevent it from happening to others.

Anything else I can provide?

Anything more on this? Would love to start integrating user accounts in our app using Web3Auth, but this is holding us back right now.

hi @neardev

I see two potencial errors :

Please try to fix or check this both things and contact me again if the problem persists.

Thanks

Thanks for the reply. I’ve checked my redirect URL again and it seems to be correct. If you’re seeing something wrong with it that I am not seeing, please let me know.

Could you clarify what you mean by this? I understand that it should be in Start(), but in what script? (I assume the Web3AuthTest script I sent?)
What are the variables there? Is rpcURL supposed to be the redirect URL?

Yes, of course. Please check the line in our example and try to implement it.

Ah ok. Yes this is from the example.
Just checked the example again and it has the right code that you provided. (web3 = new Web3(rpcURL);)
When I run the example in Unity with iOS build as the build platform, I get the same error that I always get in my actual project.

EntryPointNotFoundException: web3auth_keystore_get assembly: type: member:(null)
KeyStoreManagerUtils.getPreferencesData (System.String key) (at Assets/Plugins/Web3AuthSDK/Keystore/KeyStoreManagerUtils.cs:69)
Web3Auth.authorizeSession (System.String newSessionId) (at Assets/Plugins/Web3AuthSDK/Web3Auth.cs:368)
Web3Auth.Awake () (at Assets/Plugins/Web3AuthSDK/Web3Auth.cs:89)

Then, if I go ahead and enter my email, go through the email verification in browser, and go back to Unity, there is no success state with the login information.

I tested the example again with Android as the build platform and it worked fine.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.