@capgo/capacitor-social-login 8.3.36 → 8.3.37
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/README.md +1 -0
- package/android/build.gradle +9 -7
- package/android/src/facebookDisabled/java/ee/forgr/capacitor/social/login/FacebookProvider.java +62 -0
- package/android/src/main/java/ee/forgr/capacitor/social/login/SocialLoginPlugin.java +1 -1
- package/ios/Sources/SocialLoginPlugin/SocialLoginPlugin.swift +1 -1
- package/package.json +3 -2
- package/android/src/facebookStubs/java/com/facebook/AccessToken.java +0 -65
- package/android/src/facebookStubs/java/com/facebook/CallbackManager.java +0 -23
- package/android/src/facebookStubs/java/com/facebook/FacebookCallback.java +0 -11
- package/android/src/facebookStubs/java/com/facebook/FacebookException.java +0 -24
- package/android/src/facebookStubs/java/com/facebook/FacebookSdk.java +0 -22
- package/android/src/facebookStubs/java/com/facebook/GraphRequest.java +0 -56
- package/android/src/facebookStubs/java/com/facebook/GraphResponse.java +0 -26
- package/android/src/facebookStubs/java/com/facebook/login/LoginBehavior.java +0 -14
- package/android/src/facebookStubs/java/com/facebook/login/LoginManager.java +0 -48
- package/android/src/facebookStubs/java/com/facebook/login/LoginResult.java +0 -28
- /package/android/src/{main → facebookEnabled}/java/ee/forgr/capacitor/social/login/FacebookProvider.java +0 -0
package/README.md
CHANGED
|
@@ -114,6 +114,7 @@ export default config;
|
|
|
114
114
|
- **Important**: Disabling a provider (`false`) will make it unavailable at runtime, regardless of whether it actually adds any dependencies. The provider will be disabled even if it uses only system APIs.
|
|
115
115
|
- This configuration only affects iOS and Android platforms; it does not affect the web platform.
|
|
116
116
|
- **Important**: Using `false` means the dependency won't be bundled, but the plugin code still compiles against it. Ensure the consuming app includes the dependency if needed.
|
|
117
|
+
- **Facebook**: When `facebook: false`, the Facebook SDK is omitted and the plugin compiles a provider stub in its own package — no `com.facebook.*` classes are shipped (avoids privacy-scanner false positives).
|
|
117
118
|
- Apple Sign-In on Android uses OAuth flow without external SDK dependencies
|
|
118
119
|
- Twitter uses standard OAuth 2.0 flow without external SDK dependencies
|
|
119
120
|
|
package/android/build.gradle
CHANGED
|
@@ -46,11 +46,14 @@ android {
|
|
|
46
46
|
targetCompatibility JavaVersion.VERSION_21
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
//
|
|
49
|
+
// Compile either the real Facebook SDK provider or a plugin-namespace stub.
|
|
50
|
+
// Disabled builds must not ship com.facebook.* classes (privacy scanners).
|
|
50
51
|
sourceSets {
|
|
51
52
|
main {
|
|
52
|
-
if (includeFacebook
|
|
53
|
-
java.srcDirs += 'src/
|
|
53
|
+
if (includeFacebook == 'true') {
|
|
54
|
+
java.srcDirs += 'src/facebookEnabled/java'
|
|
55
|
+
} else {
|
|
56
|
+
java.srcDirs += 'src/facebookDisabled/java'
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
}
|
|
@@ -101,14 +104,13 @@ dependencies {
|
|
|
101
104
|
exclude group: 'androidx.browser', module: 'browser'
|
|
102
105
|
}
|
|
103
106
|
}
|
|
104
|
-
|
|
107
|
+
|
|
105
108
|
// Facebook dependencies
|
|
106
|
-
// When Facebook is disabled,
|
|
109
|
+
// When Facebook is disabled, FacebookProvider from src/facebookDisabled is used instead
|
|
107
110
|
if (includeFacebook == 'true') {
|
|
108
111
|
implementation 'com.facebook.android:facebook-login:18.1.3'
|
|
109
112
|
}
|
|
110
|
-
// When includeFacebook != 'true', no Facebook SDK
|
|
111
|
-
// and the stub classes provide the necessary API for compilation
|
|
113
|
+
// When includeFacebook != 'true', no Facebook SDK and no com.facebook.* stubs
|
|
112
114
|
|
|
113
115
|
// Apple dependencies
|
|
114
116
|
if (appleDependencyType == 'compileOnly') {
|
package/android/src/facebookDisabled/java/ee/forgr/capacitor/social/login/FacebookProvider.java
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
package ee.forgr.capacitor.social.login;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import ee.forgr.capacitor.social.login.helpers.SocialProvider;
|
|
7
|
+
import org.json.JSONArray;
|
|
8
|
+
import org.json.JSONObject;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Compile-time stub used when Facebook is disabled via provider pinning
|
|
12
|
+
* ({@code socialLogin.facebook.include=false}).
|
|
13
|
+
* <p>
|
|
14
|
+
* Lives in the plugin package (not {@code com.facebook.*}) so disabled builds
|
|
15
|
+
* ship zero Facebook Login class signatures for privacy scanners.
|
|
16
|
+
*/
|
|
17
|
+
public class FacebookProvider implements SocialProvider {
|
|
18
|
+
|
|
19
|
+
private static final String DISABLED_MESSAGE =
|
|
20
|
+
"Facebook provider is disabled. Dependencies are not available. Ensure Facebook Login dependencies are included in your app's build.gradle";
|
|
21
|
+
|
|
22
|
+
public FacebookProvider(Activity activity) {
|
|
23
|
+
// Stub - activity unused
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public void initialize(JSONObject config) {
|
|
27
|
+
throw new RuntimeException(DISABLED_MESSAGE);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Override
|
|
31
|
+
public void login(PluginCall call, JSONObject config) {
|
|
32
|
+
call.reject(DISABLED_MESSAGE);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@Override
|
|
36
|
+
public void logout(PluginCall call) {
|
|
37
|
+
call.reject(DISABLED_MESSAGE);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public void getAuthorizationCode(PluginCall call) {
|
|
42
|
+
call.reject(DISABLED_MESSAGE);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Override
|
|
46
|
+
public void isLoggedIn(PluginCall call) {
|
|
47
|
+
call.reject(DISABLED_MESSAGE);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@Override
|
|
51
|
+
public void refresh(PluginCall call) {
|
|
52
|
+
call.reject(DISABLED_MESSAGE);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public boolean handleOnActivityResult(int requestCode, int resultCode, Intent data) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public void getProfile(JSONArray fieldsArray, PluginCall call) {
|
|
60
|
+
call.reject(DISABLED_MESSAGE);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -24,7 +24,7 @@ import org.json.JSONObject;
|
|
|
24
24
|
@CapacitorPlugin(name = "SocialLogin")
|
|
25
25
|
public class SocialLoginPlugin extends Plugin {
|
|
26
26
|
|
|
27
|
-
private final String pluginVersion = "8.3.
|
|
27
|
+
private final String pluginVersion = "8.3.37";
|
|
28
28
|
|
|
29
29
|
public static String LOG_TAG = "CapgoSocialLogin";
|
|
30
30
|
public HashMap<String, SocialProvider> socialProviderHashMap = new HashMap<>();
|
|
@@ -16,7 +16,7 @@ import GoogleSignIn
|
|
|
16
16
|
*/
|
|
17
17
|
@objc(SocialLoginPlugin)
|
|
18
18
|
public class SocialLoginPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
19
|
-
private let pluginVersion: String = "8.3.
|
|
19
|
+
private let pluginVersion: String = "8.3.37"
|
|
20
20
|
public let identifier = "SocialLoginPlugin"
|
|
21
21
|
public let jsName = "SocialLogin"
|
|
22
22
|
private static let userCancelledCode = "USER_CANCELLED"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-social-login",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.37",
|
|
4
4
|
"description": "All social logins in one plugin",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"unpkg": "dist/plugin.js",
|
|
9
9
|
"files": [
|
|
10
10
|
"android/src/main/",
|
|
11
|
-
"android/src/
|
|
11
|
+
"android/src/facebookEnabled/",
|
|
12
|
+
"android/src/facebookDisabled/",
|
|
12
13
|
"android/build.gradle",
|
|
13
14
|
"dist/",
|
|
14
15
|
"ios/Sources",
|
|
@@ -1,65 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
boolean onActivityResult(int requestCode, int resultCode, Intent data);
|
|
11
|
-
|
|
12
|
-
class Factory {
|
|
13
|
-
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
|
|
18
|
-
public String getErrorMessage() {
|
|
19
|
-
return "Facebook SDK is not available (stub)";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public Exception getException() {
|
|
23
|
-
return new FacebookException("Facebook SDK is not available (stub)");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
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(
|
|
29
|
-
ActivityResultRegistryOwner activityResultRegistryOwner,
|
|
30
|
-
CallbackManager callbackManager,
|
|
31
|
-
Collection<String> permissions
|
|
32
|
-
) {
|
|
33
|
-
// Stub - no-op
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public void logIn(
|
|
37
|
-
ActivityResultRegistryOwner activityResultRegistryOwner,
|
|
38
|
-
CallbackManager callbackManager,
|
|
39
|
-
Collection<String> permissions,
|
|
40
|
-
String nonce
|
|
41
|
-
) {
|
|
42
|
-
// Stub - no-op
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public void logOut() {
|
|
46
|
-
// Stub - no-op
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
|
|
24
|
-
public String getToken() {
|
|
25
|
-
return "";
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
File without changes
|