Skip to content

Commit b07dba7

Browse files
authored
Merge pull request #2 from ARX-SKE12/authentication
Update Doc
2 parents 9428a9f + d861da0 commit b07dba7

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

README.md

+54-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,54 @@
1-
# facebook-auth-kit
1+
# Facebook Authentication Kit for Unity
2+
3+
Facebook Authentication Toolkit for Unity
4+
5+
## Usage
6+
7+
* Add Facebook Auth Controller from `FBAuthKit/Kit/Prefabs/Facebook Auth Controller.prefab` to your Unity scene.
8+
9+
* Create Facebook Auth subscriber script and put it to scene.
10+
11+
## Facebook Auth Subscriber
12+
13+
```cs
14+
using UnityEngine;
15+
using Facebook.Unity;
16+
using FBAuthKit;
17+
18+
public class ExampleFBAuthSubscriber : MonoBehaviour {
19+
20+
void Start()
21+
{
22+
//Register as subscriber
23+
facebookController.GetComponent<FacebookAuthController>().Register(gameObject);
24+
}
25+
26+
void OnAuthSuccess(AccessToken token)
27+
{
28+
//Do something when authentication is successful.
29+
}
30+
31+
void OnInitializedFailure()
32+
{
33+
//Do something when Facebook SDK initialization is failure.
34+
}
35+
36+
void OnAuthRequest()
37+
{
38+
//Do something when waiting process of Facebook Authentication.
39+
}
40+
41+
void OnAuthFailure()
42+
{
43+
//Do something when authentication is failure.
44+
}
45+
46+
}
47+
```
48+
49+
## Solution when Facebook.Unity.Setting.dll is duplicate!
50+
51+
1. Close Unity
52+
2. Go to `C:\Program Files\Unity\Editor\Data\PlaybackEngines`
53+
3. Remove `Facebook`
54+
4. Open Unity Project Again

0 commit comments

Comments
 (0)