Court rulings and new App Store rules are beginning to weigh on one of the iPhone maker’s profitable growth engines