Listen, Jack, c'mon man! Here's the deal. God appeared to Solomon after he finished building the temple, and said he'd forgive the people if they'd repent and pray. So Solomon prayed, and God appeared to him again in a dream and said He was pleased with the prayer and would answer it if the people kept His laws. So Solomon and the people worshipped God, and God blessed them. No malarkey!
My father used to say that if you love God, He'll love you back. And that's what happened here. God lit up the temple with fire, and the people were so excited they bowed down and praised God. Then God told Solomon He'd forgive their sins if they asked Him to. See here, Jack, He said if they sinned again, He'd punish them.
What was that? Oh yeah, then God said if they continued to obey His laws and follow Him, He'd keep them safe and make their country great. And Solomon and the people followed God and were blessed. Not gonna happen, I tell you what. They enjoyed peace and prosperity and God kept His promise. Excuse me, literally!