Cross platform App token aquiring for Unity - c#

I'm completely new to the whole facebook login scene. Unfortunately the login process seems so complicated considering I simply want to be able to call a login dialog and get back the user's App Token. When I run the example code the login screen asks for an app token not an email and password like I'd expect to see as a user.
From my understanding it appears that even using the Facebook Unity SDK I am still required to build my own login page with app token generator which I have no idea how to do. It also appears there are different ways it needs to be done whether you are on IOS, Android, Web Player, Windows and Windows Phone. Is there really not one way to do this?
I followed the tutorial here: https://developers.facebook.com/docs/games/unity/unity-tutorial although all the images regarding setting up your app on developers.facebook.com/apps are out of date and I can't find a good majority of the options it mentions.
So I guess my main questions are:
Can you have one way across all platforms to allow email/password login for a user?
Do you need to build your own token generator on a website?
How do I set up a game for Unity in the new facebook layout?
Thanks everyone. I've never dealt with authentication via any online service before and this seems much preferable to having my own login authentication for my games. I just wish it wasn't such a confusing mess to someone who has never dealt with any of this before.

The app token thing is only used in Unity editor, so only in development. This is a work-around, since it was impossible to simulate regular facebook login flow in Unity editor and we wanted devs to be able to test their games in the editor, which is much faster than building and uploading it.
You are not supposed to create your own login process. Just import the sdk package into Unity and open scene InteractiveConsole in Assets\Examples
Try building it for iOS/android/canvas, it works on all platforms without any code change necessary
Let me know if have any problems

1 and 2
My assumption is the access "token" you mention is a generic login for testing in unity. Your app should handle the login differently across platforms, in regard to the "Facebook Unity SDK API's" handling the bulk stuff so you are free to plug and play.
3
Image of my settings for the canvas demo https:// developers .facebook .com/apps/#____#/settings/
https://drive.google.com/file/d/0B7Lk_CfjfKfTdVlNQWlINkNCTU0/edit?usp=sharing

Related

WebView2 WPF Google log in

Easy question, not sure if there is a solution for this problem.
I made a simple browser with WebView2 in a WPF C# app (I made this to be able to use a shell app while I browse on the url where the webview is). It use the same useragent as edge-chromium and until some months ago I was able to log in to google like in a regular browser.
Now if I try to log in I get a "Not supported browser" error from google.
Of course nothing changed in my application, but google say that it will not support log in from a webview ("browser that: Are embedded in a different application"):
https://support.google.com/accounts/answer/7675428?hl=en-GB
I don't really know if there is any workaround for this. I know that I was logged yesterday (and I think that it was possible thanks to the cache or something like that) so if there is a workaround to log in I should be able to stay log in. I know they suggest to use the google API:
https://developers.google.com/identity/protocols/oauth2/native-app
And I already used that in a Unity3d game to log in to my google drive. But I'm not sure how to set my WebView2 to be logged in when I call that API (I know that I can use the response to make new API call and, for example, upload a file to my google drive, but I don't know how to set my webview to be logged and be able to go to google drive url and be logged in any google app).
My question is if you know how to solve this problem or if you got any idea on how to solve it. Or do you think that's not possible at all?
EDIT.
just find out this is a problem with any webview. like you can see here github.com/MicrosoftEdge/WebView2Feedback/issues/1647 it's a security bullshit of google that, instead of finding a solution, blocked every webview out ther from log in to their services (they could solve the man in the middle problem in many ways like asking for a password app, ask for a more limited webview sandbox window etc... they just blocked everything).
So there is not really any solution for this. Even by using Oauth API you can only log in and wait for the response but you cannot access google like in a regular browser with that, you can only make more API call... that's not what I need.
The only solution that I can think of is to just wait for microsoft or someone else to make a "sandbox environment" that will activate by default in a log in page of google (and that google will allow to log in), and will revert back to the regular webview once it is logged in.

Post to my page from my facebook App using c#

I designed a contest application for my Facebook page.
The application is a web application (MVC / C#), using Facebook connect to authenticate users.
I would like that when a person wins in the game, the application publishes on my Facebook page (not on the profile of the user, only on my page) a message like "Georges B just won a Bluetooth headset."
I have no problem with development or code. But Facebook is a gas plant and it is very difficult to find up-to-date documentation. I tried with Token users, but it does not work anymore. I do not know how to do it because the majority of tutorials on the web use this solution.
Thanks.
OK, negative notes without any explanation. This forum becomes anything. I understand the basics of respect but still, it is not with repression that people are advanced ... Explanations would be a minimum.
I'm going to fend for myself and I'll only read the existing posts without participating in the future.

Invite Facebook friends to mobile app that is not a game

I have a mobile app (on WinPhone 8.1) that uses Facebook credentials for Azure authed login.
What I'm trying to do:
Provide users an organic way to invite facebook friends to use the app. Important to note, users gain no advantage by inviting friends, however it will enhance their experience as you can compare your progress in the app with the progress of friends (it is not a game).
Where I'm stuck:
I can't use the apprequests dialog, as it is not a game. I would like to use the 'send' dialog, but it is not available in mobile browsers. It is not a website, so using the POST publish API has no valid href to link (other than the app's download page, but that is not what the publish API is meant for).
What should I do?
This post explains how to do it.
Otherwise, I would suggest you to market your app like a game, a bit of gamification should not hurt ! ;)

Is it possible to login to multiple facebook accounts? (C# 4.0)

I am creating a small desktop application, which would ideally allow multiple facebook users to log in. After they play a game (on one machine), I'd like to be able to individually post their status to their Facebook accounts. This is possible if there is just a single user, but multiple users are causing problems with Sessions and so on. Can anyone advise a way to get around this? Thanks!
To better answer your question, it would help to know how exactly you're connecting to Facebook from your game software.
In general, if you're using OAuth tokens to do it, try keeping separate sets of access tokens and pass along each one when appropriate.

Twitter integration and authentication

I am writing an app using WPF 3.5 and I need twitter integration.
I know that there are many API's for C# and most of them seem to be on the right track.
But one, painfully annoying (seemingly 100% required) step of the twitter posting is that you need to redirect the user to the twitter website, in which they need to login and click "allow" which then shows a PIN number which the user must enter in to my client app in order to simply tweet.
This is so cumbersome and annoying for each run of the app, I dont mind a once off thing, but each time?? Am I not doing this right, why isnt it just a once off allowance of a registered app? How do apps like TweetDeck do it so that they dont have to re-approve each time I load the app?
You need to store the token and the key provided by the server when you perform the OAuth authentication. You can continue to sign your requests using those keys. I'm not entirely sure which library you're using, which makes it hard to say, but there should be a means of retrieving the key/token that Twitter provides you with and passing this back in as a means of authentication.
One other alternative is to use xAuth, which makes it a little easier for your app to authenticate the user. The downside is that it's pretty oblique and might not be supported by the library you're using.
Good luck!

Categories