SocialNetType GooglePlusOne not working

6 posts, 0 answers
  1. Fraser Tustian
    Fraser Tustian avatar
    18 posts
    Member since:
    Sep 2012

    Posted 01 Jul 2013 Link to this post

    Greetings!

    I'm having trouble with Social Share and a RadSocialButton where SocialNetType is "GooglePlusOne". It seems very easy to replicate.

    When I use that button via the test below, the URL that it requests from Google for the FastButton script is:

    https://apis.google.com/_/+1/fastbutton?bsv&size=470&annotation=470&width=&hl=en-US&origin=http%3A%2F%2Flocalhost%3A57814&url=http%3A%2F%2Fwww.telerik.com%2F&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.VvwHmr5PUZc.O%2Fm%3D__features__%2Fam%3DEQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTPwTaslh-up04HMsbjUbinCI6C0Hw

    Google is returning an error 400 (access is denied) for that script url.

    It seems that the problem with the URL is the "annotation=470" parameter. According to the Google API, annotation is an enumeration that should have a value such as "none" or "inline". "470" seems invalid and I suspect is causing the problem. Is it mistakenly being copied over from size?

    Is this a known issue? Am I doing something wrong or is there a workaround?

    To confirm, the URL:

    https://apis.google.com/_/+1/fastbutton?bsv&size=470&width=&hl=en-US&origin=http%3A%2F%2Flocalhost%3A57814&url=http%3A%2F%2Fwww.telerik.com%2F&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.VvwHmr5PUZc.O%2Fm%3D__features__%2Fam%3DEQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTPwTaslh-up04HMsbjUbinCI6C0Hw

    ...works fine (which is the same URL, without the annotation parameter).

    I am using 2013.2.611.40

    The code to reproduce this is simply:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="GooglePlusTest._default" %>
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!DOCTYPE html>
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager runat="server" />
            <telerik:RadSocialShare ID="RadSocialShare1" runat="server" UrlToShare="http://www.telerik.com" >
                <MainButtons>
                    <telerik:RadSocialButton SocialNetType="ShareOnFacebook" />
                    <telerik:RadSocialButton SocialNetType="GooglePlusOne" />
                    <telerik:RadSocialButton SocialNetType="ShareOnTwitter" />
                </MainButtons>
            </telerik:RadSocialShare>
        </div>
        </form>
    </body>
    </html>
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 03 Jul 2013 Link to this post

    Hi Fraser,

    RadSocialShare exposes two types of buttons - Standard Buttons and Styled Buttons. Styled buttons are rendered within the RadSocialButton element and their type is controlled through the SocialNetType property. If any of the other options is chosen for the SocialNetType this invokes the Standard Button
    instead which is rendered by external scripts and the other properties do not apply.

    It seems that there is some issue when the Standard Button - GooglePlusOne is declared within the Styled Button's property - SocialNetType. Therefore you can declare it in the Standard Buttons's declaration. For example:
    <telerik:RadSocialShare ID="RadSocialShare1" runat="server" UrlToShare="http://www.telerik.com">
        <MainButtons>
            <telerik:RadSocialButton SocialNetType="ShareOnFacebook" />
            <telerik:RadSocialButton SocialNetType="ShareOnTwitter" />
            <%--<telerik:RadSocialButton SocialNetType="GooglePlusOne" />--%>
            <telerik:RadGoogleButton />
        </MainButtons>
    </telerik:RadSocialShare>

    This declaration also lets you fine tune the appearance of the button.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fraser Tustian
    Fraser Tustian avatar
    18 posts
    Member since:
    Sep 2012

    Posted 03 Jul 2013 Link to this post

    Thanks for the reply Danail,

    Unfortunately the RadGoogleButton doesn't support the CustomIconUrl property, which I need to use (I didn't explain that as it wasn't important in terms of drawing attention to this particular bug).

    Do I take it that, with this bug, there's currently no way to have a 16x16 "+1" button? All of the other standard social share buttons are 16x16, so I'd like our "+1" button to be that size, too.

    But if you use the standard button for Google Plus, it doesn't work, and if you use the RadGoogleButton then there are no 16x16 options available.

    Am I reading that correctly, or is there any workaround that I'm missing?

    We can make do in the short term by using the "Small" button and putting it last on the Social Share so the fact that it's a different size to the rest of the buttons isn't so bad, but the spec is to put that button second, so we need to somehow get it working with the same size as the others.

    Thanks for your help!

    Cheers,

    FRASER TUSTIAN
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 08 Jul 2013 Link to this post

    Hello Fraser,

    What I can suggest you is to try creating a custom styled button that loads the Google Plus' scripts and inject it inside the RadSocialShare. This code library sheds more light on the matter. I have also attached the sprite image for the styled buttons that can be used.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. Fraser Tustian
    Fraser Tustian avatar
    18 posts
    Member since:
    Sep 2012

    Posted 09 Jul 2013 Link to this post

    Thanks Danail,

    Whilst I need to get this right, it's not our top priority. Could I confirm that this is a bug and, therefore, it should be fixed in an future update?

    If so, I can wait for that update... but let me know if that's not the case.

    Cheers,

    FRASER TUSTIAN
  7. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 15 Jul 2013 Link to this post

    Hello Fraser,

    Google Plus One Button is a standard button and to add this button you need the <telerik:RadGoogleButton /> in the MainButtons collection. This is described in Standard Buttons help article, section Google Plus One Button.

    Although it is possible to set a Standard Button through the styled buttons' declaration (<telerik:RadSocialButton SocialNetType="GooglePlusOne" .. />), this is not recommended because it does not perform all the specific configurations for the particular standard button (e.g. for RadGoogleButton - AnnotationType and ButtonSize properties) because the styled buttons functionality is different. This can cause issues like the described one.

    Therefore, the mentioned issue is not a bug with the control, but rather a configuration setting related to standard buttons whose customization we do not support. If you want to create you own styled button you can follow the instructions form the provided KB in my previous post.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017