Combine tomatoes and garlic in a medium saucepan with enough water to cover. Cover pan and bring to a boil over high heat. Reduce heat to a simmer and cook until tomatoes are soft.
Blend tomatoes, garlic, and 1/2 cup of the cooking liquid, along with the apple, oregano, cinnamon, black pepper, allspice, vinegar, salt, and chiles.
Heat the oil in a pan over medium high heat. Pour mixture into pan, taking care to avoid the splatters that will erupt at first. Simmer until the flavors have melted. Let cool, then chill.