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 +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +12 -15
- data/account_kit.gemspec +2 -2
- data/lib/account_kit/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 251a8969035dbfb38021a1eece9c1d3a98f2cf19
|
4
|
+
data.tar.gz: cd2296c7f5aeac9da93f4524b8eb609994d340c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96c3234a5b82c318f7f30f4f1dad91d45808bcb56b887c0d38b5b3aa44a2dee9af67b837334abea9b9c61889655cdaaf51dd736924b2046b02c6a094d6567f4e
|
7
|
+
data.tar.gz: 3a5b2dcc476eb64b6c1f6b7f92313b1916b86dbb84a2f698c9124b958a018752d7a0f55ee97584d3bf347e9bcda754e7276fe4ebc03e3ff7b981604679b9c22e
|
data/LICENSE.txt
CHANGED
@@ -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
|
30
|
-
config.app_secret
|
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
|
-
|
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
|
43
|
-
|
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
|
51
|
-
|
52
|
-
|
53
|
-
|
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
|
data/account_kit.gemspec
CHANGED
@@ -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{
|
14
|
-
spec.description = %q{
|
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)/}) }
|
data/lib/account_kit/version.rb
CHANGED
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.
|
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-
|
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:
|
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.
|
102
|
+
rubygems_version: 2.5.1
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
|
-
summary:
|
105
|
+
summary: A light-weight Ruby API client for Facebook Account Kit with no dependency.
|
106
106
|
test_files: []
|
107
|
-
has_rdoc:
|