Former President Barack Obama, without mentioning his successor, urged people in leadership roles not to use social media in a way that promotes divisiveness, CNN reported Wednesday.

In a BBC interview conducted by Great Britain’s Prince Harry, Obama warned that the internet risks reinforced prejudices and a fractured society.

“All of us in leadership have to find ways in which we can recreate a common space on the internet,” Obama told the prince in an interview that aired on the BBC 4’s “Today” program. “One of the dangers of the internet is that people can have entirely different realities. They can be cocooned in information that reinforces their current biases.”

Obama did not mention President Donald Trump by name during the interview, but Trump has been an outspoken and controversial user of Twitter.

Obama's interview with Prince Harry was taped in September during the Invictus Games in Toronto, CNN reported.

Asked how he felt the day he left office in January, Obama said he had mixed feelings.

“The sense that there was a completion, and that we had done the work in a way that preserved our integrity and left us whole and that we hadn't fundamentally changed, I think was a satisfying feeling,” he said. “That was mixed with all the work that was still undone and concerns about how the country moves forward. But overall there was a serenity there, more than I would have expected."

Asked by Harry what was the biggest change for him after his eight years in office, Obama reflected on a slowed pace of life and the new freedom he had to decide how to focus his activities.

“The things that are important to me haven't changed, I still care about about making the United States and the world a place where kids get an education, where people who are willing to work hard are able to find a job that pays a living wage, that we are conserving the amazing resources of our planet so that future generations can enjoy the beauty of this place like we did,” he said.

Questioned live on the air after the pretaped interview was broadcast, Prince Harry said the guest list has not yet been put together for his wedding to actress Meghan Markle next May, CNN reported.

Asked if he got along well enough with the former president to invite him to the event, the prince laughed off the question, CNN reported.

“Well, I don't know about that,” he said. “We haven't put the invites or the guest list together yet so who knows whether he's going to be invited or not. I wouldn't want to ruin that surprise.”