Charli and Guetta facetimed for Beats1
talking about the creation of the song.
Charli wrote the song alongside Noonie Bao & AG Cook. Guetta, Afrojack and French Montana also have writing credits. I presume Charli wrote the song with Noonie Bao and AG Cook when she was making songs for her mixtape, as they worked with her on it in LA and Guetta had already heard the song before he jumped on board.
Blogs are reporting that Skrillex was involved in the track, although he doesn't have an official production credit. I'm pretty sure AG Cook and Skrillex produced the track before Guetta and Afrojack made some changes to receive credit (they're bigger radio names so this makes sense for all parties involved).
Charli said she's done a lot of tracks for David, hopefully they won't all be stuck on her google drive (or in the hands of her fans that hacked it).