The Food and Drug Administration has approved an antipsychotic drug that carries a digital sensor to track whether patients are taking it, according to an agency announcement published Monday.

The new drug, Abilify MyCite, is used to treat schizophrenia and manic episodes associated with bipolar disorder. After a patient has swallowed it and once the medication reaches the stomach, a sensor sends a message to a wearable patch, which then transfers information onto a mobile app.

Patients then use the app to track whether they have taken their medication and they can give caregivers or doctors access to that information through an online site.

The drug was made in collaboration with Otsuka pharmaceutical and Proteus Digital Health, which designed the sensor. It's the first of its kind to have such a tracking system.

“Being able to track ingestion of medications prescribed for mental illness may be useful for some patients,” Dr. Mitchell Mathis, director of the Division of Psychiatry Products in the FDA’s Center for Drug Evaluation and Research, said in a statement. “The FDA supports the development and use of new technology in prescription drugs and is committed to working with companies to understand how technology might benefit patients and prescribers.”

The labeling for the drug notes that it isn't clear, however, whether patients were more likely to take the drug because of the app.

Abilify on its own has been approved since 2002 and is now off patent. Its combination with the sensor retains a black box warning, which the FDA places on medications when serious side effects can occur.

In the case of Abilify, the label notifies patients and doctors that older patients who have psychosis as a result dementia would be at an increased risk of death if they were to take the medication. In children and teens, as well as in young people who take antidepressants, Abilify MyCite can have an increased risk in suicidal thoughts and behavior. FDA published another warning in 2016 showing that in rare cases some patients began having compulsive urges to gamble, binge eat, shop and have sex.

More common side effects for Abilify include nausea, vomiting, anxiety, insomnia and restlessness. Additionally, the patch that tracks the sensor can cause skin irritation.

The FDA previously rejected the drug about 1.5 years ago, saying it needed more information about whether human error could create any risks.