It is optimal to not force the user to create an account on an E-commerce website/application since the objective is to increase the purchases, as noted here.
What about a Social Network application? When an user downloads the app, it is better to let him access the content (like posts and other profiles, while obviously limiting what he can do without an account, like commenting or messaging) and when he wants he can create an account, or it is better to just present him a onboard page to create an account when he first opens the app? For a Social Network the objective is to increase the number of accounts present and monthly active users, so what onboard approach is more performant?
If I recall correctly, the TikTok app used to let the users access the content before an account was created, now it is necessary to view videos and access the rest of the app. But we are no way near the amount of users TikTok has.