How to set and get the accessNode in Mobile using Kotlin FCL

Hello everyone!
I am doing an integration of the FCL in kotlin and swift importing “com.portto.fcl.Fcl” (kotlin) and “FlowSDK” “FCL_SDK” (swift).

Is there a possibility to set the accessNode as it is done in JS SDK? and also to get the current accessNode where is connected?

For example in JS FLOW SDK it can be set like this:
fcl.config({
“accessNode.api”: APP_ACCESS_NODE
});

How can we do on kotlin?

Hope someone can help.
Thanks!

there is no easy way as far as I can see. https://github.com/blocto/fcl-swift/blob/256527d50476db2c85582bb7036fdb037425b855/Sources/FCL-SDK/FCL.swift#L25-L35

it is using config.network in many places, none of them supporting custom option.

1 Like

Thanks for your response bluesing.

Looking at the code, the network parameter is set with a .testnet or .mainnet, and does not accept to set a direct url:

fcl.config.put(.network(.testnet))

Seems that the node access url is set depending those parameters but we do not fin the place where the url is set. Do you know where the access node url value is set?

1 Like

it is in SDK ( https://github.com/blocto/flow-swift-sdk/blob/f6402b1bfbebebbf9199ee97debc73001e6479d1/Sources/FlowSDK/Network.swift#L18-L32 )

setup here probably: https://github.com/blocto/fcl-swift/blob/256527d50476db2c85582bb7036fdb037425b855/Sources/FCL-SDK/FCL.swift#L28-L35

checkout swizzling with swift ( hacky way to fix ) or you can just change SDK code (or better PR to blocto FCL )