As you figured out the message was a scam, your phone was not hacked, until you installed the app. To be really safe you should restore your phone to factory settings, then restore a backup made before this incident. If you paid a subscription fee for the app cancel it and request a refund. Here is a one-stop link for billing questions→Subscriptions and Billing - Official Apple Support. You can review your purchase history to see what you were charged for, cancel subscriptions and request refunds.
And to protect others in the future go to the App Store, find the app, and tap Report a Problem.