Authenticating with Playfab LoginWithAndroidDeviceID() (SOLVED)

Using this code:

	local request = {
		CreateAccount = true,
	}
	PlayFabClientApi.LoginWithAndroidDeviceID(request, onSuccess, onError)

Produces this error:

{ --[[0x72e2f49730]]
  code = 400,
  status = "BadRequest",
  errorDetails = { --[[0x72e2f49970]]
     = { --[[0x72e2f499c0]]
      1 = "One of the following properties must be defined: AndroidDeviceId, EncryptedRequest"
    }
  },
  error = "InvalidParams",
  errorCode = 1000,
  errorMessage = "Invalid input parameters"
}

Despite the documentation on this page lists the AndroidDeviceIdparameter as optional.

Is there a way to get the Android device identifier for the user's device that’s needed somehow?

Update: Defold get_sys_info() to the rescue!

local sys_info = sys.get_sys_info()
print(sys_info.device_ident)

Note that we may remove the device_ident value the avoid Google Play issues:

If it is indeed removed, what would the workaround be? And would it also be removed on iOS?

It seems PlayFab requires you to identify this value yourself (it doesn’t seem part of the PlayFab SDK).

It would be moved to an extension.

1 Like