@rownd/react-native 2.11.3 → 2.11.5
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 +93 -15
- package/app.plugin.js +3 -0
- package/expo/plugin.js +39 -0
- package/lib/commonjs/components/GlobalContext.js +27 -8
- package/lib/commonjs/components/GlobalContext.js.map +1 -1
- package/lib/commonjs/components/GlobalContext.web.js +5 -0
- package/lib/commonjs/components/GlobalContext.web.js.map +1 -1
- package/lib/commonjs/components/RequireSignIn.js +16 -7
- package/lib/commonjs/components/RequireSignIn.js.map +1 -1
- package/lib/commonjs/components/SignedIn.js +9 -1
- package/lib/commonjs/components/SignedIn.js.map +1 -1
- package/lib/commonjs/components/SignedOut.js +9 -1
- package/lib/commonjs/components/SignedOut.js.map +1 -1
- package/lib/commonjs/constants/action.js +3 -1
- package/lib/commonjs/constants/action.js.map +1 -1
- package/lib/commonjs/hooks/rownd.js +4 -1
- package/lib/commonjs/hooks/rownd.js.map +1 -1
- package/lib/commonjs/hooks/rownd.web.js +3 -2
- package/lib/commonjs/hooks/rownd.web.js.map +1 -1
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/reducer/rowndReducer.js +21 -19
- package/lib/commonjs/reducer/rowndReducer.js.map +1 -1
- package/lib/commonjs/utils/nativeModule.js +21 -3
- package/lib/commonjs/utils/nativeModule.js.map +1 -1
- package/lib/module/components/GlobalContext.js +11 -2
- package/lib/module/components/GlobalContext.js.map +1 -1
- package/lib/module/components/GlobalContext.web.js +2 -0
- package/lib/module/components/GlobalContext.web.js.map +1 -1
- package/lib/module/components/RequireSignIn.js +6 -3
- package/lib/module/components/RequireSignIn.js.map +1 -1
- package/lib/module/components/SignedIn.js +4 -0
- package/lib/module/components/SignedIn.js.map +1 -1
- package/lib/module/components/SignedOut.js +4 -0
- package/lib/module/components/SignedOut.js.map +1 -1
- package/lib/module/constants/action.js +1 -0
- package/lib/module/constants/action.js.map +1 -1
- package/lib/module/hooks/rownd.js +1 -1
- package/lib/module/hooks/rownd.js.map +1 -1
- package/lib/module/hooks/rownd.web.js +1 -2
- package/lib/module/hooks/rownd.web.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/reducer/rowndReducer.js +17 -19
- package/lib/module/reducer/rowndReducer.js.map +1 -1
- package/lib/module/utils/nativeModule.js +3 -0
- package/lib/module/utils/nativeModule.js.map +1 -1
- package/lib/typescript/{src/components → components}/RequireSignIn.d.ts +3 -3
- package/package.json +3 -1
- package/rownd-react-native.podspec +1 -1
- package/src/components/RequireSignIn.tsx +4 -4
- package/src/hooks/rownd.ts +1 -1
- package/src/reducer/rowndReducer.ts +1 -1
- package/lib/typescript/example_expo/src/App.d.ts +0 -1
- /package/lib/typescript/{src/components → components}/GlobalContext.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/GlobalContext.types.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/GlobalContext.web.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/SignedIn.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/SignedOut.d.ts +0 -0
- /package/lib/typescript/{src/constants → constants}/action.d.ts +0 -0
- /package/lib/typescript/{src/hooks → hooks}/rownd.d.ts +0 -0
- /package/lib/typescript/{src/hooks → hooks}/rownd.web.d.ts +0 -0
- /package/lib/typescript/{src/index.d.ts → index.d.ts} +0 -0
- /package/lib/typescript/{src/reducer → reducer}/rowndReducer.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/config.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/nativeModule.d.ts +0 -0
|
@@ -4,10 +4,9 @@ export const initialRowndState = {
|
|
|
4
4
|
user: {
|
|
5
5
|
data: {
|
|
6
6
|
email: null
|
|
7
|
-
}
|
|
8
|
-
// meta: {}
|
|
9
|
-
},
|
|
7
|
+
} // meta: {}
|
|
10
8
|
|
|
9
|
+
},
|
|
11
10
|
auth: {
|
|
12
11
|
access_token: null,
|
|
13
12
|
refresh_token: null,
|
|
@@ -16,39 +15,38 @@ export const initialRowndState = {
|
|
|
16
15
|
app: {
|
|
17
16
|
schema: null,
|
|
18
17
|
config: null
|
|
19
|
-
}
|
|
20
|
-
// is_saving_user_data: false,
|
|
18
|
+
} // is_saving_user_data: false,
|
|
21
19
|
// config,
|
|
22
|
-
};
|
|
23
20
|
|
|
21
|
+
};
|
|
24
22
|
export function rowndReducer(state, action) {
|
|
25
|
-
var _action$payload, _action$payload2, _action$payload3, _action$payload4, _action$payload$appCo;
|
|
23
|
+
var _action$payload, _action$payload$user, _action$payload2, _action$payload2$user, _action$payload2$user2, _action$payload3, _action$payload3$auth, _action$payload4, _action$payload4$auth, _action$payload5, _action$payload5$appC, _action$payload$appCo;
|
|
24
|
+
|
|
26
25
|
let newState;
|
|
26
|
+
|
|
27
27
|
switch (action.type) {
|
|
28
28
|
case ActionType.UPDATE_STATE:
|
|
29
29
|
newState = {
|
|
30
30
|
user: {
|
|
31
|
-
data: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
// meta: {}
|
|
36
|
-
},
|
|
31
|
+
data: { ...((_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : (_action$payload$user = _action$payload.user) === null || _action$payload$user === void 0 ? void 0 : _action$payload$user.data),
|
|
32
|
+
email: (_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : (_action$payload2$user = _action$payload2.user) === null || _action$payload2$user === void 0 ? void 0 : (_action$payload2$user2 = _action$payload2$user.data) === null || _action$payload2$user2 === void 0 ? void 0 : _action$payload2$user2.email
|
|
33
|
+
} // meta: {}
|
|
37
34
|
|
|
35
|
+
},
|
|
38
36
|
auth: {
|
|
39
|
-
access_token: (_action$payload3 = action.payload) === null || _action$payload3 === void 0
|
|
40
|
-
refresh_token: (_action$payload4 = action.payload) === null || _action$payload4 === void 0
|
|
41
|
-
app_id: null
|
|
37
|
+
access_token: (_action$payload3 = action.payload) === null || _action$payload3 === void 0 ? void 0 : (_action$payload3$auth = _action$payload3.auth) === null || _action$payload3$auth === void 0 ? void 0 : _action$payload3$auth.access_token,
|
|
38
|
+
refresh_token: (_action$payload4 = action.payload) === null || _action$payload4 === void 0 ? void 0 : (_action$payload4$auth = _action$payload4.auth) === null || _action$payload4$auth === void 0 ? void 0 : _action$payload4$auth.refresh_token,
|
|
39
|
+
app_id: ((_action$payload5 = action.payload) === null || _action$payload5 === void 0 ? void 0 : (_action$payload5$appC = _action$payload5.appConfig) === null || _action$payload5$appC === void 0 ? void 0 : _action$payload5$appC.id) || null
|
|
42
40
|
},
|
|
43
41
|
app: {
|
|
44
42
|
schema: (_action$payload$appCo = action.payload.appConfig) === null || _action$payload$appCo === void 0 ? void 0 : _action$payload$appCo.schema,
|
|
45
43
|
config: null
|
|
46
|
-
}
|
|
47
|
-
// is_saving_user_data: false,
|
|
44
|
+
} // is_saving_user_data: false,
|
|
48
45
|
// config
|
|
49
|
-
};
|
|
50
46
|
|
|
47
|
+
};
|
|
51
48
|
return newState;
|
|
49
|
+
|
|
52
50
|
default:
|
|
53
51
|
newState = state;
|
|
54
52
|
return newState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ActionType","initialRowndState","user","data","email","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","
|
|
1
|
+
{"version":3,"names":["ActionType","initialRowndState","user","data","email","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","newState","type","UPDATE_STATE","payload","appConfig","id"],"sources":["rowndReducer.ts"],"sourcesContent":["import type { GlobalState } from '../components/GlobalContext.types';\nimport { ActionType, TAction } from '../constants/action';\n\nexport const initialRowndState: GlobalState = {\n // is_initializing: false,\n user: {\n data: {\n email: null,\n },\n // meta: {}\n },\n auth: {\n access_token: null,\n refresh_token: null,\n app_id: null,\n },\n app: {\n schema: null,\n config: null,\n },\n // is_saving_user_data: false,\n // config,\n};\n\nexport function rowndReducer(state: GlobalState, action: TAction): GlobalState {\n let newState: GlobalState;\n\n switch (action.type) {\n case ActionType.UPDATE_STATE:\n newState = {\n user: {\n data: {\n ...action.payload?.user?.data,\n email: action.payload?.user?.data?.email,\n },\n // meta: {}\n },\n auth: {\n access_token: action.payload?.auth?.access_token,\n refresh_token: action.payload?.auth?.refresh_token,\n app_id: action.payload?.appConfig?.id || null,\n },\n app: {\n schema: action.payload.appConfig?.schema,\n config: null,\n },\n // is_saving_user_data: false,\n // config\n };\n return newState;\n default:\n newState = state;\n return newState;\n }\n}\n"],"mappings":"AACA,SAASA,UAAT,QAAoC,qBAApC;AAEA,OAAO,MAAMC,iBAA8B,GAAG;EAC5C;EACAC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,KAAK,EAAE;IADH,CADF,CAIJ;;EAJI,CAFsC;EAQ5CC,IAAI,EAAE;IACJC,YAAY,EAAE,IADV;IAEJC,aAAa,EAAE,IAFX;IAGJC,MAAM,EAAE;EAHJ,CARsC;EAa5CC,GAAG,EAAE;IACHC,MAAM,EAAE,IADL;IAEHC,MAAM,EAAE;EAFL,CAbuC,CAiB5C;EACA;;AAlB4C,CAAvC;AAqBP,OAAO,SAASC,YAAT,CAAsBC,KAAtB,EAA0CC,MAA1C,EAAwE;EAAA;;EAC7E,IAAIC,QAAJ;;EAEA,QAAQD,MAAM,CAACE,IAAf;IACE,KAAKhB,UAAU,CAACiB,YAAhB;MACEF,QAAQ,GAAG;QACTb,IAAI,EAAE;UACJC,IAAI,EAAE,EACJ,uBAAGW,MAAM,CAACI,OAAV,4EAAG,gBAAgBhB,IAAnB,yDAAG,qBAAsBC,IAAzB,CADI;YAEJC,KAAK,sBAAEU,MAAM,CAACI,OAAT,8EAAE,iBAAgBhB,IAAlB,oFAAE,sBAAsBC,IAAxB,2DAAE,uBAA4BC;UAF/B,CADF,CAKJ;;QALI,CADG;QAQTC,IAAI,EAAE;UACJC,YAAY,sBAAEQ,MAAM,CAACI,OAAT,8EAAE,iBAAgBb,IAAlB,0DAAE,sBAAsBC,YADhC;UAEJC,aAAa,sBAAEO,MAAM,CAACI,OAAT,8EAAE,iBAAgBb,IAAlB,0DAAE,sBAAsBE,aAFjC;UAGJC,MAAM,EAAE,qBAAAM,MAAM,CAACI,OAAP,+FAAgBC,SAAhB,gFAA2BC,EAA3B,KAAiC;QAHrC,CARG;QAaTX,GAAG,EAAE;UACHC,MAAM,2BAAEI,MAAM,CAACI,OAAP,CAAeC,SAAjB,0DAAE,sBAA0BT,MAD/B;UAEHC,MAAM,EAAE;QAFL,CAbI,CAiBT;QACA;;MAlBS,CAAX;MAoBA,OAAOI,QAAP;;IACF;MACEA,QAAQ,GAAGF,KAAX;MACA,OAAOE,QAAP;EAzBJ;AA2BD"}
|
|
@@ -7,11 +7,13 @@ export const Rownd = NativeModules.RowndPlugin ? NativeModules.RowndPlugin : new
|
|
|
7
7
|
get() {
|
|
8
8
|
throw new Error(LINKING_ERROR);
|
|
9
9
|
}
|
|
10
|
+
|
|
10
11
|
});
|
|
11
12
|
export const IOSRowndEventEmitter = Platform.OS !== 'ios' ? null : NativeModules.RowndPluginEventEmitter ? NativeModules.RowndPluginEventEmitter : new Proxy({}, {
|
|
12
13
|
get() {
|
|
13
14
|
throw new Error(LINKING_ERROR);
|
|
14
15
|
}
|
|
16
|
+
|
|
15
17
|
});
|
|
16
18
|
export function configure(config) {
|
|
17
19
|
return Rownd.configure(config);
|
|
@@ -25,6 +27,7 @@ export function requestSignIn(config) {
|
|
|
25
27
|
method: 'default'
|
|
26
28
|
});
|
|
27
29
|
}
|
|
30
|
+
|
|
28
31
|
return Rownd.requestSignIn({
|
|
29
32
|
method: config === null || config === void 0 ? void 0 : config.method,
|
|
30
33
|
postSignInRedirect: config === null || config === void 0 ? void 0 : config.postSignInRedirect,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Rownd","RowndPlugin","Proxy","get","Error","IOSRowndEventEmitter","OS","RowndPluginEventEmitter","configure","config","customizations","customizationConfig","requestSignIn","method","postSignInRedirect","intent","signOut","manageAccount","getAccessToken","token","getFirebaseIdToken","setUserDataValue","key","value","setUserData","data","handleSignInLink","url"],"sources":["nativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type { RequestSignIn } from 'src/hooks/rownd';\nimport type { Customizations, IConfig } from './config';\n\nexport const LINKING_ERROR =\n `The package '@rownd/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nexport const Rownd = NativeModules.RowndPlugin\n ? NativeModules.RowndPlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport const IOSRowndEventEmitter =\n Platform.OS !== 'ios'\n ? null\n : NativeModules.RowndPluginEventEmitter\n ? NativeModules.RowndPluginEventEmitter\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function configure(config: IConfig): Promise<string> {\n return Rownd.configure(config);\n}\n\nexport function customizations(customizationConfig: Customizations) {\n return Rownd.customizations(customizationConfig);\n}\n\nexport function requestSignIn(config?: RequestSignIn) {\n if (!config) {\n return Rownd.requestSignIn({ method: 'default' });\n }\n return Rownd.requestSignIn({\n method: config?.method,\n postSignInRedirect: config?.postSignInRedirect,\n intent: config?.intent\n });\n}\n\nexport function signOut() {\n return Rownd.signOut();\n}\n\nexport function manageAccount() {\n return Rownd.manageAccount();\n}\n\nexport function getAccessToken(token?: string): Promise<string> {\n return Rownd.getAccessToken(token || null);\n}\n\nexport function getFirebaseIdToken(): Promise<string> {\n return Rownd.getFirebaseIdToken();\n}\n\nexport function setUserDataValue(key: string, value: any) {\n return Rownd.setUserDataValue(\n key,\n Platform.OS === 'android' ? { value } : value\n );\n}\n\nexport function setUserData(data: Record<string, any>) {\n return Rownd.setUserData(data);\n}\n\nexport function handleSignInLink(url: string) {\n return Rownd.handleSignInLink(url);\n}\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Rownd","RowndPlugin","Proxy","get","Error","IOSRowndEventEmitter","OS","RowndPluginEventEmitter","configure","config","customizations","customizationConfig","requestSignIn","method","postSignInRedirect","intent","signOut","manageAccount","getAccessToken","token","getFirebaseIdToken","setUserDataValue","key","value","setUserData","data","handleSignInLink","url"],"sources":["nativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type { RequestSignIn } from 'src/hooks/rownd';\nimport type { Customizations, IConfig } from './config';\n\nexport const LINKING_ERROR =\n `The package '@rownd/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nexport const Rownd = NativeModules.RowndPlugin\n ? NativeModules.RowndPlugin\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport const IOSRowndEventEmitter =\n Platform.OS !== 'ios'\n ? null\n : NativeModules.RowndPluginEventEmitter\n ? NativeModules.RowndPluginEventEmitter\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function configure(config: IConfig): Promise<string> {\n return Rownd.configure(config);\n}\n\nexport function customizations(customizationConfig: Customizations) {\n return Rownd.customizations(customizationConfig);\n}\n\nexport function requestSignIn(config?: RequestSignIn) {\n if (!config) {\n return Rownd.requestSignIn({ method: 'default' });\n }\n return Rownd.requestSignIn({\n method: config?.method,\n postSignInRedirect: config?.postSignInRedirect,\n intent: config?.intent\n });\n}\n\nexport function signOut() {\n return Rownd.signOut();\n}\n\nexport function manageAccount() {\n return Rownd.manageAccount();\n}\n\nexport function getAccessToken(token?: string): Promise<string> {\n return Rownd.getAccessToken(token || null);\n}\n\nexport function getFirebaseIdToken(): Promise<string> {\n return Rownd.getFirebaseIdToken();\n}\n\nexport function setUserDataValue(key: string, value: any) {\n return Rownd.setUserDataValue(\n key,\n Platform.OS === 'android' ? { value } : value\n );\n}\n\nexport function setUserData(data: Record<string, any>) {\n return Rownd.setUserData(data);\n}\n\nexport function handleSignInLink(url: string) {\n return Rownd.handleSignInLink(url);\n}\n"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAIA,OAAO,MAAMC,aAAa,GACvB,8EAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJK;AAMP,OAAO,MAAMC,KAAK,GAAGN,aAAa,CAACO,WAAd,GACjBP,aAAa,CAACO,WADG,GAEjB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUR,aAAV,CAAN;EACD;;AAHH,CAFF,CAFG;AAWP,OAAO,MAAMS,oBAAoB,GAC/BV,QAAQ,CAACW,EAAT,KAAgB,KAAhB,GACI,IADJ,GAEIZ,aAAa,CAACa,uBAAd,GACAb,aAAa,CAACa,uBADd,GAEA,IAAIL,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUR,aAAV,CAAN;EACD;;AAHH,CAFF,CALC;AAcP,OAAO,SAASY,SAAT,CAAmBC,MAAnB,EAAqD;EAC1D,OAAOT,KAAK,CAACQ,SAAN,CAAgBC,MAAhB,CAAP;AACD;AAED,OAAO,SAASC,cAAT,CAAwBC,mBAAxB,EAA6D;EAClE,OAAOX,KAAK,CAACU,cAAN,CAAqBC,mBAArB,CAAP;AACD;AAED,OAAO,SAASC,aAAT,CAAuBH,MAAvB,EAA+C;EACpD,IAAI,CAACA,MAAL,EAAa;IACX,OAAOT,KAAK,CAACY,aAAN,CAAoB;MAAEC,MAAM,EAAE;IAAV,CAApB,CAAP;EACD;;EACD,OAAOb,KAAK,CAACY,aAAN,CAAoB;IACzBC,MAAM,EAAEJ,MAAF,aAAEA,MAAF,uBAAEA,MAAM,CAAEI,MADS;IAEzBC,kBAAkB,EAAEL,MAAF,aAAEA,MAAF,uBAAEA,MAAM,CAAEK,kBAFH;IAGzBC,MAAM,EAAEN,MAAF,aAAEA,MAAF,uBAAEA,MAAM,CAAEM;EAHS,CAApB,CAAP;AAKD;AAED,OAAO,SAASC,OAAT,GAAmB;EACxB,OAAOhB,KAAK,CAACgB,OAAN,EAAP;AACD;AAED,OAAO,SAASC,aAAT,GAAyB;EAC9B,OAAOjB,KAAK,CAACiB,aAAN,EAAP;AACD;AAED,OAAO,SAASC,cAAT,CAAwBC,KAAxB,EAAyD;EAC9D,OAAOnB,KAAK,CAACkB,cAAN,CAAqBC,KAAK,IAAI,IAA9B,CAAP;AACD;AAED,OAAO,SAASC,kBAAT,GAA+C;EACpD,OAAOpB,KAAK,CAACoB,kBAAN,EAAP;AACD;AAED,OAAO,SAASC,gBAAT,CAA0BC,GAA1B,EAAuCC,KAAvC,EAAmD;EACxD,OAAOvB,KAAK,CAACqB,gBAAN,CACLC,GADK,EAEL3B,QAAQ,CAACW,EAAT,KAAgB,SAAhB,GAA4B;IAAEiB;EAAF,CAA5B,GAAwCA,KAFnC,CAAP;AAID;AAED,OAAO,SAASC,WAAT,CAAqBC,IAArB,EAAgD;EACrD,OAAOzB,KAAK,CAACwB,WAAN,CAAkBC,IAAlB,CAAP;AACD;AAED,OAAO,SAASC,gBAAT,CAA0BC,GAA1B,EAAuC;EAC5C,OAAO3B,KAAK,CAAC0B,gBAAN,CAAuBC,GAAvB,CAAP;AACD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import type { RequestSignIn } from '
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RequestSignIn } from '../hooks/rownd';
|
|
3
3
|
export declare type ContextProps = {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
initializing?: React.ReactNode;
|
|
6
6
|
signInProps?: RequestSignIn;
|
|
7
7
|
};
|
|
8
|
-
declare const RequireSignIn:
|
|
8
|
+
declare const RequireSignIn: React.FC<ContextProps>;
|
|
9
9
|
export default RequireSignIn;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rownd/react-native",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.5",
|
|
4
4
|
"description": "test",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"ios",
|
|
15
15
|
"cpp",
|
|
16
16
|
"rownd-react-native.podspec",
|
|
17
|
+
"expo",
|
|
18
|
+
"app.plugin.js",
|
|
17
19
|
"!lib/typescript/example",
|
|
18
20
|
"!android/build",
|
|
19
21
|
"!ios/build",
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "Rownd", "~> 2.8.
|
|
20
|
+
s.dependency "Rownd", "~> 2.8.2"
|
|
21
21
|
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
23
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { useRownd } from '
|
|
3
|
-
import type { RequestSignIn } from '
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { useRownd } from '../hooks/rownd';
|
|
3
|
+
import type { RequestSignIn } from '../hooks/rownd';
|
|
4
4
|
import { Platform } from 'react-native';
|
|
5
5
|
|
|
6
6
|
export type ContextProps = {
|
|
@@ -9,7 +9,7 @@ export type ContextProps = {
|
|
|
9
9
|
signInProps?: RequestSignIn;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const RequireSignIn:
|
|
12
|
+
const RequireSignIn: React.FC<ContextProps> = ({
|
|
13
13
|
children,
|
|
14
14
|
initializing,
|
|
15
15
|
signInProps,
|
package/src/hooks/rownd.ts
CHANGED
|
@@ -56,7 +56,7 @@ export function useRownd(): TRowndContext {
|
|
|
56
56
|
getIdToken: getFirebaseIdToken,
|
|
57
57
|
},
|
|
58
58
|
is_authenticated: !!state.auth.access_token,
|
|
59
|
-
is_initializing:
|
|
59
|
+
is_initializing: !state.auth.app_id,
|
|
60
60
|
manageAccount,
|
|
61
61
|
requestSignIn,
|
|
62
62
|
signOut,
|
|
@@ -38,7 +38,7 @@ export function rowndReducer(state: GlobalState, action: TAction): GlobalState {
|
|
|
38
38
|
auth: {
|
|
39
39
|
access_token: action.payload?.auth?.access_token,
|
|
40
40
|
refresh_token: action.payload?.auth?.refresh_token,
|
|
41
|
-
app_id: null,
|
|
41
|
+
app_id: action.payload?.appConfig?.id || null,
|
|
42
42
|
},
|
|
43
43
|
app: {
|
|
44
44
|
schema: action.payload.appConfig?.schema,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function App(): JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|