我遇到了facebook登录问题.我安装了FB SDK 3.0,示例项目似乎运行良好 - 但不太确定.当我在自己的项目中创建一个按钮并尝试登录Facebook时,我总是从sessionStateChanged方法获得FBSessionStateClosedLoginFailed,虽然我显然得到了"你已经授权这个应用程序的页面.按Okay继续".我也尝试通过模拟器Safari Facebook页面注销,并重新启动我的项目,我得到了新的用户名/密码页面,然后我登录,但我仍然得到FBSessionStateClosedLoginFailed!
还有一些观察结果.1,我通过NSLog得到FBSessionStateClosedLoginFailed,在我点击Facebook页面上的Okay按钮之后立即出现"你已经授权了这个应用程序."2,我尝试了干净的xcode项目缓存,但没有帮助.
有点沮丧.我想知道你们中是否有人可以帮助解决这个问题.不胜感激!托尼
另外:我做了一些研究,我发现我所拥有的可能是一个典型的问题,正如Facebook在这里强调的那样("专业技巧3:完成所有iOS应用程序设置"部分页面http://developers.facebook.com/docs/howtos/login-with-facebook-using-ios-sdk /).在iPhone上有一个大红十字的图像正是我所拥有的.从xcode项目,我点击我的登录按钮,我被引导到这个页面,每次我必须点击这个页面上的"Okay"(让我称之为Okay_page)回到我在模拟器中的应用程序,但是登录状态为FBSessionStateClosedLoginFailed.我检查了捆绑ID,我说得对.我还没有"YOUR_IPHONE_APP_STORE_ID",我相信我需要向Apple支付费用,以后我会这样做,但不是在我还在努力的时候.
现在得到几个问题:1,我是否必须有YOUR_IPHONE_APP_STORE_ID才能跳过此Okay_page?2,这个(不是从这个Okay_page自动重定向回我的应用程序)与我有关的事情当我在这个Okay_page中手动点击Okay并在模拟器中返回我的应用程序时,我总是获得FBSessionStateClosedLoginFailed的登录状态吗?换句话说,是(我必须手动点击Okay才能回到我在Simulator中的应用程序)(之所以我获得了FBSessionStateClosedLoginFailed的状态)?
我最近开始使用redis(在轨道上使用ruby),我想知道存储此类数据的最佳方法是什么.
data1 = {
'name2' : {
'age' : xxx,
'height' : xxx,
},
'name2' : {
'age' : xxx,
'weight' : xxx,
}
}
data2 = {
'class1' : {
'num' : xxx,
'location' : xxx,
'teacher' : xxx,
},
'class2' : {
'num' : xxx,
'location' : xxx,
'teacher' : xxx,
}
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试使用哈希映射(hset,hmset,hget,hmget)命令,但它们似乎不能使用像"年龄"和"高度"这样的子键.
我正在尝试更改 Nginx ssl_protocols 的设置,但更改不会反映在服务器上。
起初我以为是因为我们使用的是 Ubuntu 12.04,但现在我们更新到了 14.04。
Nginx 版本:
nginx version: nginx/1.10.1
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --sbin-path=/usr/local/sbin/nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module
Run Code Online (Sandbox Code Playgroud)
Openssl 版本:
OpenSSL 1.0.1f 6 Jan 2014
Run Code Online (Sandbox Code Playgroud)
Ngnix.conf:
http {
include /usr/local/nginx/conf/mime.types;
default_type application/octet-stream;
tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay off;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log debug;
open_file_cache max=1000 inactive=20s;
open_file_cache_valid …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用RSpec在rails应用程序中测试控制器创建方法,如下所示:
def create
@user = User.new(user_params)
if @user.save
redirect_to user_path(@user.id)
else
render new_user_path
flash[:error] = "User not saved"
end
end
Run Code Online (Sandbox Code Playgroud)
但是,如果我踩灭.new,迫使它回到避免使用活动记录和用户模型测试true的ID的@user不被设置.save为正常,所以我不能测试它重定向到user_path(@user.id)的@user.id是零
这是我对RSpec的初步测试:
it "creates a user and redirects" do
expect_any_instance_of(User).to receive(:save).and_return(true)
post :create, { user: {name: "John", username: "Johnny98", email: "johnny98@example.com"} }
expect(assigns(:user).name).to eq("John")
expect(response).to redirect_to user_path(assigns(:user))
end
Run Code Online (Sandbox Code Playgroud)
我该如何在RSpec中测试这个重定向.
我的应用程序有products,categories和subcategries.我在网址/dash上有一个管理界面来编辑这些详细信息.我试着像这样设置网址:
/dash/products/products/porduct-code/category-name/dash/editcategories指向动作的类别编辑列表editcategoriescategory-name/subcategory-name/dash当我试图解决一件事时,另一件事打破了.我的整个路线文件变得一团糟.试图解决它们,事情不会奏效.这是我的路线文件:
Rails.application.routes.draw do
# Pages
root 'pages#home'
get 'terms' => 'pages#termsandconditions'
get 'delivery-charges' => 'pages#deliverycharges'
get 'search' => 'pages#search'
get 'deals' => 'pages#alldeals'
get 'contact', to: 'pages#contact'
post 'contact', to: 'pages#contactscreate'
get 'dealslist' => 'pages#dealslist'
get 'cart' => 'carts#cart'
get 'rate' => 'districtrates#rate'
get 'deliverycharges' => 'districtrates#deliverycharges'
get 'pricecalc' => 'pages#pricecalc'
# Devise routes
# Others
resources …Run Code Online (Sandbox Code Playgroud)