Coder Social home page Coder Social logo

xamarin.social's People

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  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  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

xamarin.social's Issues

Samples reference Xamarin.Media

Where is the Xamarin.Media namespace defined? The iOS sample references Xamarin.Media ... so it does not compile in an out-of-the-box clone.

Services need a way to delete and deauthorize accounts

If an account goes bad, then we need a way to delete them from the account store.

    public static void DeleteAccount (this FacebookService facebook, Account account)
    {
        var acs = AccountStore.Create ();
        //          acs.Delete (account);
    }

    public static async Task<bool> DeauthorizeAccount (this FacebookService facebook, Account account)
    {
        var acs = AccountStore.Create ();
        acs.Delete (account);

        var req = facebook.CreateRequest (
            "DELETE",
            new Uri ("https://graph.facebook.com/me/permissions"),
            account);
        using (var resp = await req.GetResponseAsync ()) {
            return (bool)JsonValue.Parse (resp.GetResponseText ());
        }
    }

Why create two different ACAccountStore instances?

@ermau I wasn't sure where to post this, so I post here.

Why do you keep one instance of ACAccountStore, but use a new one every time?
I'm looking at GetAccountsAsync in Twitter5Service:

public override Task<IEnumerable<Account>> GetAccountsAsync ()
{
    if (accountStore == null) {
        accountStore = new ACAccountStore ();
    }
    var store = new ACAccountStore ();
    var at = store.FindAccountType (ACAccountType.Twitter);

Note that you're working with store, while a reference to accountStore is kept.

I saw threads about ACAccounts dead without their store, but surely accountStore is different from store so it doesn't help?

I'm confused.

Async interface for authenticating

public Task<Account> Authenticate (UIViewController context)
{
    var authTC = new TaskCompletionSource<Account> ();
    authUI = facebook.GetAuthenticateUI (a => {
        authTC.SetResult (a);
        rootUI.DismissViewController (true, null);
    });
    rootUI.PresentViewController (authUI, true, null);
    return authTC.Task;
}

Facebook should make accessing Graph urls easy

Add a GetGraphNode or similar function to FacebookService.

Right now we have to type:

var req = s.CreateRequest (
    "GET",
    new Uri ("https://graph.facebook.com/598072388?fields=friends.fields(first_name,name,gender,updated_time)"),
    account);
var resp = await req.GetResponseAsync ();
var json = JsonObject.Parse (resp.GetResponseText ());

It would be nice to get that down to 1 line:

    public static async Task<JsonObject> GetGraphLinkAsync (this FacebookService facebook, string link, Account account)
    {
        var req = facebook.CreateRequest (
            "GET",
            new Uri (link),
            account);
        using (var resp = await req.GetResponseAsync ()) {
            return (JsonObject)JsonObject.Parse (resp.GetResponseText ());
        }
    }

    public static async Task<JsonObject> GetGraphAsync (this FacebookService facebook, string query, Account account)
    {
        var req = facebook.CreateRequest (
            "GET",
            new Uri ("https://graph.facebook.com/" + query),
            account);
        using (var resp = await req.GetResponseAsync ()) {
            return (JsonObject)JsonObject.Parse (resp.GetResponseText ());
        }
    }

Flickr Needs All URLs to be HTTPS (simple fix)

Flickr needs to have all of the Urls in FlickrService to be secure https.
Can someone go into FlickrService.cs and change the Urls in the main class and the CreateRequest upload to https?

I've tested it by grabbing the source and it works. So if someone could do this and submit a quick rev of the component, it would get Flickr uploads working again.

xamarin.social missing and cannot be installed

I am trying to run /xamarin-forms-samples/EmployeeDirectory in xamarin studio on my Mac.

  1. I did not find xamarin.social in the packages of EmployeeDirectory and I get the error:

The type or namespace name 'Social' does not exist in the namespace 'Xamarin'. Are you missing an assembly reference? (CS0234) (EmployeeDirectory.iOS)

  1. Trying to install xamarin.social I get the error:

Could not install package 'Xamarin.Social 1.1.7'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

What to do?
Thank you

Linked-in support

As you know, the iOS Social.framework has Linked-in integration and many customers expect to have it in the apps.

Are there any plans of adding Linked-in support to Xamarin.Social ?
Is there any contribution guide for adding social networks? (something different from "here is the code. go figure out by yourself")

403 from Facebook when posting - possible fix for newer Apps

I was getting a 403 when posting to Facebook to a new test App (Create app - create test of that app)
It seems the permissions returned after authorization were not populated correctly as we were asking for publish_stream scope which AFAIK seems to have been deprecated/broken

I think the line in FacebookServices should be:

Scope = "publish_actions"; // was "publish_stream"; if I use public stream then it just defaults to read-only

This fix seemed to work for me but reading the forums older apps may still support publish_stream

Image Share Issue: "One of the identified items was in an invalid format."

When sharing to Facebook using the FacebookService i get the following error appear when clicking the "Send" button on the share screen

"One of the identified items was in an invalid format."

I have identified the item with the invalid format to be the image I am including, as the share works perfectly if I do not include an image.

Any help is appreciated as I'm probably doing something wrong.

// image data is a byte[] of a .jpg image from CrossMedia plugin

var images = new List<ImageData>();
images.Add(new ImageData(new MemoryStream(imageData), "image/jpeg"));
// Also tried:
//images.Add(new ImageData(File.OpenRead(photo.Path), null));

var item = new Item
{
	Text = "Test",
	Images = images
};
	
DependencyService.Get<IFacebookFunctions>().PostToFacebook(item);

Exceptions from requests can't be caught

This code is failing:

try {
    await facebook.GetGraph ("me", account);
    return true;
}
catch (System.Net.WebException) {
    return false;
}

while this code works:

return facebook.GetGraph ("me", facebookAccount).ContinueWith (t => {
    if (t.IsFaulted) {
        return false;
    }
    return true;
});

When trying to catch the WebException when an account is bad.

Need to look at Async code to make sure error paths are done right.

The sample tries to register two types with the same Objective-C name.

Exception thrown says:

error MT4118: Cannot register two managed types ('Xamarin.Controls.ProgressLabel, Xamarin.Auth.iOS' and 'Xamarin.Controls.ProgressLabel, Xamarin.Social.iOS') with the same native name ('Xamarin_Controls_ProgressLabel').

This happens because both Xamarin.Social.iOS and Xamarin.Auth.iOS have an internal type named "Xamarin.Controls.ProgressiveLabel", which is exported to ObjectiveC (because it inherits from NSObject).

To reproduce just run the sample in the simulator (using 6.3.5+).

The solution is to somehow not have two identically named types.

Crash in FoundationResponse.GetResponseText()

I can't isolate the issue yet, but I have FoundationResponse.GetResponseText() crashing my process in some cases:

mono-rt:   at <unknown> <0xffffffff>
mono-rt:   at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.copy_from_unmanaged (intptr,int,System.Array,int) <IL 0x00024, 0xffffffff>
mono-rt:   at System.Runtime.InteropServices.Marshal.Copy (intptr,byte[],int,int) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs:146
mono-rt:   at System.IO.UnmanagedMemoryStream.Read (byte[],int,int) [0x0010b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs:206
mono-rt:   at System.IO.StreamReader.ReadBuffer () [0x0000e] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.IO/StreamReader.cs:392
mono-rt:   at System.IO.StreamReader.ReadToEnd () [0x0002c] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.IO/StreamReader.cs:580
mono-rt:   at Xamarin.Auth.Response.GetResponseText () [0x00046] in /Users/dan/Documents/Projects/stampsy-ipad/external/Xamarin.Social/Xamarin.Auth/src/Xamarin.Auth/Response.cs:93
mono-rt:   at Stampsy.Social.ServiceManager.GetResponseJson (System.Threading.Tasks.Task`1<Xamarin.Auth.Response>) [0x00074] in /Users/dan/Documents/Projects/stampsy-ipad/external/sociopath/libs/Stampsy.Social/Services/ServiceManager.cs:101
mono-rt:   at Stampsy.Social.ServiceManager/<ParsePageAsync>c__AnonStorey15`1.<>m__2C (System.Threading.Tasks.Task`1<Xamarin.Auth.Response>) [0x00008] in /Users/dan/Documents/Projects/stampsy-ipad/external/sociopath/libs/Stampsy.Social/Services/ServiceManager.cs:129

Link in readme broken

The link in the readme file for App.net is not valid. Probably since they are no longer on alpha.

System.MissingMethodException

I've added Xamarin.Social to both my shared project and my Android project, but when I launch it in Android, it fails with MissingMethodException on the line below. Am I missing something? I have Xamarin.Social (v1.1.8) as well as Xamarin.Auth (v1.6.0.2) in both projects.

await facebook.GetAccountsAsync().ContinueWith(accounts => {...});

System.MissingMethodException: System.Threading.Tasks.Task1<System.Collections.Generic.IEnumerable1<Xamarin.Auth.Account>> Xamarin.Social.Service.GetAccountsAsync()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in :0
at BabyBook.NewPicturePage.ShareToFacebook () [0x00013] in <4cd4b87556604d948a627179f832d02f>:0
at BabyBook.NewPicturePage+d__71.MoveNext () [0x00256] in C:\Projects\Mobile Projects\New Solution\Solution1\Pages\NewPicturePage.xaml.cs:326 } System.MissingMethodException

Facebook API 2.0 calls fail to get Username

By default all facebook apps are using version 2.0 of the API (can this be changed at their end?) and looks like there's a breaking change that affects GetUsernameAsync() in FacebookService.cs

Currently you check for presence of "username" in the json response and through an exception if not found (see https://forums.xamarin.com/discussion/comment/53902/) looks like in version 2.0 of the API this value is no longer returned (See https://developers.facebook.com/docs/graph-api/reference/v2.0/user) - simply changing to check for "name" gets us through that section, but am seeing 403+ errors when actually share, not sure if related, "name" may be the wrong field to use, or possibly other breaking changes in the API.

Quick fix may be to change all API endpoints to the specific 1.0 Urls

Pinterest not working?

When using PinterestService(), I get the login page and after logging in
all I get is

bad response: missing csrfmiddlewaretoken

Twitter: Add Account freezes the App

Hi,

whenever I try to add an account on thw Xamain.Social Twitter UI, my app freezes and Android asks me whether to close or wait. Below is the minimal application based on the sample app. On the twitter side I added read and write permissions as well as checked "Allow this application to use 'Sign in with Twitter'". I filled in some arbitrary values for website/description and app name, I left callback URL blank.

Tested on Android 4.4 (Api Level 19).

    [Activity(Label = "Xamarin.Social Sample", MainLauncher = true)]
    public class MainActivity : Activity
    {
        private static readonly TwitterService Twitter = new TwitterService {
            ConsumerKey = "XXX",
            ConsumerSecret = "XXX"
            //CallbackUrl = new Uri("Callback URL from https://dev.twitter.com/apps")
        };

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            Button twitterButton = FindViewById<Button>(Resource.Id.Twitter);
            twitterButton.Click += delegate {
                Item item = new Item {
                    Text = "I'm sharing great things using Xamarin!",
                };

                Intent intent = Twitter.GetShareUI(this, item, null);
                StartActivity(intent);
            };
        }
    }

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.