app/helpers/application_helper.rb
# todo: generalize, different url for each API (FB, GP, LI etc)
# todo: angularJS - moved to formatInviteFriendsLink filter
generalize, different url for each API (FB, GP, LI etc)
todo: angularJS - moved to formatInviteFriendsLink filter
generalize different url for each API ( FB GP LI etc ) todo : angularJS - moved to formatInviteFriendsLink filter
def invite_friends_url (login_user)
    if login_user.class != User
      msg = t 'shared.invite_friends.invalid_call'
      logger.debug2 msg
      return "javascript: alert('#{msg}')"
    end
    provider = login_user.provider
    case provider
      when 'facebook'
        title = t 'shared.invite_friends.invite_friends_message_title', :appname => APP_NAME
        message = t 'shared.invite_friends.invite_friends_message_body'
        url = "https://#{Koala.config.dialog_host}/dialog/apprequests" +
            "?app_id=#{API_ID[provider]}" +
            "&redirect_uri=#{CGI.escape(SITE_URL + @request_fullpath)}" +
            "&message=#{CGI.escape(message.to_str)}" +
            "&title=#{CGI.escape(title.to_str)}" +
            "&filters=" + CGI.escape("['app_non_users']")
        url
      else
        msg = t 'shared.invite_friends.not_implemented', login_user.app_and_apiname_hash
        "javascript: alert('#{msg}')"
    end 
  end
def invite_friends_url ( login_user ) if login_user . class != User msg = t 'shared.invite_friends.invalid_call' logger . debug2 msg return "javascript: alert('#{msg}')" end provider = login_user . provider case provider when 'facebook' title = t 'shared.invite_friends.invite_friends_message_title' , :appname => APP_NAME message = t 'shared.invite_friends.invite_friends_message_body' url = "https://#{Koala.config.dialog_host}/dialog/apprequests" + "?app_id=#{API_ID[provider]}" + "&redirect_uri=#{CGI.escape(SITE_URL + @request_fullpath)}" + "&message=#{CGI.escape(message.to_str)}" + "&title=#{CGI.escape(title.to_str)}" + "&filters=" + CGI . escape ( "['app_non_users']" ) url else msg = t 'shared.invite_friends.not_implemented' , login_user . app_and_apiname_hash "javascript: alert('#{msg}')" end end
todo: generalize, different url for each API (FB, GP, LI etc)
todo: angularJS - moved to formatInviteFriendsLink filter
todo : generalize different url for each API ( FB GP LI etc ) todo : angularJS - moved to formatInviteFriendsLink filter
# invalid call - login_user was missing in invite_friends_url call # url - friend request url # no koala gem method for generation a invite friends url # https://developers.facebook.com/docs/reference/dialogs/requests/ # logger.debug2  "url = #{url}" # invite provider friends is not implemented # case
login_user
<not_specific>