facebook_app 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,11 @@ module FacebookApp
24
24
  # tracking is only relevant for users who will log in
25
25
  session[:oauth_expiry] = nil
26
26
  track_conversion(:see_permissions_dialogue)
27
- redirect_to oauth_code_link
27
+ if Configurable[:canvas_app]
28
+ client_side_redirect(oauth_code_link)
29
+ else
30
+ redirect_to oauth_code_link
31
+ end
28
32
  end
29
33
  end
30
34
 
@@ -55,6 +59,15 @@ module FacebookApp
55
59
  authenticator.url_for_oauth_code(:permissions => Configurable["facebook_permissions"])
56
60
  end
57
61
 
62
+ def client_side_redirect(redirect_link)
63
+ %Q{
64
+ <script>
65
+ top.location="#{redirect_link}";
66
+ </script>
67
+ }.html_safe
68
+ render :inline => client_side_redirect
69
+ end
70
+
58
71
  def authenticator
59
72
  @authenticator ||= Koala::Facebook::OAuth.new(FacebookCredentials.app_id, FacebookCredentials.secret, facebook_app.oauth_callback_url(:marketing_mode => params[:marketing_type]))
60
73
  end
@@ -3,12 +3,7 @@ module FacebookApp
3
3
 
4
4
  def denied
5
5
  track_conversion(:deny_permissions)
6
- client_side_redirect= %Q{
7
- <script>
8
- top.location="#{identified_tracking_link}";
9
- </script>
10
- }.html_safe
11
- render :inline => client_side_redirect
6
+ client_side_redirect(facebook_app.identified_tracking_link)
12
7
  end
13
8
 
14
9
  # this is the callback URL. It should handle both the case
data/facebook_app.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.version = FacebookApp::VERSION
9
9
  s.authors = ["Jack Kinsella"]
10
10
  s.email = ["jack.kinsella@gmail.com"]
11
- s.homepage = ""
11
+ s.homepage = "http://www.jackkinsella.ie"
12
12
  s.summary = %q{Base Facebook for rapid development of future Facebook applications}
13
13
  s.description = %q{Includes authentication, tracking, and lots of convenience methods}
14
14
 
@@ -1,3 +1,3 @@
1
1
  module FacebookApp
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  end
@@ -77,3 +77,8 @@ show_splash_page:
77
77
  name: Show the splash page or redirect to main page
78
78
  default: true
79
79
  type: boolean
80
+
81
+ canvas_app:
82
+ name: Tick if this app is a Canvas app
83
+ default: false
84
+ type: boolean
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: facebook_app
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.16
5
+ version: 0.0.17
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jack Kinsella
@@ -159,7 +159,7 @@ files:
159
159
  - lib/generators/facebook_app/templates/seeds.rb
160
160
  - pkg/facebook_app-0.0.3.gem
161
161
  - script/infographic.py
162
- homepage: ""
162
+ homepage: http://www.jackkinsella.ie
163
163
  licenses: []
164
164
 
165
165
  post_install_message: