Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's a way to do it via the API. We finally got it to work, after many hours of sweat and tears :) </p> <p>You can add a tab to a page without leaving your app. Here's a snippet of code that we used for that. We get a list of pages that a user manages, show them in a drop down and ask them to select what page they want to add our "my agent profile" tab to.</p> <p>And the final product looks something like this - <a href="http://www.facebook.com/pages/Jennifer-Anderson-Real-Estate-Agent/185071901564573?sk=app_253956901293839" rel="nofollow">http://www.facebook.com/pages/Jennifer-Anderson-Real-Estate-Agent/185071901564573?sk=app_253956901293839</a></p> <pre><code>protected void btnAddTab_Click(object sender, EventArgs e) { if (ddlPage2.SelectedIndex &gt;= 0) { FaceBookPages page = FaceBookPages.LookupByPageID(long.Parse(ddlPage2.SelectedValue)); if (page == null) throw new NPlaySysException("FaceBookPages is null."); AnalyticLog log = new AnalyticLog(); log.EventID = FBCommon.Events.AddAgentAppTabID; log.UserID = UserID; log.EventTime = DateTime.Now; log.Update(); string result = FacebookSvc.AddTab(Web.AgentAppID, "me", page.AccessToken); if (result.Equals("true")) { FaceBookPages.UpdateAgentProfileAdded(page.PageID, true); List&lt;FaceBookPages&gt; notTabbedPages = FaceBookPages.LookupAgentProfileNotAddedByUserID(UserID); imgStep3.ImageUrl = StepDoneImagePath; divStep3.Attributes["class"] = StepDoneCssClass; phStep3.Visible = false; Step3Done = true; btnCloseStep3.Visible = false; if (notTabbedPages.Count &gt; 0) btnEditStep3.Visible = true; else btnEditStep3.Visible = false; } else { lblErrorAddTab.Text = "Failed to add your profile to page."; Web.EmailError(string.Format("FacebookSvc.AddTab Failed. result={0}&lt;br /&gt;UserID={1}&lt;br /&gt;PageID={2}", result, UserID, page.PageID)); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload