Building an Unofficial Stadia Client for iOS
First, we are going to have the option to scheme a mannequin so that we are in a position to characterize the controller because the
Navigator.getGamepads() feature would routinely invent.
We can now scheme our custom controller script. We can read our controllers the use of
GameController framework provided by Apple. We then parse that into our objects. For the reason that buttons must still be in a definite exclaim we bear it in the following system.
*We buy that we want to catch adjust over the first linked controller, we additionally handiest enhance one controller.
In my checking out, the
timestamp isn’t wanted so I left it clean. Essentially be jubilant to scheme the implementation to totally emulate the legit API. Now we have our controller knowledge prepared all that’s left is scheme a bridge of verbal substitute between our iOS app and a
WKWebView that runs Stadia.
WKWebView in iOS14, we are in a position to add an
Promise this can even lend a hand us in hijacking the
Navigators.getGamepads() feature and return our custom knowledge.
messageHandler that will give us our controller knowledge over a
Promise and override the last known say. (This draw that we are out of sync for one physique but we received’t mediate about this in-sport)
We are in a position to scheme a class with a draw that can perchance presumably load up a file (as String) and a draw that can perchance presumably setup a WKWebView so that it would possibly perchance most likely poke our custom code
In total what happens is at any time after we name
Navigators.getGamepads() feature. At any time when this feature is known as we now name our app code and land in the
usercontentController callback where we return our newest controller say.
Voila, we must always have a fixed working controller in any