Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7857017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:53:50+00:00 2026-06-02T20:53:50+00:00

summary in short: edge.create stopped firing in embedded HTML inside UIWebView (and I did

  • 0

summary in short: edge.create stopped firing in embedded HTML inside UIWebView (and I did not change anything in code for a while) – any ideas how can I get it back?


I have iOS application which has UIWebView with Facebook Like button.
enter image description here

User logs into Facebook BEFORE this dialog appears, so there is no login logic happening.

I can click like/unlike – and it works fine – but it used to close the dialog, and few days ago this broke. Closing the dialog was achieve by subscribing to edge.create / edge.remove events.

Here is my HTML page:

<html>
    <head>
        <style type='text/css'>
            * { -webkit-touch-callout: none; -webkit-user-select: none; }
            body { margin:0px; }
            .fb_edge_comment_widget { display: none !important; }
        </style>
    </head>
    <body>                   
        <div id='fb-root'></div>
        <script src='http://connect.facebook.net/en_US/all.js#xfbml=1'></script>
        <script>
            function forwardEvent(name) {
                var iframe = document.createElement('iframe');
                iframe.setAttribute('src', 'event:' + name);
                document.documentElement.appendChild(iframe);
                iframe.parentNode.removeChild(iframe);  
            };
            function beginForwardingEvent(name) {
                FB.Event.subscribe(name, function(r) { forwardEvent(name); });
            };
            function beginForwardingEvents(names) {
                for (var i = 0; i < names.length; i++) {
                    beginForwardingEvent(names[i]);
                }
            };
            beginForwardingEvents(['edge.create', 'edge.remove', 'xfbml.render']);
        </script>    
        <fb:like    href='%@' 
                    send='false' 
                    layout='%@' 
                    width='%.0f' 
                    show_faces='%@' 
                    action='%@' 
                    colorscheme='%@' 
                    font='%@'
                    ></fb:like>
    </body>
</html>

and here is how i capture events in Objective-C code:

- (void)didObserveFacebookEvent:(NSString *)fbEvent {
    if ([fbEvent isEqualToString:@"edge.create"] && [_delegate respondsToSelector:@selector(facebookLikeViewDidLike:)])
        [_delegate facebookLikeViewDidLike:self];
    else if ([fbEvent isEqualToString:@"edge.remove"] && [_delegate respondsToSelector:@selector(facebookLikeViewDidUnlike:)])
        [_delegate facebookLikeViewDidUnlike:self];
    else if ([fbEvent isEqualToString:@"xfbml.render"] && [_delegate respondsToSelector:@selector(facebookLikeViewDidRender:)])
        [_delegate facebookLikeViewDidRender:self];
}


- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
    // Allow loading Like button XFBML from file
    if ([request.URL.scheme isEqualToString:@"file"])
        return YES;

    // Allow loading about:blank, etc.
    if ([request.URL.scheme isEqualToString:@"about"])
        return YES;

    // Block loading of 'event:*', our scheme for forwarding Facebook JS SDK events to native code
    else if ([request.URL.scheme isEqualToString:@"event"]) {
        [self didObserveFacebookEvent:request.URL.resourceSpecifier];
        return NO;
    }
  ....
}

so once again – edge.create stopped firing (and I did not change anything in code for a while) – any ideas how can I get it back?

Thank you.

UPDATE:
though there is a FB bug reported, i still would like to understand why it does work on FBRELL site but does not work inside iOS UIWebView. May be there is a tweak required for iOS dialog? Is there a workaround for this? Started the bounty hoping to get an answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:53:53+00:00Added an answer on June 2, 2026 at 8:53 pm

    It seems that the edge.create event won’t fire within the local HTML file. Whether this is by chance or design, I’m unsure, but I’ve done a few things and got this to work:

    1. Hosted the ‘FacebookLikeView.html’ file on my own server, substituting the format specifiers for the actual values i want, e.g. action='%@' is now explicitly action='like'.

    2. Removed everything from the load method in FacebookLikeView.m and replaced it with the line:

      [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.yourhost.com/FacebookLikeView.html"]]];
      
    3. Changed the line in the webView:shouldStartLoadWithRequest:navigationType method:

      if ([request.URL.scheme isEqualToString:@"file"])
          return YES;
      

      to

      if ([request.URL.host hasSuffix:@"yourhost.com"]) 
          return YES;
      

    It’s not the answer you were hoping for, but I hope this gives you some clues, and at the very least helps to get it working in the meantime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short summary: How to accept content that may be endless and not uploaded at
Summary Long story short, we've been tasked with gutting the authentication and authorization parts
I have a performance bottleneck on a DataView.Sort. The code is below. /// <summary>
Summary: I want to to create a templateField resulting from a database after calling
SUMMARY: When browsing an ASP.NET website using Windows Explorer, popup windows do not borrow
Short summary : My Qt class crashes at class construction part when calling the
I have the following code snippet. public static void main(String[] args) { short a
Short summary: When you want to predefine certain instantiations of a class, is it
Bit of a long explanation below, with a hopefully accurate short question summary here:
Let’s consider this very short snippet of code: #include <stdlib.h> int main() { char*

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.