OmniContacts gem always fail on with my yahoo contacts importes

耗尽温柔 提交于 2019-12-24 00:25:26

问题


I'm using OmniContacts gem to import contacts from yahoo and gmail to my app. Now the yahoo importer stop working.

I have the following actions on my controller:

def contacts_callback
    @contacts = request.env['omnicontacts.contacts']
    @importer = params[:importer]
    if session[:draw_token]
      @draw_token = session[:draw_token]
    end
  end

  def import_failed
    if session[:draw_token]
      draw = Draw.find_by_token(session[:draw_token])
      if draw != nil
        session[:draw_token] = nil
        redirect_to dashboard_draw_url(draw)
      else
        session[:draw_token] = nil
        redirect_to root_path, alert: _('Draw not exists.')
      end
    else
      redirect_to dashboard_show_invitation_email_friendship_url, alert: _('You have canceled the request.')
    end
  end

the routes:

  get '/contacts/:importer/callback'          => 'dashboard/invitation_email#contacts_callback'
  get '/contacts/failure'                     => 'dashboard/invitation_email#import_failed'

But know when I try to import from yahoo I'm always enter to the import_failed action and I can't understand why.

Does anybody has an idea what is the problem.

Thanks in advance


回答1:


This is an old question, but I'll answer it anyways so you can close it

First, you need to use the latest version of OmniContacts, in older versions, it was not using https, which is required by yahoo. [source]

Second, you should look in your console log, you may see an error similar to this:

Custom port is not allowed or the host is not registered with this consumer key.

This probably means you are using a callback url similar to this (typical for RoR)

http://localhost:3000/contacts/callback

Yahoo does not allow specifying ports. Here is a discussion and workaround from a Yahoo Dev.



来源:https://stackoverflow.com/questions/23215434/omnicontacts-gem-always-fail-on-with-my-yahoo-contacts-importes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!