Git Product home page Git Product logo

facebookcomponents's Introduction

Xamarin Components for Facebook

Xamarin creates and maintains Xamarin.Android and Xamarin.iOS bindings for Facebook SDKs.

Building

Prerequisites

Before building the libraries and samples in this repository, you will need to install .NET Core and the Cake .NET Core Tool:

dotnet tool install -g cake.tool

When building on macOS, you may also need to install CocoaPods:

# Homebrew
brew install cocoapods

# Ruby Gems
gem install cocoapods

Compiling

You can either build all the libraries and samples in the repository from the root:

dotnet cake

Or, you can build each component separately:

# iOS
cd Facebook.iOS
dotnet cake

# Android
cd Facebook.Android
dotnet cake

The following targets can be specified using the --target=<target-name>:

  • libs builds the class library bindings (depends on externals)
  • externals downloads and builds the external dependencies
  • samples builds all of the samples (depends on libs)
  • nuget builds the nuget packages (depends on libs)
  • clean cleans up everything

Working in Visual Studio

Before the .sln files will compile in the IDEs, the external dependencies need to be downloaded. This can be done by running the externals target:

dotnet cake --target=externals

After the externals are downloaded and built, the .sln files should compile in your IDE.

License

The license for this repository is specified in License.md

External-Dependency-Info and THIRD-PARTY-NOTICE Files

Files named External-Dependency-Info within this repository exist to provide content to the THIRD-PARTY-NOTICES file of the Xamarin Component and NuGet binary packages. Information within the External-Dependency-Info files describe potential dependencies bundled with packages as a result of building projects within this repo.

Contribution Guidelines

You will need to complete a Contribution License Agreement before your pull request can be accepted. You can complete the CLA by going through the steps at https://cla2.dotnetfoundation.org/.

.NET Foundation

This project is part of the .NET Foundation

facebookcomponents's People

Contributors

alexlobanov avatar bholmes avatar dalexsoto avatar jamesmontemagno avatar mattleibow avatar mjbond-msft avatar moljac avatar newky2k avatar redth avatar rmarinho avatar s1r-lanzelot avatar sotoighost avatar thisisthekap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facebookcomponents's Issues

XamarinFacebookAndroid forces building with multi-dex

After upgrading to latest XamarinFacebookAndroid using nuget, I am receiving the following error while building.

My guess is the inclusion of support library custom tab as dependency.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Tool exited with code: 2. Output:
trouble writing output: Too many field references: 66329; max is 65536.
You may try using --multi-dex option.
References by package:
3 android.accounts
26 android.app
1 android.content
30 android.content.pm
6 android.content.res
3 android.database
44 android.graphics
2 android.media
1 android.media.browse
2 android.net
18 android.os
3 android.print
1 android.provider
8 android.runtime
2582 android.support.customtabs
2516 android.support.design
52 android.support.design.internal
610 android.support.design.widget
2669 android.support.graphics.drawable
2516 android.support.graphics.drawable.animated
2516 android.support.v13
32 android.support.v13.app
2516 android.support.v4
13 android.support.v4.accessibilityservice
17 android.support.v4.animation
770 android.support.v4.app
110 android.support.v4.content
1 android.support.v4.content.pm
9 android.support.v4.graphics
42 android.support.v4.graphics.drawable
4 android.support.v4.hardware.display
12 android.support.v4.hardware.fingerprint
9 android.support.v4.internal.view
337 android.support.v4.media
272 android.support.v4.media.session
5 android.support.v4.net
19 android.support.v4.os
49 android.support.v4.print
9 android.support.v4.provider
5 android.support.v4.speech.tts
55 android.support.v4.text
74 android.support.v4.util
385 android.support.v4.view
112 android.support.v4.view.accessibility
8 android.support.v4.view.animation
495 android.support.v4.widget
572 android.support.v7.app
2516 android.support.v7.appcompat
2516 android.support.v7.cardview
18 android.support.v7.graphics.drawable
422 android.support.v7.media
2516 android.support.v7.mediarouter
2516 android.support.v7.recyclerview
1 android.support.v7.text
2 android.support.v7.transition
93 android.support.v7.util
77 android.support.v7.view
191 android.support.v7.view.menu
1352 android.support.v7.widget
89 android.support.v7.widget.helper
1 android.support.v7.widget.util
5 android.text
13 android.util
18 android.view
1 android.view.inputmethod
16 android.widget
158 bolts
2516 bolts.applinks
2917 com.facebook
159 com.facebook.appevents
39 com.facebook.appevents.internal
46 com.facebook.applinks
550 com.facebook.internal
174 com.facebook.login
81 com.facebook.login.widget
32 com.facebook.messenger
51 com.facebook.share
360 com.facebook.share.internal
113 com.facebook.share.model
124 com.facebook.share.widget
2510 com.google.android.gms
20 com.google.android.gms.actions
13 com.google.android.gms.ads.identifier
2562 com.google.android.gms.auth
6 com.google.android.gms.auth.account
2528 com.google.android.gms.auth.api
77 com.google.android.gms.auth.api.credentials
23 com.google.android.gms.auth.api.credentials.internal
44 com.google.android.gms.auth.api.proxy
46 com.google.android.gms.auth.api.signin
31 com.google.android.gms.auth.api.signin.internal
2510 com.google.android.gms.base
99 com.google.android.gms.common
93 com.google.android.gms.common.api
41 com.google.android.gms.common.data
46 com.google.android.gms.common.images
188 com.google.android.gms.common.internal
1 com.google.android.gms.common.internal.safeparcel
4 com.google.android.gms.common.server
12 com.google.android.gms.common.server.converter
33 com.google.android.gms.common.server.response
63 com.google.android.gms.common.stats
22 com.google.android.gms.common.util
27 com.google.android.gms.dynamic
2 com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags
16 com.google.android.gms.flags.impl
2510 com.google.android.gms.identity
18 com.google.android.gms.identity.intents
20 com.google.android.gms.identity.intents.model
6 com.google.android.gms.iid
1594 com.google.android.gms.internal
5 com.google.android.gms.location.places
18 com.google.android.gms.phenotype
11 com.google.android.gms.playlog.internal
6 com.google.android.gms.security
26 com.google.android.gms.signin.internal
2558 com.google.android.gms.tasks
2601 com.koushikdutta.urlimageviewhelper
371 com.squareup.okhttp
92 com.squareup.okhttp.internal
246 com.squareup.okhttp.internal.framed
134 com.squareup.okhttp.internal.http
15 com.squareup.okhttp.internal.io
16 com.squareup.okhttp.internal.tls
2510 com.zemose.android
2543 de.hdodenhof.circleimageview
34 dk.ostebaronen.droid.viewpagerindicator
11 java.lang
7 java.lang.annotation
6 java.net
1 java.nio
6 java.util
2 java.util.concurrent
3 java.util.logging
2 md5048a04284979bff265231e98628579ce
4 md526b7ac14cffc1a788e82c7b73f3add08
4 md531f8cc8d4d39b2fa02686ee0eb368905
48 md5889544b40dfd8cffcf9a8ed30ef46386
4 md595f4b8ab717b9da13f11267a86077f20
4 md59f70a99687498e7ba187118950981d26
2 md5ea7fe437769f29ec64df3b4cdd3cbce2
6 mono
4 mono.android.accessibilityservice
2 mono.android.accounts
12 mono.android.animation
31 mono.android.app
2 mono.android.bluetooth
20 mono.android.content
2 mono.android.database.sqlite
6 mono.android.drm
6 mono.android.gesture
2 mono.android.graphics
2 mono.android.graphics.drawable
8 mono.android.hardware
2 mono.android.hardware.display
2 mono.android.hardware.input
2 mono.android.inputmethodservice
8 mono.android.location
60 mono.android.media
16 mono.android.media.audiofx
2 mono.android.media.effect
2 mono.android.media.midi
2 mono.android.media.session
2 mono.android.media.tv
2 mono.android.net
6 mono.android.net.nsd
2 mono.android.net.sip
18 mono.android.net.wifi.p2p
2 mono.android.nfc
10 mono.android.os
10 mono.android.preference
2 mono.android.renderscript
6 mono.android.runtime
6 mono.android.sax
2 mono.android.speech
4 mono.android.speech.tts
8 mono.android.support.design.widget
2 mono.android.support.v4.app
4 mono.android.support.v4.content
2 mono.android.support.v4.media.session
2 mono.android.support.v4.os
14 mono.android.support.v4.view
8 mono.android.support.v4.widget
6 mono.android.support.v7.app
30 mono.android.support.v7.widget
2 mono.android.text
2 mono.android.transition
72 mono.android.view
4 mono.android.view.accessibility
2 mono.android.view.animation
2 mono.android.view.textservice
8 mono.android.webkit
72 mono.android.widget
6 mono.com.facebook.internal
2 mono.com.facebook.login.widget
2 mono.com.facebook.share.widget
2 mono.com.google.android.gms.common.api
2 mono.com.google.android.gms.common.images
2 mono.com.google.android.gms.security
6 mono.com.google.android.gms.tasks
4 mono.java.lang
2 mono.java.util
2 mono.javax.xml.transform
100 okio
2 opentk
2 opentk.platform.android
2 opentk_1_0
2 opentk_1_0.platform.android
1 org.json

 22 Warning(s)
 1 Error(s)

Time Elapsed 00:00:30.9558260

---------------------- Done ----------------------

Build: 1 error, 22 warnings

Native login doesn't work with Facebook iOS SDK

Hi,
I tried both samples that are included with the component and both only open the web view :(

Could someone please update the sample so they actually do open the native UI when logging in?
Or maybe there is a bug?!?

Just in case - all works when logging through the web view for both samples. Just the native UI will not show :(

Also - I'm running them from VS and all is setup on the Mac so I can deploy on iPhone device where Facebook app is installed.

Regards.

[iOS] Component version 4.33.0 is rejected by the App Store

The only change in my app submission was to update the Xamarin.iOS Facebook nuget package from version 4.27.1 to 4.33.0.

The submission with 4.27.1 passed and the version with 4.33.0 was rejected with the following error:

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.

I really don't want to ask for Bluetooth permissions when the only Facebook feature I'm using is login. There is no plausible explanation for why my game would need this permission. It doesn't even have advertising to use as an excuse.

[Android] Adding Xamarin.Facebook.Android package causes build warnings

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Warning: Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Xamarin.Facebook.GraphRequestAsyncTask, Xamarin.Facebook.Common.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Xamarin.Facebook.GraphRequestAsyncTask, Xamarin.Facebook.Login.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. (test)

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Warning: References to the type 'Xamarin.Facebook.GraphRequestAsyncTask' will refer to 'Xamarin.Facebook.GraphRequestAsyncTask, Xamarin.Facebook.Common.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. (test)

Facebook Audience Network lock http requests

Dear,
we have a big issue with FB Audience component.

We have integrating Facebook Audience Network on iOS with a placement but on different devices and FB accounts API answer is always this

[FBAudienceNetworkLog/FBAdProvider:137 ] Ad request error: Error Domain=com.facebook.ads.sdk Code=1001 "No fill" UserInfo={FBAdErrorDetailKey={ msg = "No fill. We are not able to serve ads to this person. Please refer to https://developers.facebook.com/docs/audience-network/faq#a12. If you are integrating Audience Network for the first time, you can use test ads https://developers.facebook.com/docs/audience-network/testing."; }, NSLocalizedDescription=No fill}

We have referred also docs a12 but there are "No limits on iOS ads" and all accounts are logged to Facebook.

We have read carefully documentation and we have check condition of "No fill" on iOS and Android.

We would like to use Facebook Native Ads in our job listing each 5 job advert we want show 1 Facebook Native Ads.

What is strange is this case (on same device):

Installing app in DEBUG MODE Facebook Native Ads are shown correctly
Installing app in RELEASE MODE USING TESTFLIGHT Facebook Native Ads respond "No Fill"
Same TestFlight app installed via APPSTORE Facebook Native Ads LOCK others HTTP requests. We have check it via Charles (http://www.charlesproxy.com/) and API call does not start because is in loading Facebook call. This happens on all devices that download app via APPSTORE.

Our app is developed via Xamarin Component https://components.xamarin.com/view/fbaudiencenetworkios

What seems really strange is same code on same device and same FB user (mine Luigi Saggese) on different release type have different behaviour.
Debug Mode: OK
Release Mode using TestFlight: "No Fill" without locking other API calls
App Store: No response locking other API calls

On TestFlight mode we have found this answer on StackOverflow that seems realistic (http://stackoverflow.com/questions/29779758/facebook-native-ads-on-ios) "Test Flight rotates through a pool of IDFA's and hides the users true IDFA, making it difficult to identify a Facebook user – and that is required for delivering an ad."

Please help us to solve this issue, we have also written to Facebook support and they say as that Xamarin is maintaining component.
https://developers.facebook.com/bugs/1050931391633784

[iOS] AccountKit Support One Time Code AutoFill on iOS 12

In iOS 12, when you receive an SMS message with an OTP or a verification code, the OS suggests the OTP in the keyboard’s quick type field. This can come in really handy because while it’s obviously possible to view the message and remember the OTP, it’s far easier to just tap on the quick type field and have it automatically entered in.
But AccountKit not support this features. I can't set textContentType of textfield in AccountKit UI. I need set
otpTextField.textContentType = .oneTimeCode to get code from sms to keyboard.

Has AccountKit support it ? Add new feature to new version of AFK ?

9qovj

Couldn't get callback from Implementation of the Facebook.ShareKit.ISharingDelegate on Xamarin.Facebook.Ios

Hi people,
I implemented Facebook.ShareKit.ISharingDelegate interface in order to get Callback from the user sharing, In other words, if the user opens the Sharing Webview the app should know the result(DidComplete, DidFail or DidCancel). That's something like IFacebookCallback interface from Xamarin.Facebook.Android. Below, it's my code. MyShareDelegate doesn't execute any of its methods.

Thanks.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Foundation;
using MRV.AppCliente.Shared.Util.Constants;
using UIKit;
using Xamarin.Auth;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using Facebook.ShareKit;
using Facebook.CoreKit;
using Facebook.MessengerShareKit;
using Facebook.LoginKit;
using MRV.AppCliente.Mobile.Forms.Views;

[assembly: ExportRenderer(typeof(IndicacaoPremiadaDoisPage), typeof(MRV.AppCliente.Mobile.iOS.CustomRenderers.CompartilharNoFacebookRenderer))]

namespace MRV.AppCliente.Mobile.iOS.CustomRenderers
{
    public class CompartilharNoFacebookRenderer : PageRenderer
    {
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);
            IEnumerable<Account> contas = null;
            contas = AccountStore.Create().FindAccountsForService("Facebook");

            var x = "https://g1.globo.com/rj/rio-de-janeiro/noticia/jungmann-diz-que-principal-linha-de-investigacao-da-morte-de-marielle-e-envolvimento-de-milicias.ghtml";

            MessagingCenter.Subscribe<Object>(this, AppConstants.MetodosMessagingCenter.CHAMAR_COMPARTILHAR_NO_FACEBOOK_IOS, (s) =>
            {

                foreach (var conta in contas)
                {
                    AccountStore.Create().Delete(conta, "Facebook");
                }

                var content = new ShareLinkContent();
                content.SetContentUrl(NSUrl.FromString(x));


                ShareDialog shareDialog = new ShareDialog();
                shareDialog.SetDelegate(new MyShareDelegate());
                shareDialog.SetShareContent(content);
                shareDialog.FromViewController = UIApplication.SharedApplication.KeyWindow.RootViewController;

                shareDialog.Mode = ShareDialogMode.FeedWeb;
                 
                
                shareDialog.Show();
            });


        }

        public override void ViewDidDisappear(bool animated)
        {
            MessagingCenter.Unsubscribe<Object>(this, AppConstants.MetodosMessagingCenter.CHAMAR_COMPARTILHAR_NO_FACEBOOK_IOS);
        }

    }

    public class MyShareDelegate : Facebook.ShareKit.ISharingDelegate
    {
        public IntPtr Handle { get; }

        public void DidComplete(Facebook.ShareKit.ISharing sharer, NSDictionary results)
        {

        }

        public void DidFail(Facebook.ShareKit.ISharing sharer, NSError error)
        {

        }

        public void DidCancel(Facebook.ShareKit.ISharing sharer)
        {

        }

        public void Dispose()
        {

        }
    }
}

Update Facebook libraries?

Facebook (for iOS at least) is now on 4.20.2: https://github.com/facebook/facebook-ios-sdk/releases

Is there any plans to update these components?

I took a stab at doing it myself by modifying GIT_REPO_TAG in the Makefile, but I get a build error:

cp: ../Bolts-IOS/build/ios/Bolts.framework: No such file or directory

I think this is coming from build_distribution_xamarin.sh.

This is an issue for us, because there is a bug in the iOS Facebook SDK 4.18 that breaks login. Right now we are having to run the 4.16.1 version of the Xamarin.Facebook.iOS NuGet package because of this.

Facebook iOS Unable to get publish permission

Hello, I created a new Xamarin project and I'm using Xamarin.Facebook.iOS 4.38.0.

At first my application is requesting read permissions to make the registration/login.

public static List<string> FacebookReadPermissions = new List<string> {
            "public_profile",
            "email"
};

.  .  .

loginManager.LogInWithReadPermissions(FacebookReadPermissions.ToArray(), this, (results, errors) => {
    .
    .
    .
}

Then I try to publish so I ask for ["publish_actions"] permissions, but the token is always null and it shows the following message:

image

public static List<string> FacebookPublishPermissions = new List<string> {
            "publish_actions",
};

.  .  .

loginManager.LogInWithPublishPermissions(AppDelegate.FacebookPublishPermissions.ToArray(), this, (result, error) => 
{
    .
    .
    .
    if (result.Token == null)
    {
        // result is null
    }

    // Manage success
}

Any ideas?

[iOS] v4.35 forcing me to drop support for iOS 7

When I update to v4.35, I get a build error The binding library 'Facebook.LoginKit.dll' contains a user framework (Facebook.LoginKit.dll), but embedded user frameworks require iOS 8.0 (the deployment target is FBSDKLoginKit.framework). Please set the deployment target in the Info.plist file to at least 8.0.

So, that means that I can't use v4.35 and newer in my iOS project if I want to keep the deployment target on iOS 7? Why? Until now, I was using a runtime condition to check whether the iOS is 9.0+ and disable Facebook SDK otherwise. But this is now not possible.

Can this be fixed or is it now "iOS7 or v4.35"?

Facebook login causes you to be taken to “Help Center” if we try to login multiple times

My app has multiple login options; of which FB Login is one of the options. Clicking "cancel" on the "confirm login" page on facebook login causes you to be taken to a troubleshooting page the next time you attempt.

Steps: Open the app that is not currently logged in but has been logged in using facebook in the past.

1 - Click on Login (Existing User)

2 - Click Login with Facebook

3 - You should be taken to a "confirm login" page where is tells you "you previously logged in to App with Facebook"

4 - Click cancel and it takes you to the Login screen

5 - Press "Login with Facebook" again

6 - If done consecutively you will be taken to the Facebook Help Center

Please let me know if this is an expected behaviour or this needs to be handled.

The error I am getting when clicking cancel is:
error_reason=user_denied
&error=access_denied
&error_description=Permissions+error.

More info:
We are using Xamarin.Facebook.iOS.4.27.1 nuget package.

We are logging in to account as per "LoginButtonCompletedEventArgs.Result".
If "LoginButtonCompletedEventArgs.Result.Token" is not null, that is taken forward for successful login and hence proceeded.

In the reported bug scenario, we are getting
"LoginButtonCompletedEventArgs.Result.IsCancelled" as TRUE when we click "Cancel" in login confirmation page as well as "Done" in Help Center page.

Could you kindly try replicating the issue using the above mentioned package?
Also please let me know if this issue, "authorize/?error=access_denied&error_code=200&error_description=Permissions+error&error_reason=user_denied" when triggered multiple times could make Facebook suggest the user to report the app for any suspected attack?

help center

Facebook iOS Unable to get permission to write

My app (Xamarin Forms) needs to use write permission for GraphRequest and wall-posting.

What I try to do:
Using Xamarin.Facebook.iOS (v 4.35)

    readonly LoginManager _loginManager = new LoginManager();
    readonly string[] _permissions = { @"public_profile", @"email", @"user_posts", @"user_photos"};
    LoginResult _loginResult;
    TaskCompletionSource<LoginResult> _completionSource;
    public Task<LoginResult> LoginWithPublish()
    {
        _completionSource = new TaskCompletionSource<LoginResult>();
        _loginManager.LogInWithPublishPermissions(_permissions, GetCurrentViewController(), LoginManagerLoginHandler);
        return _completionSource.Task;
    }

   void LoginManagerLoginHandler(LoginManagerLoginResult result, NSError error)
    {
        if (result.IsCancelled)
            _completionSource.TrySetResult(new LoginResult { LoginState = LoginState.Canceled });
        else if (error != null)
            _completionSource.TrySetResult(new LoginResult { LoginState = LoginState.Failed, ErrorString = error.LocalizedDescription });
        else
        {
            _loginResult = new LoginResult
            {
                Token = result.Token.TokenString,
                UserId = result.Token.UserId,
                ExpireAt = result.Token.ExpirationDate.ToDateTime()
            };

            var request = new GraphRequest(@"me", new NSDictionary(@"fields", @"email"));
            request.Start(GetEmailRequestHandler);
        }
    }

So, when i try to call LoginWithPublish, handler LoginManagerLoginHandler is never called.
Just nothing is happing.

If I calling LoginWithReadPermissions (and same Handler), i can get login, but when i try call GraphRequest "{user_id}/photos?url="url"" a got this error (and it is quite logical).

Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=0, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=403, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=(#200) Requires extended permission: publish_actions, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=200, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
    body =     {
        error =         {
            code = 200;
            "fbtrace_id" = DBHvrFFmvfB;
            message = "(#200) Requires extended permission: publish_actions";
            type = OAuthException;
        };
    };
    code = 403;
}}

But I unable just to add publish_actions to list of my permissions, that's related to update of FB api.

How I can get write permissions or any another way to do wall-post on FB with Xamarin.Forms?

AudienceNetwork causes compilation errors on Android

Hello, for past few days I've been trying to implement ads mediation in my Xamarin.Android app and the first service I wanted to use for this was Facebook. Unfortunately I've run into a multitude of different issues and in the end I've decided to ask here. My problem is:

1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
1>  java.lang.RuntimeException: Translation has been interrupted
1>  	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:615)
1>  	at com.android.dx.command.dexer.Main.runMultiDex(Main.java:368)
1>  	at com.android.dx.command.dexer.Main.runDx(Main.java:289)
1>  	at com.android.dx.command.dexer.Main.main(Main.java:247)
1>  	at com.android.dx.command.Main.main(Main.java:94)
1>  Caused by: java.lang.InterruptedException: Too many errors
1>  	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:607)
1>  	... 4 more
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2521,3): error : java.lang.RuntimeException :  Translation has been interrupted
========== Build: 0 succeeded, 1 failed, 5 up-to-date, 0 skipped ==========

It could be caused by broken(?) desugar of java 8 as mentioned here. It doesn't even work when I set min-sdk to 26... which is no go anyway.

The first NuGet version that causes this issue is: 4.22.0, earlier ones don't work though as I'm guessing that Facebook deprecated older APIs.
The error occurs only when the components are actually used in code with such class for example:

    [Preserve(AllMembers = true)]
    public class FacebookCustomEventBanner : Java.Lang.Object, ICustomEventBanner
    {
        private AdView _adBanner;

        public void OnDestroy()
        {
            _adBanner?.Destroy();
        }
        ...
        public void RequestBannerAd(Context context,
            ICustomEventBannerListener listener,
            string serverParameter,
            AdSize size,
            IMediationAdRequest mediationAdRequest,
            Bundle customEventExtras)
        {
            _adBanner = new AdView(context, "<>", Xamarin.Facebook.Ads.AdSize.BannerHeight50);
            _adBanner.SetAdListener(new FacebookCustomEventBannerForwarder(listener, _adBanner));
            _adBanner.LoadAd();
        }
    }

Am I missing something obvious here? Or is it just impossible to use it right now?

VS bug #732196

Facebook SDK moving to a more modular architecture after v4.26 (Android)

The Facebook SDK is moving towards a more modular sdk. With that said, a redesign for the Xamarin.FacebookComponents might be in order for continued support of this binding library. This seems very similar to what happened with the now deprecated GooglePlayServices package.

I would like this issue to serve as an enhancement request for breaking out the FacebookComponent into more modular/manageable packages.

Currently the facebook sdk v4.26, at least on Android, is the last version before changing the architecture.

As noted in #19, this repo might not be Xamarin's highest priority at this time. However, I do want to get this issue going so that the community might start it.

Currently AudienceNetwork/AccountKit are not wrapped under this issue, they remain outside Facebook's core sdk grouping. However, it might make sense to break AudienceNetwork out of the Android Facebook solution once it starts adapting to the new facebook sdk architecture.

Thanks.

May I know the Android 4.34 supports codeless app event?

I now using the 4.34 for Android, but seems doesn't working.

I added this to AndroidManifest.xml, but couldn't found fb_codeless_debug in event debug.
<meta-data android:name="com.facebook.sdk.CodelessDebugLogEnabled" android:value="true" />

Can't Connect?
Check this list then close and reopen your app and try again.
Your app has Facebook SDK v.4.34 or higher.
You're using the latest version of your app.
You're shaking your phone firmly enough.
If your WiFi is unreliable, connect to high-speed Internet.

The iOS 4.35 is working perfectly for fb_codeless_debug.

Thank you very much.

[iOS][AudienceNetwork.iOS] Sometimes InterstitialAdWillClose () is not called.

Hello.

I'd like to display interstitialAd using Audience Network.
However, I found a little problem with iOS.
With IInterstitialAdDelegate, the Delegate method (InterstitialAdWillClose () or InterstitialAdDidClose ()) should be called when the ad is closed, but sometimes the Delegate method is not called.
We prepared all methods that we can export, but even IntersitialDidFail () is not called.

Is this a bug?
There was no particular problem when using AdMob's mediation.
I want hints to solve if it is not a bug.

I am sorry if this is a Google translation, so it makes sense for me.

Thank you.

Facebook login not working in Kitkat device

Facebook xamarin android version:- 4.26.0
Issue: Cannot login via Facebook when the facebook app is installed in the phone.
Actual behaviour:- Facebook button does not respond
Expected behaviour:- app should properly launch and return result from Facebook

In Kitkat device i noticed that if the Activity LaunchMode is SingleInstance it wont show the facebook page, If i change it back to SingleTop or SingleTask it works as expected.
How does the launch mode of the activity dependent on the facebook login?

Facebook iOS

Why Xamarin Facebook iOS binding don't binding [[FBSDKSettings accessTokenCache] fetchAccessToken]?

iOS component causes binary rejection due to Bluetooth usage

I upgraded my iOS project's Facebook component from Nuget (v4.33.0), and sent a new build to iTunes for review. The binary was immediately rejected.

The email from iTunes stated that:

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.

I was totally puzzled because there is no single line of code related to Bluetooth usage in my code. After some trial and error, I downgraded Facebook component version and the new build got accepted.

I don't think that Facebook's official libraries use any Bluetooth functions. Is this a Xamarin-specific issue? Why are we supposed to add NSBluetoothPeripheralUsageDescription key just for Facebook-related activities?

OpenUrl requires a generic NSDictionary

The binding for Facebook.CoreKit.ApplicationDelegate.SharedInstance.OpenUrl has a NSDictionary<NSString, NSObject> options parameter, but the iOS binding for AppDelegate.OpenUrl provides a non-generic NSDictionary.

This means any use of OpenUrl has to cast the NSDictionary before it can call the URL, which is pretty user-unfriendly, especially as this is the only place that OpenUrl would be called from.

Would be nice to have an overload which takes the standard NSDictionary and converts it.

Facebook resources dont load

Facebook style resources dont load when running application.
App instantly crashes with the follow error
Java.Lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/R$style;

Sharing link failed using ShareLinkContent.Builder

Sharing link using ShareLinkContent.Builder was working fine then, until few weeks ago.

Everything is still working just like the same , except the link I am sharing is getting this "Message could not be sent.Tap for details" at the messenger.

image

Need to upgrade to version 4.37.0 based on Facebook Developers email received

SDK Upgrade: iOS v4.37.0  

{AppName} currently uses Facebook SDK for iOS v4.27.1, which relies on the recently deprecated Version 2.7 of the Graph API.

As a result, there is a risk that your app will no longer function if you don't upgrade to Facebook SDK for iOS v4.37.0.As an admin of this app, please upgrade to the latest SDK as soon as possible to ensure your app's continued performance and to take advantage of new features.

 Any plans upgrading?

Facebook account kit error - xamarin android visual studio 2017

I installed the facebook account kit via nuget and getting below error while building the application.
version: 4.28.0

error: OnSpinnerEventsListener is not public in CountryCodeSpinner;
cannot be accessed from outside package
com.facebook.accountkit.ui.CountryCodeSpinner.OnSpinnerEventsListener
App8
..\obj\Debug\android\src\mono\com\facebook\accountkit\ui\CountryCodeSpinner_OnSpinnerEventsListenerImplementor.java
8

it says the OnSpinnerEventsListener is not public in CountryCodeSpinner. But how can i modify it? Or is there anything need to be added in the xamarin application to build it successfully.

VS bug #844214

Facebook.AccountKit.iOS crash on release only

Hi, when I use this:

PhoneLogin.AsIViewControllerProtocol()

The registrar found an invalid interface 'Facebook.AccountKit.IViewController': The interface must have a Protocol attribute specifying its wrapper type

In debug works fine

[Android] RegisterViewForInteraction missing from NativeAd and NativeBannerAd

Step 4 of Migration Steps in the SDK 4.99 Upgrade Guide states:

NativeAd interface changes:
registerViewForInteraction(View) is replaced by registerViewForInteraction(View, MediaView, AdIconView) where AdIconView is optional.
registerViewForInteraction(View, List) is replaced by registerViewForInteraction(View, MediaView, AdIconView, List) where AdIconView is optional.

It appears that during the upgrade to 5.0.1 these methods were lost. The NativeBannerAd class also appears to be missing this method handler.

Please update the SDK to support Native Ads.
Thanks 🙂

VS bug #792686

CurrentAccessToken null after a successful login followed by an app restart (4.18.0.1)

Hi guys

after updating this component to last available 4.18.0.1 in Xamarin components portal we started to have an issue with AccessToken.CurrentAccessToken. It returns null after a successful login followed by an app restart.
Of course that we do have all things that fb tell us to do

public override bool FinishedLaunching
...

Profile.EnableUpdatesOnAccessTokenChange(true);
Settings.AppID = FacebookAppId;
Settings.DisplayName = DisplayName;

return ApplicationDelegate.SharedInstance.FinishedLaunching(app, options);

This seems to be related to permissions or so. Any guess?

cheers
Manuel

[URGENT] Update Facebook SDK to version 4.37.0

Hi,

I'm unable to login into my App using Facebook API because this library's SDK is out of date. In the output console the following message appears: "Your Facebook SDK is out of date. We recommend upgrading to the latest Version 4.37.0, to ensure your app's performance is not affected and to take advantage of our newest features!".

Please, could you update this library to the latest SDK? Thank you in advance.

An error occured when executing task 'libs-base'

I tried to build bindings libraries for the new version of Facebook SDK according to the manual. But error occurred.
I successfully installed cocoa pods.

Then do this:
`developers-Mac:Facebook.iOS developer$ sh ../build.sh -target libs
using local cake.packages.config...
Downloading NuGet...
Feeds used:
/Users/developer/.local/share/NuGet/Cache
/Users/developer/.nuget/packages/
https://www.nuget.org/api/v2/
http://nuget.syncfusion.com/xamarin
https://api.nuget.org/v3/index.json

Restoring NuGet package Cake.0.15.2.
GET https://api.nuget.org/v3-flatcontainer/cake/0.15.2/cake.0.15.2.nupkg
GET https://www.nuget.org/api/v2/Packages(Id='Cake',Version='0.15.2')
OK https://www.nuget.org/api/v2/Packages(Id='Cake',Version='0.15.2') 692ms
GET https://www.nuget.org/api/v2/package/Cake/0.15.2
OK https://api.nuget.org/v3-flatcontainer/cake/0.15.2/cake.0.15.2.nupkg 1086ms
Acquiring lock for the installation of Cake 0.15.2
Acquired lock for the installation of Cake 0.15.2
Installing Cake 0.15.2.
GET http://nuget.syncfusion.com/nuget_xamarin/nuget/getsyncfusionpackages/xamarin/Packages(Id='Cake',Version='0.15.2')
NotFound http://nuget.syncfusion.com/nuget_xamarin/nuget/getsyncfusionpackages/xamarin/Packages(Id='Cake',Version='0.15.2') 287ms
GET http://nuget.syncfusion.com/nuget_xamarin/nuget/getsyncfusionpackages/xamarin/FindPackagesById()?id='Cake'
OK https://www.nuget.org/api/v2/package/Cake/0.15.2 625ms
Acquiring lock for the installation of Cake 0.15.2
OK http://nuget.syncfusion.com/nuget_xamarin/nuget/getsyncfusionpackages/xamarin/FindPackagesById()?id='Cake' 148ms
Completed installation of Cake 0.15.2
Lock not required - Package already installed Cake 0.15.2
Adding package 'Cake.0.15.2' to folder '/Users/developer/Downloads/FacebookComponents-master/tools'
Added package 'Cake.0.15.2' to folder '/Users/developer/Downloads/FacebookComponents-master/tools'
Multiple arguments with the same name (target).`

`developers-Mac:Facebook.iOS developer$ sh ../build.sh -target externals
Feeds used:
/Users/developer/.local/share/NuGet/Cache
/Users/developer/.nuget/packages/
https://www.nuget.org/api/v2/
http://nuget.syncfusion.com/xamarin
https://api.nuget.org/v3/index.json

All packages listed in /Users/developer/Downloads/FacebookComponents-master/tools/packages.config are already installed.
Multiple arguments with the same name (target).`

Then tried to run sh ../build.sh without arguments and ...
An error occured when executing task 'libs-base'.
Error: mdtool: Process returned an error (exit code 1).

Help please. Urgently need facebook library for fast release into itunes, but under ios 10 old facebook libraries don't work!

Crash Occurs Signing into Facebook while on iOS8.

The crash "Xamarin.iOS: Received unhandled ObjectiveC exception: NSInvalidArgumentException *** setObjectForKey: object cannot be nil (key: logging_token)" is received when attempting to sign into Facebook on a device running iOS8. This crash will not occur if the same project setup is used on a just an Xcode project. The quickest way to repo the issue is to use the Facebook sample while using the latest Xamarin.Facebook.iOS package in the nuget store. Simply hitting the Continue with Facebook causes the issue.

Facebook login causes you to be taken to its “Help Center” if we try to login multiple times

My app has multiple login options; of which FB Login is one of the options. Clicking "cancel" on the "confirm login" page on facebook login causes you to be taken to a troubleshooting page the next time you attempt.

Steps: Open the app that is not currently logged in but has been logged in using facebook in the past.

1 - Click on Login (Existing User)

2 - Click Login with Facebook

3 - You should be taken to a "confirm login" page where is tells you "you previously logged in to App with Facebook"

4 - Click cancel and it takes you to the Login screen

5 - Press "Login with Facebook" again

6 - If done consecutively you will be taken to the Facebook Help Center

Please let me know if this is an expected behaviour or this needs to be handled.

The error I am getting when clicking cancel is:
error_reason=user_denied
&error=access_denied
&error_description=Permissions+error.

More info:
We are using Xamarin.Facebook.iOS.4.33.0 nuget package.

We are logging in to account as per "LoginButtonCompletedEventArgs.Result".
If "LoginButtonCompletedEventArgs.Result.Token" is not null, that is taken forward for successful login and hence proceeded.

In the reported bug scenario, we are getting
"LoginButtonCompletedEventArgs.Result.IsCancelled" as TRUE when we click "Cancel" in login confirmation page as well as "Done" in Help Center page.

Could you kindly try replicating the issue using the above mentioned package?
Also please let me know if this issue, "authorize/?error=access_denied&error_code=200&error_description=Permissions+error&error_reason=user_denied" when triggered multiple times could make Facebook suggest the user to report the app for any suspected attack?

NOTE:- I have tried all the changes mentioned in an issue closed recently. (#88)

Facebook Api 3.1 support

We got an email from facebook for API upgrade. It ask to upgrade to Facebook API v3.1 from current 2.7.

screen shot 2018-09-21 at 9 32 50 pm

Currently we used Xamarin.facebook.android 4.34 and Xamarin.facebook.iOS 4.35
So when can we expect that upgraded FB API 3.1 in nugget package for Xamarin.android and Xamarinn.iOS?

Thanks.

version conflict with xamarin.Android.Support.Design

version 4.33.0 of Xamarin.Facebook.Android coflicts with version 27.0.2.1 of xamarin.Android.Support.Design. Kindly update

Severity Code Description Project File Line Suppression State
Error Version conflict detected for Xamarin.Android.Support.Compat. Reference the package directly from the project to resolve this issue.
e-SpaMobileApp -> Xamarin.Android.Support.Design 27.0.2.1 -> Xamarin.Android.Support.Compat (= 27.0.2.1)
e-SpaMobileApp -> Xamarin.Facebook.Android 4.33.0 -> Xamarin.Facebook.Common.Android 4.33.0 -> Xamarin.Android.Support.CustomTabs 27.0.2 -> Xamarin.Android.Support.Compat (= 27.0.2). 0

iOS 7 and 8 not supported?

Every time I try to log in on iOS 7 and 8, the app crashes, right after clicking the Facebook button.
So iOS 7 and 8 is now not supported? Why, could this be fixed?
I am using version 4.27.1.

Android - ShareLinkContent.Builder; about half of the functions return Java.Lang.Object

I find this quite odd, in order to make use of the builder in order to share a post with facebook, you're having to cast the result of a builder operation.

var builder = new ShareLinkContent.Builder()
    .SetQuote(postCaption)
    .SetContentUrl(Android.Net.Uri.Parse(postImageUrl)) as ShareLinkContent.Builder;

var shareContent = builder.Build();

This is nuts! Is this caused by a binding issue in the Android sdk?

Native login doesn't ask to open app or webview with Facebook iOS SDK

I have tried using this plugin on ios under the version 4.26.0.

What has been going on is that it is supposed to open a webview asking if the user would like to proceed with the facebook app installed or login with phone or email.

What is happening now is that the open with phone or email (Webview) is being shown without the option to open the facebook app.

I already setted up the behavior to system account

LoginManager manager = new LoginManager();
manager.LoginBehavior = LoginBehavior.SystemAccount;

Any one have been throught this?
Any solving?

fbXXXXXXXXXXX is not registered as a URL scheme. Please add it in your Info.plist

I get this exception when trying to call

var result = await loginManager.LogInWithReadPermissionsAsync(Constants.Constants.FacebookPermissions, vc);

I am using version 4.27.1, and according to the Getting Started article here:
https://components.xamarin.com/gettingstarted/facebookios

It should only be necessary to add the following:

<key>LSApplicationQueriesSchemes</key>
<array>
        <string>fbapi</string>
        <string>fb-messenger-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
</array>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.