Put the apples, onions, sultanas, vinegar, ginger and garlic into a large, heavy, non-reactive pan. Simmer for about 20 minutes, until the apples begin to soften.
Add the sugar, spices and salt and stir over low heat until the sugar dissolves.
Simmer uncovered for 1 1/2 to 2 hours, stirring more frequently as it thickens, until dark, glossy and jammy.
Test: drag a spoon across the base of the pan. If the line stays clear for a few seconds without liquid rushing in, it is ready.
Fill hot, sterilised jars with vinegar-proof lids, leaving 1 cm headspace, and seal immediately. For a shelf-stable seal, process in a boiling water bath for 10 minutes.
Store somewhere cool and dark for at least a month before opening.