App to lock my iPhone for some time I already asked a similar question sometime ago (though that was focused on free apps) and the answers were negative, but I've done some research and it seems there could be a way.

Basically, I’m looking for apps which lock the phone, either for a specific app (I.e. “don’t use Facebook for 1 day”) or for the full phone (I.e., “don’t use any app for the whole day, except for phone calls &amp; SMS”). On Android this is doable with Offtime. On iOS Offtime (conveniently renamed to “Offtime light”) is totally useless (it doesn’t lock anything at all). 

However, on the iPhone I found two more apps which seem to be able to do what I want: Flipd and Freedom. 

Flipd

The app requires me to install a MDM certificate on my phone in order to allow locking. However, I don't know what a MDM certificate is, and since this is a company mobile, I cannot risk third parties to access my emails and documents. Is it safe to install the MDM certificate? 

Freedom

This app doesn't seem to require a MDM certificate (I can't be sure because I haven't downloaded it: it looks like there's no free trial, so before buying it I want to be sure it works). It does require a "limited VPN", though. Again, is this safe?

If both apps aren't safe, are there safe alternatives?
I'm from the Flipd team and just wanted to chime in here. The MDM used to activate the Full Lock in order to hide your apps is completely safe. Not only does Apple thoroughly vet apps like ours that use MDM, the call we make via MDM is only to hide your third-party apps and then to push them back onto your device over the internet at a scheduled time. This feature is similar to Apple's Restrictions mode, but on a schedule. 

The only error you might run into is if you have a weak or no internet connection; at which point your apps may not appear as scheduled. This is easily resolved by uninstalling the MDM and your apps will return immediately. 

I hope this helps!