Blac Chyna has been granted a temporary restraining order against her ex-fiancé, Rob Kardashian, after he shared explicit photos of her on social media to get revenge for her alleged cheating.

>> Read more trending news

CNN reported that Chyna claims in the petition that Kardashian was violent with her.

On one occasion Chyna, 29, whose legal name is Angela White, said that Kardashian, 30, became violent when Chyna tried to call the father of her son, 4-year-old King Cairo, during an April argument.

Related: Rob Kardashian accuses Blac Chyna of cheating on him, using him for money on Instagram

“Rob immediately grabbed my phone and pushed me to the ground by aggressively shoving me by the side of my arm and hitting me on the side,” the claim said. “I fell down from the blow to my side. I was sore and it hurt to walk.”

Last week, Kardashian went on a social media rant and shared many nude photos of Chyna on Instagram. The social network eventually disabled Kardashian's account, and he later took his cheating allegations to Twitter.

Kardashian and Chyna are parents to 8-month-old daughter Dream Kardashian.

Chyna and Bloom appeared on "Good Morning America" Monday ahead of the court appearance for the restraining order.

“I was devastated. How could somebody post these pictures of me?” Chyna said of the first time she saw the photos on the internet. “This is a person I trusted, and I felt betrayed.”

Related: Blac Chyna seeks restraining order against Rob Kardashian

According to The Hollywood Reporter, after the court appearance, Robert Shapiro, Kardashian's lawyer, apologized on his client's behalf.

“I personally on Robert Kardashian’s behalf apologized and offered our regrets for what has taken place in the past couple of days, and now we move forward to do one thing and one thing only -- whatever’s in the best interest of this child,” Shapiro said.

Bloom said outside the courthouse she was pleased with the outcome of the hearing.

“The judge gave us everything we asked for, which is a set of very strong restraining orders, restraining him from coming near her and cyberbullying; restraining him from posting anything about her online.”

“As we have said all along, revenge porn is a form of domestic abuse,”she said. “It is also a crime in California and 38 other states.”

“I'm just going to get back to co-parenting Dream,” Chyna said after the hearing.

BuzzFeed News reported that under the restraining order, Kardashian must stay 100 yards away from Chyna and cannot post photos of Chyna, her son King Cairo or their daughter, Dream.