Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Fail to open facebook profile with application:openUrl — Gideros Forum

Fail to open facebook profile with application:openUrl

RickyngkRickyngk Member
edited February 2013 in General questions
Hi,

I try to open our facebook page by using :
application:openUrl("http://www.facebook.com/guava7games")

It launches facebook app automatically, but show new feed instead of our page.

Would you please give me a hint !

Comments

  • tkhnomantkhnoman Member
    edited February 2013 Accepted Answer
    You need facebook id to open the page. Use this link:
    http://www.facebook.com/301050619945088

  • RickyngkRickyngk Member
    edited February 2013
    Thanks tkhnoman.

    Another solution by using XCode:

    First, find page id by using: http://graph.facebook.com/[page_name], example http://graph.facebook.com/GamesForTwo
    And here's result:
    {
       "about": "Play fun board games with your kids, friends, lovers, or with robot.\niPad Free version: <a href="https://itunes.apple.com/app/id592040719" rel="nofollow">https://itunes.apple.com/app/id592040719</a> \niPad Full version: <a href="https://itunes.apple.com/app/id574723506\n"" rel="nofollow">https://itunes.apple.com/app/id574723506\n"</a>,
       "general_info": "Facebook: <a href="https://www.facebook.com/guava7games\nTwitter" rel="nofollow">https://www.facebook.com/guava7games\nTwitter</a>: <a href="https://twitter.com/guava7games"" rel="nofollow">https://twitter.com/guava7games"</a>,
       "is_published": true,
       "talking_about_count": 4,
       "username": "GamesForTwo",
       "website": "<a href="http://www.guava7.com"" rel="nofollow">http://www.guava7.com"</a>,
       "were_here_count": 0,
       "category": "Games/toys",
       "id": "445673215469538",
       "name": "Games For Two",
       "link": "<a href="http://www.facebook.com/GamesForTwo"" rel="nofollow">http://www.facebook.com/GamesForTwo"</a>,
       "likes": 134,
       "cover": {
          "cover_id": 469587159744810,
          "source": "<a href="http://sphotos-g.ak.fbcdn.net/hphotos-ak-ash3/s720x720/47686_469587159744810_1984590257_n.jpg"" rel="nofollow">http://sphotos-g.ak.fbcdn.net/hphotos-ak-ash3/s720x720/47686_469587159744810_1984590257_n.jpg"</a>,
          "offset_y": 0
       }
    }
    Second, open facebook with:
    void _OpenFacebookPage(const char*pageid)
    {
        NSString* page;
        BOOL re = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:<a href="http://forum.giderosmobile.com/profile/fb%3A%2F%2F" rel="nofollow">@fb://</a>]];
        if (re)
        {
            page = [NSString stringWithFormat:<a href="http://forum.giderosmobile.com/profile/fb%3A%2F%2Fprofile%2F%25s" rel="nofollow">@fb://profile/%s</a>, pageid];    
        }
        else
        {
            page = [NSString stringWithFormat:@"<a href="http://www.facebook.com/%s"" rel="nofollow">http://www.facebook.com/%s&quot;</a>, pageid];
        }
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:<a href="http://forum.giderosmobile.com/profile/page" rel="nofollow">@page</a>]];
    }
  • RickyngkRickyngk Member
    edited February 2013
    P/S: I found an interesting link about iphone url schemes:
    http://wiki.akosma.com/IPhone_URL_Schemes#Facebook
  • I use application:openUrl("fb://page/PAGE_ID")
  • Is it possible to figure out if a user has the fb app installed? I know in Corona the openUrl method returned true if the request was successful. If the request to open the fb app with proper app id was successful id do nothing, if it wasnt id switch over to opening my page via browser.
  • code_monkeycode_monkey Member
    edited November 2013
    local url = "fb://profile/yourPageId"

    if (application:canOpenUrl(url)) then
    application:openUrl(url)
    else
    application:openUrl("http://www.facebook.com/urlToPage")
    end
Sign In or Register to comment.