(Assuming you have some type of server management knowledge)
yes you don't need to Firebase
or Parse
to achieve that but it's pain free :(
Do you want a Server or (Google Cloud Functions or AWS Lambda)?
(Keep in mind that your app 'd need to talk to each choice via HTTP
or HTTPS
request).
(you can get that VM anywhere AWS EC2, Google Cloud VM, Digital Ocean)
Let's start with the server, you need to create some REST API
and running it from a specific port 80 or 443(secured one). Instead of learning a new language, you can use Swift (look at library such as Vapor that would help create that rest api, or check for other library).
**if you are not using swift, then use javascript (Node.js library such as Express would help you create that api) **
Email or Phone Verification Logic (server side, your api has a specific route that handles verification):
(look for library that let's send email on the server side. )
- in this route/path you'd receive from your app a
Dictionary
that contains an email or phone number
- compute some random number
- 2 cases here: (email) send an email to the user's email with a message body containing that random code. (phone number) you using
Twillio api
to send code via text message.
To end your api route/path's response, send this random code to app
( cache it into UserDefault
or whatever you preferred, because when the user inputs the received code, you need to verify it (since the code generated from server side is cached, I mean now you get the gist )
Managing that VM:
keep vm port lock from the outside meaning firewall
- you need to update the system
- what if your system reboots (what happens to your api)
what if you get a lot of requests at once (you should have load balancing))
Cloud functions or AWS Lambda (ELB + Api Gateway + Lambda instead):
no need to manage a server
- can't use swift, you'd need to learn
javascript or python
- same Verification logic applies here
To secure connection between from your app to your api, look at JWT Token, you need to make sure nobody else can't access any routes from your api