Apples: Core and grate the apples (leave the skin on). Place in a large non-metallic bowl.
Roast the hazelnuts in a pan without adding any fat. Keep shaking the pan and remove the nuts to a plate as soon as they are roasted. Leave to cool. Remove some of their brown skins by rubbing the nuts between your hands. This is optional; you can leave the skin on if you wish, but I prefer to remove it as far as possible; not all of it will come off anyway.
Mix: Add the hazelnuts to the apples, together with the sugar, goji berries, raisins, and cognac if using any. Mix well, cover the bowl with foil, place in the fridge, and let stand for about 5-6 hours or overnight.
Preheat: When ready to bake, start by preheating the oven to 180 degrees Celsius/ 350 degrees Fahrenheit. Butter a 30 cm/ 12 inch loaf pan.
Mix the flour, the baking powder, cacao nibs, and all the spices. Add this mixture to the apples and mix well with the hand. Place the mixture into the prepared pan.
Bake for about 1 hour. The cake is very moist; see the pictures, it looks pretty wet and undone, but it is cooked through.
Check: You will not be able to check for doneness by inserting a skewer in the middle. I always take the cake out of the pan, and if the bottom has a nice, rich, golden brown color and the crust feels relatively firm, I stop the baking process. If not, I place the bread back in the oven without the pan, directly on the oven rack, and bake it for 5 more minutes, then check again.