Share WiFi credentials from a mobile app

Is there a way to share the WiFi credentials from a mobile app (iOS, and in Android in the future) with a Linux app?

This is what I try to do:
I am currently working on a (modular) kiosk system, based on a Raspberry Pi Zero W.
I have three apps.

  • WebApp, that serves content
  • Linux App, that runs on a Raspberry Pi, hooked up to a display. It has WiFi and BT on board
  • Mobile app, that controls settings on the Linux App

Somehow I want to share the WiFi credentials of a phone with the Linux app.
My approach would be like:

  • On the Pi there will be a button. When held for 5 seconds the Pi enter a BT detection mode. A short press will show a QR code. The QR code will hold info to identify the Pi, to connect to de WebApp
  • De Mobile app uses BT to detect the Pi
  • Create a connection between the Pi and the mobile app via BT.
  • The mobile app shares WiFi login credentials
  • The Pi will use those credentials to connect with the WiFi network
  • The Pi will connect with the WebApp to sync, and will periodically see if there are any content updates.

But is it even possible to share WiFi settings? Google’s Chromecast does something like that, right?
I just want to make this as easy as possible. Without using a keyboard or as little user interaction as possible.
I should be plug-an-play not plug-and-pray, with the little help of a mobile app :wink:

Eventually, if everything works, I might need to get this working on 100 ~ 150 Pies. And maybe even more. The Pies are out of stock, almost everywhere. So, for now I’m testing on my old Pi.