Your code seems to be using the useAppMetafields hook correctly. But the hook will return an empty array if the metafields are not set correctly or if there’s an issue with the configuration.
You should ensure that the metafields are properly set up in the shop and that the keys and namespaces match exactly with what’s in the shop. Are there any error messages or warnings appearing in the console?
I’m having the exact same issue trying to access a customer metafield. I reinstalled the app in case it was a scope issue but the array is still empty while the metafield is setup correctly
Another thing that might be happening is that the effect is running before the Metafields data has been initialized. Since the effect doesn’t have any dependencies it’s only running once. It would be worth adding a dependency to the useEffect on the value returned from the useAppMetafield hook.