In a food processor, puree onion, garlic, ginger and chili (if using) until a paste. Heat oil in a large skillet over medium-high heat for 1 minute. Add cumin seeds and cook for 30 seconds, then add onion paste and stir, cooking for just over 5 minutes, until onions have browned slightly. Add tomatoes and simmer vigorously for about 5 minutes, until reduced slightly, and oil appears at the edges of the liquid. Stir in the yogurt and spices, stirring constantly until evenly blended. Add chicken and season lightly, tossing to coat. Stir in apple and cashews.