account_kit 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b10c307c2b20139c94e06aff179ceb92c73857e
4
- data.tar.gz: 26d2891da10923bd96a7b2cd7b49a4a0a6301506
3
+ metadata.gz: 251a8969035dbfb38021a1eece9c1d3a98f2cf19
4
+ data.tar.gz: cd2296c7f5aeac9da93f4524b8eb609994d340c0
5
5
  SHA512:
6
- metadata.gz: fc80d794371579bdc2f9aed343690358b250a7b9351ee8a8ec2d2baa3194f18dc7fbd63085339f6af56176ae21fa3b8d0d886440a08400773448a9f0885450ed
7
- data.tar.gz: f32fbd064b504d92892a9b1de800b5c95796692fe5c81f5338f641c8daa5c5166e3dcb31dfe6bc70ad5e4e98961921854b4c0b8b063c3d15f2484e474614d6ea
6
+ metadata.gz: 96c3234a5b82c318f7f30f4f1dad91d45808bcb56b887c0d38b5b3aa44a2dee9af67b837334abea9b9c61889655cdaaf51dd736924b2046b02c6a094d6567f4e
7
+ data.tar.gz: 3a5b2dcc476eb64b6c1f6b7f92313b1916b86dbb84a2f698c9124b958a018752d7a0f55ee97584d3bf347e9bcda754e7276fe4ebc03e3ff7b981604679b9c22e
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Duc Le, Long Nguyen, Quy Truong
3
+ Copyright (c) 2016 Duc Le, Long Nguyen, Quy Truong, Tan Vu
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Code Climate](https://codeclimate.com/github/Coffa/account_kit/badges/gpa.svg)](https://codeclimate.com/github/Coffa/account_kit)
2
+
1
3
  # AccountKit
2
4
  A light-weight Ruby API client for [Facebook Account Kit](https://developers.facebook.com/docs/accountkit) with no dependency.
3
5
  A demo of the Account Kit can be found [here](https://www.facebook.com/FacebookforDevelopers/videos/10153620979588553/).
@@ -26,32 +28,27 @@ To work with Account Kit API, you need to provide Facebook App ID, Account Kit A
26
28
 
27
29
  ```
28
30
  AccountKit.configure do |config|
29
- config.app_id = '1234566789'
30
- config.app_secret = 'abcdefghijklm'
31
+ config.app_id = '1234566789'
32
+ config.app_secret = 'abcdefghijklm'
31
33
  config.api_version = 'v1.0'
32
34
  end
33
35
  ```
34
36
 
35
37
  ### API
36
38
 
37
- We currently only supports [Authorization Code Flow](https://developers.facebook.com/docs/accountkit/accesstokens). Support for Client Access Token Flow will come in later versions.
38
-
39
- To get access token, you need to provide the authorization code you get after user authenticate with Account Kit:
39
+ If you turn off Enable Client Access Token Flow and use [Authorization Code Flow](https://developers.facebook.com/docs/accountkit/accesstokens), you need to provide the authorization code after user authenticate with Account Kit in order to get an access token:
40
40
 
41
41
  ```
42
- response = AccountKit.access_token(authorization_code)
43
- json_response = JSON.parse(response)
44
- access_token = json_response['access_token']
42
+ response = JSON.parse(AccountKit.access_token(authorization_code).body)
43
+ access_token = response['access_token']
45
44
  ```
46
-
47
- The response contains user's access token, use this token to get user's email or phone number:
45
+ If you turn on Enable Client Access Token Flow, you should already have an access token after user authenticate. To get account information, use the access token to get user's email or phone number:
48
46
 
49
47
  ```
50
- response = AccountKit.me(access_token)
51
- json_response = JSON.parse(response)
52
- email = json_response[:email][:address]
53
- phone_code = json_response[:phone][:country_prefix]
54
- phone_number = json_response[:phone][:national_number]
48
+ response = JSON.parse(AccountKit.me(access_token).body)
49
+ email = response[:email][:address]
50
+ phone_code = response[:phone][:country_prefix]
51
+ phone_number = response[:phone][:national_number]
55
52
  ```
56
53
 
57
54
  ## Development
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["leminhducktvn@gmail.com", "longkt90@gmail.com", "sugiacupit@gmail.com"]
11
11
 
12
12
  spec.homepage = "https://github.com/Coffa/account_kit"
13
- spec.summary = %q{Gem for Facebook accountkit}
14
- spec.description = %q{Gem for Facebook accountkit}
13
+ spec.summary = %q{A light-weight Ruby API client for Facebook Account Kit with no dependency.}
14
+ spec.description = %q{A light-weight Ruby API client for Facebook Account Kit with no dependency.}
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -1,3 +1,3 @@
1
1
  module AccountKit
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: account_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duc Le
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2016-04-15 00:00:00.000000000 Z
14
+ date: 2016-04-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -55,7 +55,7 @@ dependencies:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
57
  version: '3.0'
58
- description: Gem for Facebook accountkit
58
+ description: A light-weight Ruby API client for Facebook Account Kit with no dependency.
59
59
  email:
60
60
  - leminhducktvn@gmail.com
61
61
  - longkt90@gmail.com
@@ -99,9 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.4.8
102
+ rubygems_version: 2.5.1
103
103
  signing_key:
104
104
  specification_version: 4
105
- summary: Gem for Facebook accountkit
105
+ summary: A light-weight Ruby API client for Facebook Account Kit with no dependency.
106
106
  test_files: []
107
- has_rdoc: