I think you need to be firm about your decision on homework first. It is definitely not going to be easy initially (expect lots of tantrum throwing) but if you stick to it, eventually he will know you are not kidding.
I also think at the preschooler age, you can also try to have a good talk with him, come up with a timetable together with him. Reward him when he makes an effort and make a huge thing out of it so that he feels good. If you are trying to reduce the time on ipad and iphone, set a timer and also make sure he has other stuff to do after smartphone time ends. Many times, it's because he has nothing better else to do at home and hence he keeps extending the time.
Another easy way is to just turn off the wifi. :p