The defendants were formally charged last week and all but one were released after detention hearings. They have been ordered to use the internet only for work purposes and are barred from unsupervised contact with minors.

Investigators said children can be susceptible to sexual predators online. Many gaming, chat and dating apps lack safeguards to keep children from being contacted surreptitiously by people seeking to lure them into sexual encounters, even while in the company of their parents.

“When we think back to the luring of subjects in playgrounds with a puppy or candy, it is a totally different ballgame now, with the advent of the internet and with these apps that make it so easy for predators to prey on our most vulnerable,” Col. Patrick J. Callahan, the superintendent of the New Jersey State Police, said.

The state police were helped in the sting by agents from the F.B.I. and Homeland Security Investigations.

None of the apps used by investigators during this investigation have age verification features, the attorney general said. The officers also used popular games, such as Fortnite and Minecraft, and the gaming chat platform Discord.

“It’s incumbent on app developers to do more to ensure that those apps are used by age-appropriate customers,” said Mr. Grewal.

One of the men arrested, Luis Gonzalez Palacio of Weehawken, N.J., had more than 13,000 files of child pornography on his computer when he was taken into custody, the state police said.