k c
k c

Reputation: 211

Handling the google interactive post onclick via javascript

My scenario is as follows:

Our application is building on top of google-plus and takes advantage of the google-plus connections.

Is this supported with Interactive posts? I want to:

  1. Block showing the interactive post dialog on the button click if a certain condition is not met
  2. Perform a certain action once the button to show the dialog is clicked - onClick works for this but I could not find documentation on it.

    var options = {
            contenturl: url,
            clientid: googleappid,
            cookiepolicy: "single_host_origin",
            prefilltext: text,
            calltoactionlabel: "START",
            calltoactionurl: ctaurl,
            recipients: connectionid,
            onClick: specialFunctionToRunOnClick(params)
     };             
     gapi.interactivepost.render('submitInvitationongoogle', options);
    

Is there something like beforeSend that can prevent the click from firing?

Upvotes: 0

Views: 1534

Answers (1)

class
class

Reputation: 8681

There currently is not an API for testing whether the user has created an interactive post on their stream. You can know when the interactive post was rendered to the user by logging the API calls for gapi.interactivepost.render and can use the call-to-action url for testing when the recipient clicked the button. You can also look at their public stream activity to test whether the post was shared publicly but this is probably not what you want.

Upvotes: 1

Related Questions