Sign In Register

How can we help you today?

Start a new topic
Answered

Is there a way to send a message to a unity client not logged in yet?

I'm attempting to create a way for unity standalone users to log in / sign up on facebook. Facebook's unity sdk only supports mobile and web.


My plan is to have the user log in on a spin-off web client. The flow is,

  1. user selects log in / sign up on the standalone client
  2. the client opens a url with the spin-off web client (containing a client ID of some sorts trailing the url)
  3. the user logs in / signs up in the spin-off web client
  4. on success, the response or data is sent to the standalone client via the trailing ID on the absolute url

is this possible with gamesparks? If not, any idea on alternatives?

Thanks for your time! Loving gamesparks, kinda glad parse is closing since it led me to you :)

Best Answer

Hi One More Turn,


That would all work without issue up to the point where you want to sent responses back to the standalone client from the WebGL client.

The main hurdle here is getting the token, if you could find a way to handle that you could skip the web client step.


As mentioned Facebook do not support this from a desktop client and have not provided an SDK. Everything you want to do is possible with GameSparks but you need to get that token from Facebook.


Once you manage to get the token you can have a look at he following scripts which contain a method of using the token which has worked for some customers in the past.


Cheers.

Oisin


Hi One More Turn,


As you mentioned, Facebook auth on a desktop client is not supported by Facebook themselves but I believe there may be paid plugins on the Unity Store that will address that issue. Your primary concern would be getting the auth token from Facebook.

 

There may be alternatives though, depending on what you have planned for your game.

Let me point you to a few relevant tutorials/documentation that may be useful:


How to implement external http callbacks

Unity challenges part-2 facebook login

Authenticate players using their facebook account

REST API



Thanks,


Oisin



 

I think you might have misunderstood me a bit.

Yes, the unity facebook sdk does not support Windows, Mac, and Linux builds. But it does support Web GL.


So, the Windows, Mac, and Linux platforms can open up the web browser to a Web GL spin-off client where facebook works. We then use that web gl client to get all our required info and then send it back to originating Windows / Mac / Linux client.


This is what inspired me but I don't have my own server so I wanted to see if I can use gamesparks solely.

 

Answer

Hi One More Turn,


That would all work without issue up to the point where you want to sent responses back to the standalone client from the WebGL client.

The main hurdle here is getting the token, if you could find a way to handle that you could skip the web client step.


As mentioned Facebook do not support this from a desktop client and have not provided an SDK. Everything you want to do is possible with GameSparks but you need to get that token from Facebook.


Once you manage to get the token you can have a look at he following scripts which contain a method of using the token which has worked for some customers in the past.


Cheers.

Oisin

we are having some problems with the forum and it seems that the scripts Oisin gave you are appearing as images.
If you right-click on the images in the post above and open them in a new tab, or choose 'view as image' you should be able to see those examples.

Sean

 

ah ok so its not possible. The entire plan was to get the token from the web gl to the standalone client.


Guess I can't do it :,(

Thanks for your help though!

Technically, it is possible, but you would need to figure out a way to send the fb-token back to the unity-instance so that our FBconnect-request can use it, and i cannot advise you on how you might accomplish this.
Certainly we dont support it out-of-the-box, not do FB.

Sorry about that,

Sean

 

The way I'm actually trying to do it is registering the standalone client with a device account then putting that client's game sparks id in a url that opens the facebook web gl client.

Once the user logs in the web gl client, the facebook token string is sent to the standalone client. Then I log the device account out and log into facebook with the retrieved facebook access token string!

Yes, that should work.
All our FBconnectrequest is going to need is the access token.
Once you send that back you should have what you need.

Sean

 

Login to post a comment