Login sketchfab runtime from UNITY


(Suzitpunk) #1

I’m trying to login sketchfab on runtime using “username” and " password", but when i’m logging through editor window its logging inn (printing “accesstoken”).

runtime - accesstoken - not getting
editor window - accesstoken - getting.


#2

At the moment, I don’t think you can login at runtime. @waleguene ?


(Waleguene) #3

Hi @suzitpunk,

The plugin is currently not designed to work at runtime, but I tested and I’m able to login at runtime (meaning clicking Play, opening the plugin and loggin in)

Do you have any issue in the console ? Also, do you use the latest version (1.0.2) ?
The access token should not be printed anymore


(Suzitpunk) #4

@waleguene, thanks for the reply

Runtime means through scene(with in the app-VR), are you able to login? Actually according to our app feature there should be login through game(standalone), is it possible? If yes, then can i get code snippet? Ans yes i’m using latest version 1.0.2


(Waleguene) #5

@suzitpunk
The login is just a UnityWebRequest being sent and the response being retrieved and read so it’s possible and it should work yes.
I don’t have any snippet for login but I have one that runs a UnityWebRequest at runtime (in Editor pushing Play, or in a build app) and uses the Sketchfab API to search for models.
It was just a test to check that Sketchfab API can be requested in runtime Unity apps.

In order to visually check the result, a cube is translated by request.responseCode / 10 (so the middle cube is not aligned anymore with the two other cubes at the end)

It’s just a way to check that the response is not 0 and that the requests works.

Maybe it can help:
TestAPI.zip (14.4 MB)


(Suzitpunk) #6

@waleguene, Thanks for that. I’ll check for it.