CustomNodeConfiguration initializer is inaccessible on iOS SDK

When I tried to create a custom node configuration I get the following error

error: 'CustomNodeConfiguration' initializer is inaccessible
    due to 'internal' protection level
            let configuration = CustomNodeConfiguration(rpcUrl: customRpcUrl, chainId: customChainId)
                                ^
    MagicSDK.CustomNodeConfiguration (internal):4:14: note: 'init(rpcUrl:chainId:)' declared here
        internal init(rpcUrl: String, chainId: Int? = nil)

Hey Rajesh! Currently troubleshooting the issue. Curious to know whether or not you’re following our iOS SDK documentation?

I did follow that documentation. As it states that while creating the constructor we can pass a custom node using Magic (apiKey: String, customNode: CustomNodeConfiguration). In order to create the CustomNodeConfiguration object I used let configuration = CustomNodeConfiguration(rpcUrl: customRpcUrl, chainId: customChainId). I’m assuming the CustomNodeConfiguration constructor is not explicitly marked to public, hence the error.

Thanks for sharing that. I’ve filed a ticket for our iOS team member to look deeper into this. Please give us 2-3 business days to get back to you on this!

Hey @RChaganti, Jerry here. Could you share what version of SDK are you using? I just checked the codebase, CustomNodeConfiguration is public

Hi @Jerry_Liu, I added the dependency as ‘MagicSDK’ without explicitly mentioning any version number. The installed version is MagicSDK (2.2.0).

Yep, it’s a bug. I’ve made a patch in 2.2.1. Feel free to give it a try. :smile:

3 Likes