Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

updated Facebook.Android to 11.2.0 #214

Merged
merged 19 commits into from
Oct 6, 2021

Conversation

thisisthekap
Copy link
Contributor

@thisisthekap thisisthekap commented Aug 25, 2021

Fixes #213

Updates the facebook android sdk to 11.2.0.

This PR includes the changed made in the PRs #193 and #195 which I created some time ago. As these PRs were not merged by now, their changes are included in this PR, and closed.

@thisisthekap thisisthekap marked this pull request as draft August 25, 2021 23:24
@pmahend1
Copy link

@thisisthekap if the PR is not merged in like a week or two can you please release Nuget from forked repo?

@thisisthekap
Copy link
Contributor Author

thisisthekap commented Aug 26, 2021

@pmahend1 I am not going to publish a facebook sdk nuget to nuget.org, because I

  • do not want to interfere with the present nuget feed
  • do not want to cause unnecessary confusion.

If you need the changes right away, feel free to build a custom nuget yourself using dotnet cake --target=nuget.

For the sake of completeness: I did the changes at best effort, but without any warranty.

@thisisthekap
Copy link
Contributor Author

@jpobst @moljac @Redth @mattleibow Are you able to provide an ETA when this PR is going to be looked into?

This PR consists of many changes, because I had to close #199 because I updated the SDK to 11.2.0, and the old PR didn't get any attention anymore.

If the old PR should be completed first to have a small changeset of unreviewed changes: Of course we could do that as well.

@gplwhite
Copy link

gplwhite commented Sep 1, 2021

For anyone that isn't aware why this PR is important, Facebook have mandated and will shortly enforce the usage of (minimum) v8.20.0 of the Facebook Android SDK when using Facebook Login.
https://developers.facebook.com/docs/facebook-login/android/deprecating-webviews

@pmahend1
Copy link

pmahend1 commented Sep 1, 2021

For anyone that isn't aware why this PR is important, Facebook have mandated and will shortly enforce the usage of (minimum) v8.20.0 of the Facebook Android SDK when using Facebook Login.
https://developers.facebook.com/docs/facebook-login/android/deprecating-webviews

In case this PR is not addressed ASAP, I guess we are left with option of creating our own nuget or someone creating another repo thats regularly maintained.

@gplwhite
Copy link

gplwhite commented Sep 2, 2021

In case this PR is not addressed ASAP, I guess we are left with option of creating our own nuget or someone creating another repo thats regularly maintained.

This is the approach I have taken for now. For anyone that needs to do the same, here are the steps I took.

  1. Download the code from the forked repository that is the source of this pull request
  2. Update the NUGET_VERSION variable in the build.cake file to include a beta token.

var NUGET_VERSION = "11.2.0-beta.1";

This means the package will be flagged as pre-release, and will hopefully be superseded by the official version if/when it is published.

  1. Build the nuget packages using donet cake
    (Note: I had to correct a syntax error in build.cake - changing the call to DeleteDirectory to:
DeleteDirectory ("./externals", new DeleteDirectorySettings {
		    Recursive = true,
		    Force = true
		});
  1. Copy the packages from the output folder into a folder within the target solution.
  2. Add a nuget.config file to the solution to add the local nuget package location as a Nuget source.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="Local Packages" value="src\Nuget" />
  </packageSources>
</configuration>
  1. Ensure Include prerelease is ticked in the Visual Studio package manager window

@dev-xam
Copy link

dev-xam commented Sep 6, 2021

Because of message, that pmahend1 mentioned 4 days ago about deprecating webview:
https://developers.facebook.com/docs/facebook-login/android/deprecating-webviews

Currently in Xamarin Forms app I am using Xamarin.Facebook.Android library version 5.11.2 and LoginBehavior = LoginBehavior.NativeWithFallback.

Following to documentation:
https://developers.facebook.com/docs/reference/android/current/class/LoginBehavior/

"NATIVE_WITH_FALLBACK
Specifies that login should attempt login in using the Facebook App, and if that does not work fall back to web dialog auth. This is the default behavior."

I am not using embedded browser. So after 5th October will user be able to log in to my application using Facebook or not?

If update to library version 8.2.0 is a duty, when can we expect update of Xamarin.Facebook.Android on nuget? I think a lot of people will be intered in. We have one month to go.

@thisisthekap
Copy link
Contributor Author

@dev-xam The situation is even worse: Once Facebook drops the support for old login variants, all the app installations out there have to be updated to the latest version of your app to avoid issues for existing app installations.

So you might be forced to do a mandatory app upgrade.

@dev-xam
Copy link

dev-xam commented Sep 6, 2021

Currently Xamarin.Facebook.Android available on NuGet is version 7.1.0. Will there be any update to at least version 8.2.0 soon?
I will need to update applications, that are using this important library in short period of time.

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@moljac
Copy link
Member

moljac commented Sep 20, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AntRemo
Copy link

AntRemo commented Sep 28, 2021

Hi @moljac,

Do you think this will be available for testing before the FB deadline of Oct 5th?

Just trying to figure out if I should plan for an alternative solution.

Many thanks 🙏

@tozik
Copy link

tozik commented Oct 5, 2021

@moljac could you give updates please

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 214 in repo xamarin/FacebookComponents

@uwe-neuronation
Copy link

Deadline passed. Any update how log it will take?

Update FB Login SDK to version 8.2+ by Oct. 5 We have been monitoring an uptick in phishing attempts on Android embedded browsers (also known as web views), so beginning on October 5th, we will no longer support FB Login authentication on Android embedded browsers. Prior to this date, we will continue to prevent access to Facebook Login on embedded browsers for certain users we deem high-risk in an effort to prevent malicious activity. To prevent a disrupted user experience, please ensure you are using the SDK, have updated to version 8.2+, and remove any overrides in Login Behavior during login (i.e., using LoginBehavior.WEB_VIEW_ONLY). If your app is using version 8.2+ of the SDK, we utilize several methods to authenticate the user without a web view -- including options like asking the user to complete the login in the Chrome browser (Chrome Custom Tabs) or Facebook Android app (a.k.a. Android App Switch). In addition to being a more secure option, these alternative authentication methods also improve the user experience and increase conversion rates, as the user will no longer need to manually enter their password to log in. If you are making the SDK updates but require additional time, we can extend the deadline for you up to 30 days (November 5, 2021). Please reach out via the available channels to request an extension. Despite this approach, there may be some cases where we're unable to authenticate users through alternative methods, in which case the user will be blocked from logging in on an Android webview. In this case, we recommend users use another device to log in. We appreciate your partnership as we continue to invest in platform security.

If your app is built to target Android 11 (API level 30) and your users are on Android 11, alternative non-webview login mechanisms provided by the SDK will not work unless you upgrade to 8.2.0 or later.

@pmahend1
Copy link

pmahend1 commented Oct 5, 2021

Build seems to be using .Net 6 , is that why there are these build failures?
Locally these build fine AFAIK.

Since .Net 6 and MSBuild/Visual Studio 2022 are still in preview changing the pipeline might help.

@moljac
Copy link
Member

moljac commented Oct 5, 2021

Build seems to be using .Net 6 , is that why there are these build failures? Locally these build fine AFAIK.

Since .Net 6 and MSBuild/Visual Studio 2022 are still in preview changing the pipeline might help.

No it is not net6 TFM. My local builds are OK too. Seems like provisioning profiles on CI (Azure DevOps/Pipelines)

@pmahend1
Copy link

pmahend1 commented Oct 5, 2021

Build seems to be using .Net 6 , is that why there are these build failures? Locally these build fine AFAIK.
Since .Net 6 and MSBuild/Visual Studio 2022 are still in preview changing the pipeline might help.

No it is not net6 TFM. My local builds are OK too. Seems like provisioning profiles on CI (Azure DevOps/Pipelines)

If they are running fine for Windows task in the pipeline then should work fine with Mac agent build too right?
We cant say for sure unless we have access to build logs.

@waheez
Copy link

waheez commented Oct 6, 2021

Anyone know any alternate bindings for Facebook SDK? As of today our users can't log in using Facebook login. Any temporary workaround?

@tozik
Copy link

tozik commented Oct 6, 2021

@waheez build by instruction from fork of Molijak

@pmahend1
Copy link

pmahend1 commented Oct 6, 2021

Anyone know any alternate bindings for Facebook SDK? As of today our users can't log in using Facebook login. Any temporary workaround?

You can request for an extension AFAIK.

@moljac moljac merged commit 6758cce into xamarin:main Oct 6, 2021
@BradKwon
Copy link

BradKwon commented Oct 7, 2021

Anyone know any alternate bindings for Facebook SDK? As of today our users can't log in using Facebook login. Any temporary workaround?

You can request for an extension AFAIK.

Hi @pmahend1 FB said I can contact them for the extension however, they did not mention the exact contact point. The possible one I found out is https://developers.facebook.com/incident/report/ but not sure if it is the right contact point.
Could you possible share it if you already know it?

@BradKwon
Copy link

BradKwon commented Oct 7, 2021

I am trying to build it from fork but got an Install Referrer conflict error. I have Adjust SDK, which embedded Install Referrer. Are there any suggestions how I can resolve this conflict?

@thisisthekap
Copy link
Contributor Author

@BradKwon I fixed that issue for the Adjust SDK in adjust/xamarin_sdk#33. Unfortunately, they refused to accept this change. To fix it for your individual project, you will have to do a fork of the adjust sdk, remove the native reference to installreferrer, and add the same nuget as referenced by the facebook bindings.

@thisisthekap thisisthekap deleted the fix_213_upgrade_android_to_11-2-0 branch October 7, 2021 08:04
@BradKwon
Copy link

BradKwon commented Oct 7, 2021

@thisisthekap Thanks for your fast feedback! I have gone through the conversation you had with Adjust. So I see that as a user who uses both Adjust & Facebook should choose either touching Adjust SDK or Facebook SDK to resolve Install Referrer issue. I am not sure if it is possible with Facebook SDK like Adjust SDK though.

@thisisthekap
Copy link
Contributor Author

thisisthekap commented Oct 7, 2021 via email

@pmahend1
Copy link

pmahend1 commented Oct 7, 2021

Anyone know any alternate bindings for Facebook SDK? As of today our users can't log in using Facebook login. Any temporary workaround?

You can request for an extension AFAIK.

Hi @pmahend1 FB said I can contact them for the extension however, they did not mention the exact contact point. The possible one I found out is https://developers.facebook.com/incident/report/ but not sure if it is the right contact point. Could you possible share it if you already know it?

I dont either. On same boat as you.

@AntRemo
Copy link

AntRemo commented Oct 8, 2021

Hi @moljac

As this PR is merged... when can we expect the nuget package to be updated?

Thanks.

@BradKwon
Copy link

BradKwon commented Oct 12, 2021

Small update from my previous comment regarding Adjust & FB collision:

As FB login functionality was an optional in my app and FB has several issues recently, I touched FB SDK for Xamarin to remove Install Referrer dependency from Core project and the problem was solved. I have released it and I am able to login even on Android 11 now.

In my opinion, it would be the best if Adjust decoupled Install Referrer and both use one common Install Referrer Nuget. Therefore, I have written my concern to Adjust GitHub.

I hope there will be a constructive discussion sooner or later.

@angelru
Copy link

angelru commented Oct 12, 2021

The users of my application cannot log in to facebook, how do I solve it?

@dev-xam
Copy link

dev-xam commented Oct 12, 2021

The users of my application cannot log in to facebook, how do I solve it?

Change target android version from 11 to 10 and send app for review, as soon as possible, because Google will stop accepting apps with target set to 10 soon. Second option is to create custom library from newest pull request (11.2.0), build cake etc. as mentioned above. I did that and users can log in to my app easily and target android version is 11.

@angelru
Copy link

angelru commented Oct 12, 2021

The users of my application cannot log in to facebook, how do I solve it?

Change target android version from 11 to 10 and send app for review, as soon as possible, because Google will stop accepting apps with target set to 10 soon. Second option is to create custom library from newest pull request (11.2.0), build cake etc. as mentioned above. I did that and users can log in to my app easily and target android version is 11.

I don't know how to create that from the cake

@lassana
Copy link

lassana commented Oct 12, 2021

@angelru if you are on a Mac:

brew install cake
cd Facebook.Android/
# change NUGET_VERSION in build.cake file to something like "11.2.0.1-beta01"
cake

You'll see nupkg files in the output directory:

$ ls output/
Xamarin.Facebook.Android.11.2.0.1-beta01.nupkg                Xamarin.Facebook.GamingServices.Android.11.2.0.1-beta01.nupkg
Xamarin.Facebook.AppLinks.Android.11.2.0.1-beta01.nupkg       Xamarin.Facebook.Login.Android.11.2.0.1-beta01.nupkg
Xamarin.Facebook.AudienceNetwork.Android.6.6.0.nupkg          Xamarin.Facebook.Messenger.Android.11.2.0.1-beta01.nupkg
Xamarin.Facebook.Common.Android.11.2.0.1-beta01.nupkg         Xamarin.Facebook.Share.Android.11.2.0.1-beta01.nupkg
Xamarin.Facebook.Core.Android.11.2.0.1-beta01.nupkg

@pmahend1
Copy link

The users of my application cannot log in to facebook, how do I solve it?

Change target android version from 11 to 10 and send app for review, as soon as possible, because Google will stop accepting apps with target set to 10 soon. Second option is to create custom library from newest pull request (11.2.0), build cake etc. as mentioned above. I did that and users can log in to my app easily and target android version is 11.

You meant to say Change target android version to 11 from 10 , not the other way around I think.

@angelru
Copy link

angelru commented Oct 17, 2021

@angelru if you are on a Mac:

brew install cake
cd Facebook.Android/
# change NUGET_VERSION in build.cake file to something like "11.2.0.1-beta01"
cake

You'll see nupkg files in the output directory:

$ ls output/
Xamarin.Facebook.Android.11.2.0.1-beta01.nupkg                Xamarin.Facebook.GamingServices.Android.11.2.0.1-beta01.nupkg
Xamarin.Facebook.AppLinks.Android.11.2.0.1-beta01.nupkg       Xamarin.Facebook.Login.Android.11.2.0.1-beta01.nupkg
Xamarin.Facebook.AudienceNetwork.Android.6.6.0.nupkg          Xamarin.Facebook.Messenger.Android.11.2.0.1-beta01.nupkg
Xamarin.Facebook.Common.Android.11.2.0.1-beta01.nupkg         Xamarin.Facebook.Share.Android.11.2.0.1-beta01.nupkg
Xamarin.Facebook.Core.Android.11.2.0.1-beta01.nupkg

i'm on windows

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

Successfully merging this pull request may close these issues.

upgrade android sdk to 11.2.0