question

dev onzenga avatar image
dev onzenga asked

,Getting NotLoggedIn after logging in with LoginWithIOSDeviceId

,

I have an app that lets user to login using their email/password. As part of UX enhancement, I am trying to implement auto login upon app open. I am doing so by linking device Id whenever user logs in with their email/pass, and unlink device ID when users specifically logs out.

I have this feature implemented and is working, but whenever i login using LoginWithIOSDeviceId, all subsequent client API call returns with “NotLoggedIn”. I think I can probably store the session ticket to PlayfabSettings.staticPlayer, but it feels hacky. Any suggestions?

apisAuthentication
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

May I ask what does it mean by "unlink device ID when users specifically logs out"? To be clear, PlayFab is a service based on RESTful API, and it is stateless. As long as the client has a valid session ticket or entity token, it is able to call any client APIs, and the session ticket/entity token will last 24 hours before expiration.

"NotLoggedIn" simply indicates the client doesn't have any access token for authentication. How about the callback result from LoginWithIOSDeviceId? Does it return a successful callback?

In addition, if you are working to implement PlayFab SDK on a platform like Unity, C#, please note that all the API are called asynchronous. Make sure the subsequent calls are made in the callback result of login API, otherwise, you need to make sure the session ticket/entity token are assigned (SDK will do this for you), before any client APIs are called.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.