Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Facebook Login Implemented? #335

Open
diasleo98 opened this issue Jun 30, 2020 · 19 comments
Open

Is Facebook Login Implemented? #335

diasleo98 opened this issue Jun 30, 2020 · 19 comments

Comments

@diasleo98
Copy link

I was taking a look on how to implement Facebook Login with Parse and found out that ParseFacebookUtils is not presented in the project and found no implementation what so ever of it. Is it implemented?

@TobiasPott
Copy link
Member

No, the facebook utils are no longer part of the master branch.
If you want to check them out you would need to dig in past commits (e.g. those made for version 1.7 or earlier).

@diasleo98
Copy link
Author

In my case, i’ve already implemented the Facebook login with the Xamarin.Auth package, after I sign up with the Facebook account, how do I link it with a new parse user? Because when i create a new parse user i need to provide a password as well, in the facebook case it is not needed. My question is the same for when I log in with Facebook, how do I log in with Facebook without the ParseUser password

@diasleo98
Copy link
Author

And in this 2.0 pre-release, are Push Notifications now implemented?

@TheFanatr
Copy link
Contributor

I will address the lack of ParseFacebookUtils soon.

@TheFanatr
Copy link
Contributor

@TobiasPott Where did the 1.8.0 branch go? I needed that for reference. Release 1.7.0 contains the source for that release obviously, but the 1.8.0 branch had some extra changes in it that the previous maintainers were working on. Would prefer to have that in a "old-codebase" branch or something if you still have access to a copy. The source I currently have access to will do fine for now though. Will implement a login utilities file soon as well as live query.

@TheFanatr
Copy link
Contributor

And in this 2.0 pre-release, are Push Notifications now implemented?

The infrastructure does exist but I have no idea if it works or is usable; will have to test.

@TheFanatr
Copy link
Contributor

Just to be clear, any OS-or-platform-specific code is not present in the current codebase. Will have to add this back in some form later.

@TheFanatr
Copy link
Contributor

TheFanatr commented Sep 4, 2020

@diasleo98 Please build and reference the develop branch, then instantiate ParseClient with a FacebookAuthenticationMutator with the Caller set to the App ID from Facebook. You can then use Parse.Infrastructure.Utilities (Parse.Utilities in the future) and call await aParseClient.AuthenticateWithFacebookAsync(facebookId, accessToken, invalidationTime, cancellationToken). You should have access to facebookId (the user's identifier on Facebook), accessToken, and invalidationTime from the result of successful authentication calls to Facebook's OAuth APIs. That should be able to authenticate a user with Facebook for the Parse SDK.

@TheFanatr
Copy link
Contributor

TheFanatr commented Sep 4, 2020

I will add the convenience utilities for individual environments back some time in the near future, in order to eliminate the need to call into a service's OAuth APIs with external utilities such as Xamarin.Auth.

@TheFanatr
Copy link
Contributor

TheFanatr commented Sep 4, 2020

For now, someone needs to test this, because I don't have a Facebook test environment. You will need the latest .NET 5 installed.

@TobiasPott
Copy link
Member

TobiasPott commented Sep 15, 2020

@TheFanatr I'll try to give it a go during this week and check how to get access to the facebook SDK and an environment for testing it.
Could you elaborate which the latest .NET 5 version needs to be installed? Is it required specific for the facebook auth option or due to other changes you made to develop?

@TheFanatr didn't got your question about the 1.8.0 branch. I've deleted it as I assumed it was obsolete and never have been gone anywhere. I've a backup copy and will put it back into the main repository asap and let you know when I've done so.
I'm very sorry for taking your reference.

@TobiasPott
Copy link
Member

@TheFanatr I've pushed the 1.8.0 legacy codebase to https://github.com/parse-community/Parse-SDK-dotNET/tree/legacy-codebase/1.8.0
I've also added 1.7.0 as a separate branch according to its tag in the history (I cannot resemble whether or not any later commit got into the actual version 1.7.0 release on nuget).

@TheFanatr
Copy link
Contributor

@TobiasPott Perfect! No worries; I was using 1.8 as a reference because it was to be a fallback for the master branch if for some reason the Parse admins decided to revert the initial 2.0 refactor, so I assumed it was the best branch to base off of. Also, I believe the old maintainers had started or continued a modularization effort in it before it went stale, so it's a better source of code to take back over into master when needed, as issues from 1.7 could have been fixed.

@TheFanatr
Copy link
Contributor

Could you elaborate which the latest .NET 5 version needs to be installed?

The latest preview of .NET 5 can be found on the .NET website by clicking on the link to the installer or binaries for your platform under the latest version listed.

Is it required specific for the facebook auth option or due to other changes you made to develop?

It is due to the use of C# 9 features in the added and modified code. It at least needs the latest .NET Core CLI.

@TobiasPott
Copy link
Member

Thank you for the quick response.
I understand why to choose the upcoming .NET 5 to access newer C# features and I'm torn between using new features and limiting the SDK to a lower feature level to maintain compatibility with Unity (they lack far behind regarding C# feature level or the .NET version).

I would like to discuss as we would reduce the use of the .NET SDK with latest .NET and C# features to standard .NET applications or Xamarin and kick out any use in Unity unless they add support for .NET 5.
I couldn't find any specific roadmap from Unity on this but they point out that they only start working on it after the official release (https://forum.unity.com/threads/net-5-support.839890/) unfortunately.

@TheFanatr
Copy link
Contributor

TheFanatr commented Sep 18, 2020

Well, all official .NET platforms will support .NET 5 including Xamarin, but so long as the SDK is kept at .NET Standard 2.0, which it still is, any compiled binary will still be compatible with Unity indefinitely. This would only change if the target framework was upgraded to .NET Standard 2.1, or it's effective successor .NET 5, but that's not currently the case.

The .NET 5 SDK is only needed for builds because it bundles the latest Roslyn tooling; the actual target framework is still .NET Standard 2.0.

@TheFanatr
Copy link
Contributor

I want to upgrade to .NET Standard 2.1 so I can use System.Text.Json and Span<T> without needing to reference the compatibility shim packages for them. This would allow for faster processing, and potentially using a fast Span<T>-based web socket library if an applicable one exists. What I might do is reluctantly fall into a similar trap the previous maintainers fell into with making slightly differing versions to support different target frameworks. To be clear these wouldn't be separate versions completely, just would have better implementations of things where available, and I think it would be more acceptable than before because it's not for every platform, it's just effectively the default (.NET X) implementation, then the Unity one, where those two would only be different if some improvement is made possible by .NET X but is unavailable on Unity's latest supported .NET target.

@TobiasPott
Copy link
Member

Ah yes, thank you for the clarification I overread/misinterpreted it not changing the SDK to .NET 5 but only require the SDK installed for toolchain changes.
Sorry for the mishap on my side.

@SOGAPPS
Copy link

SOGAPPS commented Nov 8, 2020

Hello @TobiasPott @TheFanatr Getting the error below:

Device: iOS
Using: Parse 2.0.0 - dev branch - built .dll
Using: "Xamarin.Forms Standard 2.0" - Code in App.xaml.cs, called in "public App(){}"
Question: Getting "Null References Errors". Am I setting this up wrong?

Reason: We're trying to implement "Facebook login" and "Apple Login". Looking to use "ParseClient.Instance.AuthenticateWithServiceAsync();"

     `ServerConnectionData serverConnectionData = new ServerConnectionData
        {
            ApplicationID = Const.Parse_App_ID,
            ServerURI = Const.Parse_Server,
            Key = Const.DOT_NET_KEY
        };
        ServiceHub serviceHub = null;
        // Initialize FB Parse Login 
        //var facebook = new FacebookAuthenticationMutator { Caller = Const.FB_App_ID };

        ParseClient parseClient = new ParseClient(serverConnectionData);
        //parseClient = new ParseClient(serverConnectionData, serviceHub, facebook);
        parseClient.Publicize();
        parseClient = ParseClient.Instance;

        //Register Installation to Parse
        ParseInstallation parseInstall = new ParseInstallation();
        parseInstall = parseClient.GetCurrentInstallation();
        parseInstall.SaveAsync().GetAwaiter();`

at Parse.Infrastructure.HostManifestData.get_Inferred () [0x00000] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Infrastructure/HostManifestData.cs:23 at Parse.Infrastructure.ServiceHub+<>c.<get_MetadataController>b__8_0 () [0x00000] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Infrastructure/ServiceHub.cs:40 at Parse.Infrastructure.Utilities.LateInitializer.GetValue[TData] (System.Func1[TResult] generator) [0x00067] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Infrastructure/Utilities/LateInitializer.cs:24
at Parse.Infrastructure.ServiceHub.get_MetadataController () [0x00000] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Infrastructure/ServiceHub.cs:40
at Parse.Abstractions.Infrastructure.CustomServiceHub.get_MetadataController () [0x00000] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Abstractions/Infrastructure/CustomServiceHub.cs:22
at Parse.ParseInstallation.SaveAsync (System.Threading.Tasks.Task toAwait, System.Threading.CancellationToken cancellationToken) [0x00037] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Platform/Installations/ParseInstallation.cs:198
at Parse.ParseObject+<>c__DisplayClass91_0.b__0 (System.Threading.Tasks.Task toAwait) [0x00000] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Platform/Objects/ParseObject.cs:573
at Parse.Infrastructure.Utilities.TaskQueue.Enqueue[T] (System.Func2[T,TResult] taskStart, System.Threading.CancellationToken cancellationToken) [0x00025] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Infrastructure/Utilities/TaskQueue.cs:62 at Parse.ParseObject.SaveAsync (System.Threading.CancellationToken cancellationToken) [0x00014] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/External_Libraries/parse-community/Parse-SDK-dotNET/Parse/Platform/Objects/ParseObject.cs:573 at CheapFuel.App..ctor () [0x0006f] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/CheapFuel/CheapFuel/CheapFuel/App.xaml.cs:98 at CheapFuel.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary launchOptions) [0x0009a] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/CheapFuel/CheapFuel/CheapFuel.iOS/AppDelegate.cs:86 at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.2.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.2.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65 at CheapFuel.iOS.Application.Main (System.String[] args) [0x00001] in /Users/adesegunadesegun/Documents/1. Work/5.4 Xamarin/CheapFuel/CheapFuel/CheapFuel.iOS/Main.cs:17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants