@iternio/react-native-auto-play 0.2.0-alpha.3 → 0.2.0-alpha.6
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/build.gradle +2 -2
- package/android/src/automotive/AndroidManifest.xml +2 -0
- package/android/src/automotive/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutomotive.kt +22 -27
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInWithGoogleActivity.kt +57 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/SignInTemplate.kt +58 -3
- package/android/src/main/res/drawable/google.xml +18 -0
- package/lib/types/SignInMethod.d.ts +18 -2
- package/lib/types/SignInMethod.js +1 -1
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -1
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +2 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_std__string__std__optional_GoogleSignInAccount_.hpp +79 -0
- package/nitrogen/generated/android/c++/JGoogleSignIn.hpp +85 -0
- package/nitrogen/generated/android/c++/JGoogleSignInAccount.hpp +86 -0
- package/nitrogen/generated/android/c++/JHybridSignInTemplateSpec.cpp +10 -1
- package/nitrogen/generated/android/c++/JSignInMethods.hpp +3 -3
- package/nitrogen/generated/android/c++/JSignInTemplateConfig.hpp +10 -5
- package/nitrogen/generated/android/c++/JVariant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.cpp +34 -0
- package/nitrogen/generated/android/c++/{JVariant_QrSignIn_PinSignIn_InputSignIn.hpp → JVariant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.hpp} +40 -20
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__optional_std__string__std__optional_GoogleSignInAccount_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignIn.kt +51 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignInAccount.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInMethods.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInTemplateConfig.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/{Variant_QrSignIn_PinSignIn_InputSignIn.kt → Variant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.kt} +23 -10
- package/nitrogen/generated/shared/c++/GoogleSignIn.hpp +102 -0
- package/nitrogen/generated/shared/c++/GoogleSignInAccount.hpp +112 -0
- package/nitrogen/generated/shared/c++/SignInMethods.hpp +1 -1
- package/nitrogen/generated/shared/c++/SignInTemplateConfig.hpp +8 -5
- package/package.json +1 -1
- package/src/types/SignInMethod.ts +20 -2
- package/nitrogen/generated/android/c++/JVariant_QrSignIn_PinSignIn_InputSignIn.cpp +0 -30
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GoogleSignIn.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `SignInMethods` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class SignInMethods; }
|
|
33
|
+
// Forward declaration of `GoogleSignInAccount` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GoogleSignInAccount; }
|
|
35
|
+
|
|
36
|
+
#include "SignInMethods.hpp"
|
|
37
|
+
#include <string>
|
|
38
|
+
#include <optional>
|
|
39
|
+
#include "GoogleSignInAccount.hpp"
|
|
40
|
+
#include <functional>
|
|
41
|
+
|
|
42
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A struct which can be represented as a JavaScript object (GoogleSignIn).
|
|
46
|
+
*/
|
|
47
|
+
struct GoogleSignIn final {
|
|
48
|
+
public:
|
|
49
|
+
SignInMethods method SWIFT_PRIVATE;
|
|
50
|
+
std::string serverClientId SWIFT_PRIVATE;
|
|
51
|
+
std::function<void(const std::optional<std::string>& /* error */, const std::optional<GoogleSignInAccount>& /* signInAccount */)> callback SWIFT_PRIVATE;
|
|
52
|
+
std::string signInButtonText SWIFT_PRIVATE;
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
GoogleSignIn() = default;
|
|
56
|
+
explicit GoogleSignIn(SignInMethods method, std::string serverClientId, std::function<void(const std::optional<std::string>& /* error */, const std::optional<GoogleSignInAccount>& /* signInAccount */)> callback, std::string signInButtonText): method(method), serverClientId(serverClientId), callback(callback), signInButtonText(signInButtonText) {}
|
|
57
|
+
|
|
58
|
+
public:
|
|
59
|
+
// GoogleSignIn is not equatable because these properties are not equatable: callback
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
63
|
+
|
|
64
|
+
namespace margelo::nitro {
|
|
65
|
+
|
|
66
|
+
// C++ GoogleSignIn <> JS GoogleSignIn (object)
|
|
67
|
+
template <>
|
|
68
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignIn> final {
|
|
69
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignIn fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
70
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
71
|
+
return margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignIn(
|
|
72
|
+
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "method"))),
|
|
73
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serverClientId"))),
|
|
74
|
+
JSIConverter<std::function<void(const std::optional<std::string>&, const std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignInAccount>&)>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "callback"))),
|
|
75
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signInButtonText")))
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignIn& arg) {
|
|
79
|
+
jsi::Object obj(runtime);
|
|
80
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "method"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::toJSI(runtime, arg.method));
|
|
81
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "serverClientId"), JSIConverter<std::string>::toJSI(runtime, arg.serverClientId));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "callback"), JSIConverter<std::function<void(const std::optional<std::string>&, const std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignInAccount>&)>>::toJSI(runtime, arg.callback));
|
|
83
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "signInButtonText"), JSIConverter<std::string>::toJSI(runtime, arg.signInButtonText));
|
|
84
|
+
return obj;
|
|
85
|
+
}
|
|
86
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
87
|
+
if (!value.isObject()) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
jsi::Object obj = value.getObject(runtime);
|
|
91
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "method")))) return false;
|
|
95
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serverClientId")))) return false;
|
|
96
|
+
if (!JSIConverter<std::function<void(const std::optional<std::string>&, const std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignInAccount>&)>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "callback")))) return false;
|
|
97
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signInButtonText")))) return false;
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GoogleSignInAccount.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <optional>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (GoogleSignInAccount).
|
|
40
|
+
*/
|
|
41
|
+
struct GoogleSignInAccount final {
|
|
42
|
+
public:
|
|
43
|
+
std::optional<std::string> serverAuthCode SWIFT_PRIVATE;
|
|
44
|
+
std::optional<std::string> email SWIFT_PRIVATE;
|
|
45
|
+
std::optional<std::string> id SWIFT_PRIVATE;
|
|
46
|
+
std::optional<std::string> displayName SWIFT_PRIVATE;
|
|
47
|
+
std::optional<std::string> photoUrl SWIFT_PRIVATE;
|
|
48
|
+
std::optional<std::string> idToken SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> givenName SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::string> familyName SWIFT_PRIVATE;
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
GoogleSignInAccount() = default;
|
|
54
|
+
explicit GoogleSignInAccount(std::optional<std::string> serverAuthCode, std::optional<std::string> email, std::optional<std::string> id, std::optional<std::string> displayName, std::optional<std::string> photoUrl, std::optional<std::string> idToken, std::optional<std::string> givenName, std::optional<std::string> familyName): serverAuthCode(serverAuthCode), email(email), id(id), displayName(displayName), photoUrl(photoUrl), idToken(idToken), givenName(givenName), familyName(familyName) {}
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
friend bool operator==(const GoogleSignInAccount& lhs, const GoogleSignInAccount& rhs) = default;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
61
|
+
|
|
62
|
+
namespace margelo::nitro {
|
|
63
|
+
|
|
64
|
+
// C++ GoogleSignInAccount <> JS GoogleSignInAccount (object)
|
|
65
|
+
template <>
|
|
66
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignInAccount> final {
|
|
67
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignInAccount fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
68
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
69
|
+
return margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignInAccount(
|
|
70
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serverAuthCode"))),
|
|
71
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "email"))),
|
|
72
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "id"))),
|
|
73
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "displayName"))),
|
|
74
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "photoUrl"))),
|
|
75
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "idToken"))),
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "givenName"))),
|
|
77
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "familyName")))
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignInAccount& arg) {
|
|
81
|
+
jsi::Object obj(runtime);
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "serverAuthCode"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.serverAuthCode));
|
|
83
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "email"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.email));
|
|
84
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "id"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.id));
|
|
85
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "displayName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.displayName));
|
|
86
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "photoUrl"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.photoUrl));
|
|
87
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "idToken"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.idToken));
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "givenName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.givenName));
|
|
89
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "familyName"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.familyName));
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
93
|
+
if (!value.isObject()) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
jsi::Object obj = value.getObject(runtime);
|
|
97
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "serverAuthCode")))) return false;
|
|
101
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "email")))) return false;
|
|
102
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "id")))) return false;
|
|
103
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "displayName")))) return false;
|
|
104
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "photoUrl")))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "idToken")))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "givenName")))) return false;
|
|
107
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "familyName")))) return false;
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
} // namespace margelo::nitro
|
|
@@ -25,7 +25,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
25
25
|
*/
|
|
26
26
|
enum class SignInMethods {
|
|
27
27
|
QR SWIFT_NAME(qr) = 0,
|
|
28
|
-
|
|
28
|
+
GOOGLE SWIFT_NAME(google) = 1,
|
|
29
29
|
PIN SWIFT_NAME(pin) = 2,
|
|
30
30
|
INPUT SWIFT_NAME(input) = 3,
|
|
31
31
|
} CLOSED_ENUM;
|
|
@@ -34,6 +34,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct QrSignIn; }
|
|
|
34
34
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct PinSignIn; }
|
|
35
35
|
// Forward declaration of `InputSignIn` to properly resolve imports.
|
|
36
36
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct InputSignIn; }
|
|
37
|
+
// Forward declaration of `GoogleSignIn` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GoogleSignIn; }
|
|
37
39
|
// Forward declaration of `NitroAction` to properly resolve imports.
|
|
38
40
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroAction; }
|
|
39
41
|
|
|
@@ -43,6 +45,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroAction
|
|
|
43
45
|
#include "QrSignIn.hpp"
|
|
44
46
|
#include "PinSignIn.hpp"
|
|
45
47
|
#include "InputSignIn.hpp"
|
|
48
|
+
#include "GoogleSignIn.hpp"
|
|
46
49
|
#include <variant>
|
|
47
50
|
#include "NitroAction.hpp"
|
|
48
51
|
#include <vector>
|
|
@@ -63,14 +66,14 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
63
66
|
std::optional<double> autoDismissMs SWIFT_PRIVATE;
|
|
64
67
|
std::optional<std::string> title SWIFT_PRIVATE;
|
|
65
68
|
std::optional<std::string> additionalText SWIFT_PRIVATE;
|
|
66
|
-
std::optional<std::variant<QrSignIn, PinSignIn, InputSignIn>> signInMethod SWIFT_PRIVATE;
|
|
69
|
+
std::optional<std::variant<QrSignIn, PinSignIn, InputSignIn, GoogleSignIn>> signInMethod SWIFT_PRIVATE;
|
|
67
70
|
std::optional<std::vector<NitroAction>> headerActions SWIFT_PRIVATE;
|
|
68
71
|
std::optional<std::vector<NitroAction>> actions SWIFT_PRIVATE;
|
|
69
72
|
std::optional<std::string> instructions SWIFT_PRIVATE;
|
|
70
73
|
|
|
71
74
|
public:
|
|
72
75
|
SignInTemplateConfig() = default;
|
|
73
|
-
explicit SignInTemplateConfig(std::string id, std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillAppear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillDisappear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidAppear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidDisappear, std::optional<std::function<void()>> onPopped, std::optional<double> autoDismissMs, std::optional<std::string> title, std::optional<std::string> additionalText, std::optional<std::variant<QrSignIn, PinSignIn, InputSignIn>> signInMethod, std::optional<std::vector<NitroAction>> headerActions, std::optional<std::vector<NitroAction>> actions, std::optional<std::string> instructions): id(id), onWillAppear(onWillAppear), onWillDisappear(onWillDisappear), onDidAppear(onDidAppear), onDidDisappear(onDidDisappear), onPopped(onPopped), autoDismissMs(autoDismissMs), title(title), additionalText(additionalText), signInMethod(signInMethod), headerActions(headerActions), actions(actions), instructions(instructions) {}
|
|
76
|
+
explicit SignInTemplateConfig(std::string id, std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillAppear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillDisappear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidAppear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidDisappear, std::optional<std::function<void()>> onPopped, std::optional<double> autoDismissMs, std::optional<std::string> title, std::optional<std::string> additionalText, std::optional<std::variant<QrSignIn, PinSignIn, InputSignIn, GoogleSignIn>> signInMethod, std::optional<std::vector<NitroAction>> headerActions, std::optional<std::vector<NitroAction>> actions, std::optional<std::string> instructions): id(id), onWillAppear(onWillAppear), onWillDisappear(onWillDisappear), onDidAppear(onDidAppear), onDidDisappear(onDidDisappear), onPopped(onPopped), autoDismissMs(autoDismissMs), title(title), additionalText(additionalText), signInMethod(signInMethod), headerActions(headerActions), actions(actions), instructions(instructions) {}
|
|
74
77
|
|
|
75
78
|
public:
|
|
76
79
|
// SignInTemplateConfig is not equatable because these properties are not equatable: onWillAppear, onWillDisappear, onDidAppear, onDidDisappear, onPopped, signInMethod, headerActions, actions
|
|
@@ -95,7 +98,7 @@ namespace margelo::nitro {
|
|
|
95
98
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoDismissMs"))),
|
|
96
99
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
|
|
97
100
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "additionalText"))),
|
|
98
|
-
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signInMethod"))),
|
|
101
|
+
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignIn>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signInMethod"))),
|
|
99
102
|
JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headerActions"))),
|
|
100
103
|
JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "actions"))),
|
|
101
104
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "instructions")))
|
|
@@ -112,7 +115,7 @@ namespace margelo::nitro {
|
|
|
112
115
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "autoDismissMs"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.autoDismissMs));
|
|
113
116
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
|
|
114
117
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "additionalText"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.additionalText));
|
|
115
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "signInMethod"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn>>>::toJSI(runtime, arg.signInMethod));
|
|
118
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "signInMethod"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignIn>>>::toJSI(runtime, arg.signInMethod));
|
|
116
119
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "headerActions"), JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::toJSI(runtime, arg.headerActions));
|
|
117
120
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "actions"), JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::toJSI(runtime, arg.actions));
|
|
118
121
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "instructions"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.instructions));
|
|
@@ -135,7 +138,7 @@ namespace margelo::nitro {
|
|
|
135
138
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoDismissMs")))) return false;
|
|
136
139
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
|
|
137
140
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "additionalText")))) return false;
|
|
138
|
-
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signInMethod")))) return false;
|
|
141
|
+
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::GoogleSignIn>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "signInMethod")))) return false;
|
|
139
142
|
if (!JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headerActions")))) return false;
|
|
140
143
|
if (!JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "actions")))) return false;
|
|
141
144
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "instructions")))) return false;
|
package/package.json
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
export enum SignInMethods {
|
|
2
2
|
QR = 0,
|
|
3
|
-
|
|
3
|
+
GOOGLE = 1,
|
|
4
4
|
PIN = 2,
|
|
5
5
|
INPUT = 3,
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
export type GoogleSignInAccount = {
|
|
9
|
+
serverAuthCode?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
photoUrl?: string;
|
|
14
|
+
idToken?: string;
|
|
15
|
+
givenName?: string;
|
|
16
|
+
familyName?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type GoogleSignIn = {
|
|
20
|
+
method: SignInMethods.GOOGLE;
|
|
21
|
+
serverClientId: string;
|
|
22
|
+
callback: (error?: string, signInAccount?: GoogleSignInAccount) => void;
|
|
23
|
+
signInButtonText: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
8
26
|
export type PinSignIn = {
|
|
9
27
|
method: SignInMethods.PIN;
|
|
10
28
|
/**
|
|
@@ -38,4 +56,4 @@ export type QrSignIn = {
|
|
|
38
56
|
url: string;
|
|
39
57
|
};
|
|
40
58
|
|
|
41
|
-
export type SignInMethod = QrSignIn | PinSignIn | InputSignIn;
|
|
59
|
+
export type SignInMethod = QrSignIn | PinSignIn | InputSignIn | GoogleSignIn;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JVariant_QrSignIn_PinSignIn_InputSignIn.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "JVariant_QrSignIn_PinSignIn_InputSignIn.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
11
|
-
/**
|
|
12
|
-
* Converts JVariant_QrSignIn_PinSignIn_InputSignIn to std::variant<QrSignIn, PinSignIn, InputSignIn>
|
|
13
|
-
*/
|
|
14
|
-
std::variant<QrSignIn, PinSignIn, InputSignIn> JVariant_QrSignIn_PinSignIn_InputSignIn::toCpp() const {
|
|
15
|
-
if (isInstanceOf(JVariant_QrSignIn_PinSignIn_InputSignIn_impl::First::javaClassStatic())) {
|
|
16
|
-
// It's a `QrSignIn`
|
|
17
|
-
auto jniValue = static_cast<const JVariant_QrSignIn_PinSignIn_InputSignIn_impl::First*>(this)->getValue();
|
|
18
|
-
return jniValue->toCpp();
|
|
19
|
-
} else if (isInstanceOf(JVariant_QrSignIn_PinSignIn_InputSignIn_impl::Second::javaClassStatic())) {
|
|
20
|
-
// It's a `PinSignIn`
|
|
21
|
-
auto jniValue = static_cast<const JVariant_QrSignIn_PinSignIn_InputSignIn_impl::Second*>(this)->getValue();
|
|
22
|
-
return jniValue->toCpp();
|
|
23
|
-
} else if (isInstanceOf(JVariant_QrSignIn_PinSignIn_InputSignIn_impl::Third::javaClassStatic())) {
|
|
24
|
-
// It's a `InputSignIn`
|
|
25
|
-
auto jniValue = static_cast<const JVariant_QrSignIn_PinSignIn_InputSignIn_impl::Third*>(this)->getValue();
|
|
26
|
-
return jniValue->toCpp();
|
|
27
|
-
}
|
|
28
|
-
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
29
|
-
}
|
|
30
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|