These apps don't usually give the driver or restaurant access to the customer's phone number.
They use a proxy system where the driver has to call a standard number provided by the app and then input a code to identify the specific customer.
That's typically only available while the order is in progress.