I’m trying to implement PlayFab into my game. I want to be able to register/login with Google (I have registration with email working OK). As far as I can tell, the way to do this with the PlayFab REST interface (via the PlayFabLuaSDK) is for me to have a web page which invites the player to sign in via Google, then authenticates with PlayFab. This bit works OK - I found a PlayFab example here which gave me a useful index.html file.
I can get Defold to open this web page OK with sys.open_url(MY_URL) and PlayFab reponds fine, the response being picked up in the index.html here…
// Handles response from PlayFab
function onPlayFabResponse(response, error) {
if (response) {
logLine("Response: " + JSON.stringify(response));
// do something here to get the info back to Defold??
}
if (error)
logLine("Error: " + JSON.stringify(error));
}
and I assume in Defold I need to be doing something like:
playfab.LoginWithGoogleAccount.flow(request, onSuccessGoogleLogin, onErrorGoogleLogin)
or maybe just picking up the Entity Token details etc from the PlayFab response.
But I’m not at all clear how I actually get that information into Defold. I assume I need to do some kind of deep linking, some function in the javascript to open my app via a URL, but I can’t find any examples or documentation on how this is actually done.
I have added an intent filter to my AndroidManifest as below:
<activity android:name="com.dynamo.android.DefoldActivity"
android:configChanges="orientation|screenSize|keyboardHidden">
<!-- Intent filter to handle custom URL scheme -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="com.mycompany.mygame"/>
</intent-filter>
</activity>
where com.mycompany.mygame matches the package.
That’s about as far as I can work out what to do - I am not clear how I actually get the info which has come back from PlayFab back into Defold.
Are there any examples of this or can anyone advise me how to proceed? I feel like I’m nearly there but am failing to grasp one last step which will hopefully get me there.
Any help very much appreciated, thanks!