@capgo/capacitor-social-login 7.20.0-beta.1 → 7.20.0-beta.3
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.
- package/android/src/facebookStubs/java/com/facebook/AccessToken.java +65 -0
- package/android/src/facebookStubs/java/com/facebook/CallbackManager.java +23 -0
- package/android/src/facebookStubs/java/com/facebook/FacebookCallback.java +11 -0
- package/android/src/facebookStubs/java/com/facebook/FacebookException.java +24 -0
- package/android/src/facebookStubs/java/com/facebook/FacebookSdk.java +22 -0
- package/android/src/facebookStubs/java/com/facebook/GraphRequest.java +56 -0
- package/android/src/facebookStubs/java/com/facebook/GraphResponse.java +25 -0
- package/android/src/facebookStubs/java/com/facebook/login/LoginBehavior.java +14 -0
- package/android/src/facebookStubs/java/com/facebook/login/LoginManager.java +39 -0
- package/android/src/facebookStubs/java/com/facebook/login/LoginResult.java +27 -0
- package/package.json +2 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
package com.facebook;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
import java.util.Collection;
|
|
5
|
+
import java.util.Collections;
|
|
6
|
+
import java.util.Date;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Stub class for Facebook AccessToken.
|
|
10
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
11
|
+
*/
|
|
12
|
+
public class AccessToken {
|
|
13
|
+
|
|
14
|
+
@Nullable
|
|
15
|
+
public static AccessToken getCurrentAccessToken() {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public static void refreshCurrentAccessTokenAsync(AccessTokenRefreshCallback callback) {
|
|
20
|
+
if (callback != null) {
|
|
21
|
+
callback.OnTokenRefreshFailed(null);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public String getToken() {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public String getApplicationId() {
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public String getUserId() {
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public Date getExpires() {
|
|
38
|
+
return new Date();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public Date getLastRefresh() {
|
|
42
|
+
return new Date();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public boolean isExpired() {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public boolean isDataAccessExpired() {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public Collection<String> getPermissions() {
|
|
54
|
+
return Collections.emptyList();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public Collection<String> getDeclinedPermissions() {
|
|
58
|
+
return Collections.emptyList();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public interface AccessTokenRefreshCallback {
|
|
62
|
+
void OnTokenRefreshed(@Nullable AccessToken accessToken);
|
|
63
|
+
void OnTokenRefreshFailed(@Nullable FacebookException e);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
package com.facebook;
|
|
2
|
+
|
|
3
|
+
import android.content.Intent;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Stub class for Facebook CallbackManager.
|
|
7
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
8
|
+
*/
|
|
9
|
+
public interface CallbackManager {
|
|
10
|
+
|
|
11
|
+
boolean onActivityResult(int requestCode, int resultCode, Intent data);
|
|
12
|
+
|
|
13
|
+
class Factory {
|
|
14
|
+
public static CallbackManager create() {
|
|
15
|
+
return new CallbackManager() {
|
|
16
|
+
@Override
|
|
17
|
+
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package com.facebook;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stub interface for Facebook FacebookCallback.
|
|
5
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
6
|
+
*/
|
|
7
|
+
public interface FacebookCallback<RESULT> {
|
|
8
|
+
void onSuccess(RESULT result);
|
|
9
|
+
void onCancel();
|
|
10
|
+
void onError(FacebookException error);
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.facebook;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stub class for Facebook FacebookException.
|
|
5
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
6
|
+
*/
|
|
7
|
+
public class FacebookException extends RuntimeException {
|
|
8
|
+
|
|
9
|
+
public FacebookException() {
|
|
10
|
+
super();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public FacebookException(String message) {
|
|
14
|
+
super(message);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public FacebookException(String message, Throwable cause) {
|
|
18
|
+
super(message, cause);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public FacebookException(Throwable cause) {
|
|
22
|
+
super(cause);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.facebook;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Stub class for Facebook FacebookSdk.
|
|
7
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
8
|
+
*/
|
|
9
|
+
public class FacebookSdk {
|
|
10
|
+
|
|
11
|
+
public static void setApplicationId(String applicationId) {
|
|
12
|
+
// Stub - no-op
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public static void setClientToken(String clientToken) {
|
|
16
|
+
// Stub - no-op
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public static void sdkInitialize(Context context) {
|
|
20
|
+
// Stub - no-op
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
package com.facebook;
|
|
2
|
+
|
|
3
|
+
import android.os.Bundle;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
import org.json.JSONObject;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Stub class for Facebook GraphRequest.
|
|
9
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
10
|
+
*/
|
|
11
|
+
public class GraphRequest {
|
|
12
|
+
|
|
13
|
+
private Bundle parameters;
|
|
14
|
+
private Callback callback;
|
|
15
|
+
|
|
16
|
+
public static GraphRequest newMeRequest(AccessToken accessToken, GraphJSONObjectCallback callback) {
|
|
17
|
+
GraphRequest request = new GraphRequest();
|
|
18
|
+
request.callback = new Callback() {
|
|
19
|
+
@Override
|
|
20
|
+
public void onCompleted(GraphResponse response) {
|
|
21
|
+
if (callback != null) {
|
|
22
|
+
callback.onCompleted(null, response);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return request;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public void setParameters(Bundle parameters) {
|
|
30
|
+
this.parameters = parameters;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public void executeAsync() {
|
|
34
|
+
// Stub - no-op, just call callback with empty response
|
|
35
|
+
if (callback != null) {
|
|
36
|
+
GraphResponse response = new GraphResponse();
|
|
37
|
+
callback.onCompleted(response);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public void executeAndWait() {
|
|
42
|
+
// Stub - no-op, just call callback with empty response
|
|
43
|
+
if (callback != null) {
|
|
44
|
+
GraphResponse response = new GraphResponse();
|
|
45
|
+
callback.onCompleted(response);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public interface Callback {
|
|
50
|
+
void onCompleted(GraphResponse response);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public interface GraphJSONObjectCallback {
|
|
54
|
+
void onCompleted(@Nullable JSONObject object, @Nullable GraphResponse response);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.facebook;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Stub class for Facebook GraphResponse.
|
|
7
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
8
|
+
*/
|
|
9
|
+
public class GraphResponse {
|
|
10
|
+
|
|
11
|
+
@Nullable
|
|
12
|
+
public FacebookRequestError getError() {
|
|
13
|
+
return new FacebookRequestError();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public static class FacebookRequestError {
|
|
17
|
+
public String getErrorMessage() {
|
|
18
|
+
return "Facebook SDK is not available (stub)";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public Exception getException() {
|
|
22
|
+
return new FacebookException("Facebook SDK is not available (stub)");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
package com.facebook.login;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stub enum for Facebook LoginBehavior.
|
|
5
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
6
|
+
*/
|
|
7
|
+
public enum LoginBehavior {
|
|
8
|
+
NATIVE_WITH_FALLBACK,
|
|
9
|
+
NATIVE_ONLY,
|
|
10
|
+
KATANA_ONLY,
|
|
11
|
+
WEB_ONLY,
|
|
12
|
+
WEB_VIEW_ONLY,
|
|
13
|
+
DEVICE_AUTH
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
package com.facebook.login;
|
|
2
|
+
|
|
3
|
+
import androidx.activity.result.ActivityResultRegistryOwner;
|
|
4
|
+
import com.facebook.CallbackManager;
|
|
5
|
+
import com.facebook.FacebookCallback;
|
|
6
|
+
import java.util.Collection;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Stub class for Facebook LoginManager.
|
|
10
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
11
|
+
*/
|
|
12
|
+
public class LoginManager {
|
|
13
|
+
|
|
14
|
+
private static final LoginManager instance = new LoginManager();
|
|
15
|
+
|
|
16
|
+
public static LoginManager getInstance() {
|
|
17
|
+
return instance;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public void registerCallback(CallbackManager callbackManager, FacebookCallback<LoginResult> callback) {
|
|
21
|
+
// Stub - no-op
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public void setLoginBehavior(LoginBehavior loginBehavior) {
|
|
25
|
+
// Stub - no-op
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public void logIn(ActivityResultRegistryOwner activityResultRegistryOwner, CallbackManager callbackManager, Collection<String> permissions) {
|
|
29
|
+
// Stub - no-op
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public void logIn(ActivityResultRegistryOwner activityResultRegistryOwner, CallbackManager callbackManager, Collection<String> permissions, String nonce) {
|
|
33
|
+
// Stub - no-op
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public void logOut() {
|
|
37
|
+
// Stub - no-op
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package com.facebook.login;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Nullable;
|
|
4
|
+
import com.facebook.AccessToken;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Stub class for Facebook LoginResult.
|
|
8
|
+
* This is used when Facebook login is disabled to allow compilation without the Facebook SDK.
|
|
9
|
+
*/
|
|
10
|
+
public class LoginResult {
|
|
11
|
+
|
|
12
|
+
@Nullable
|
|
13
|
+
public AccessToken getAccessToken() {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@Nullable
|
|
18
|
+
public AuthenticationToken getAuthenticationToken() {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public static class AuthenticationToken {
|
|
23
|
+
public String getToken() {
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-social-login",
|
|
3
|
-
"version": "7.20.0-beta.
|
|
3
|
+
"version": "7.20.0-beta.3",
|
|
4
4
|
"description": "All social logins in one plugin",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"unpkg": "dist/plugin.js",
|
|
9
9
|
"files": [
|
|
10
10
|
"android/src/main/",
|
|
11
|
+
"android/src/facebookStubs/",
|
|
11
12
|
"android/build.gradle",
|
|
12
13
|
"dist/",
|
|
13
14
|
"ios/Sources",
|