Brown discharge but started birth control?

My period started on the 4th and I started to take birth control that same day. It’s been 6 days in on birth control and today I’ve had serious cramping, lower back pain and brown discharge ? Is this because of birth control or am I pregnant? I don’t understand how I could be pregnant if i got my period , not even near what my supposed “ ovulation” time should be. Also doesn’t implantation bleeding occur when you’re supposed to get your period ? I did have unprotected sex on the last two days of my period. (The 6th and the 7th)

My period isn’t for another 22 days also?

Could that possibly have correlated to the dark spotting?

Shit would I be able to take a pregnancy test? Or is it too soon?