Page History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Quick Start Implementation

Include Page
Template_gigya setup sn app
Template_gigya setup sn app

Include Page
Enable Retrieving User Contacts Notice Template For Share
Enable Retrieving User Contacts Notice Template For Share

Implementation Overview

If you already have included Gigya social login in your site, adding Share should be simple, and involves only adding a few lines of code:

  • Construct a UserAction object, which represents an action taken by a user on your site. The basic elements you need to include in the object are:
    • Title - The title of the posted content.
    • Link Back - A link that typically points to the content source.
      Include Page
      Share URL Restrictions Template
      Share URL Restrictions Template
       
    • Description (optional) - A description of the story or item.
    • Media Item/s (optional) - This can be image/s, a Flash file (inc. video players), or an Mp3 file.
 
Note: It is highly recommended to implement Open Graph Tags directly on your HTML, for better structured news feed post on Facebook ('like'), Twitter and Google (+1).
This way native sharing when copy-pasting your site URL will structure the share post as defined.

 

 

  • Call the showShareUI API to activate the Share add-on and enable the user to share his action.

Code Example

Add the following code snip to activate the Share add-on that is presented in the screenshot above:

Code Block
languagejs
linenumberstrue
// Constructing a UserAction Object
var act = new gigya.socialize.UserAction();

// Setting the Title
act.setTitle("This is my title");

// Adding a Link Back
act.setLinkBack("http://www.gigya.com/site/content/socialize.aspx");

// Setting the Description
act.setDescription("This is my Description");

// Adding a Media (image)
act.addMediaItem( { 
    type: 'image',      // Type of the media (image/flash/mp3)
    src: 'http://graphics8.nytimes.com/images/2006/01/02/science/03cute.large2.jpg',   // URL to the image source
    href: 'http://www.gigya.com/site/content/socialize.aspx'    // URL to redirect the user when he clicks the image
 });

// Activate the Share add-on
gigya.socialize.showShareUI({  userAction:act });

 

...