I am quoting a comment found on
this thread, but it is simple and straightforward.
You can do the following:
1. Perform a factory reset of the phone.
2. Install Services Core.
3. Install Services Framework Proxy.
4. Install the FakeStore.
5. Open the Microg Settings app. Grant it all permissions and disable battery optimizations.
5.1 Add your Google account.
5.2 Turn on Device Registration, Cloud Messaging and SafetyNet.
5.3 Restart your phone.
6. Open Microg Settings app, check the status under Cloud Messaging. If it says not connected enter the following in the phone app: *#*#2432546#*#* and restart your phone. Check the status again - it should say Connected. (I had to enter the phone string and restart my phone twice until it said connected).