@rownd/react-native 3.0.1 → 3.2.0

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.
Files changed (71) hide show
  1. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  2. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  3. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  4. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
  6. package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  8. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
  10. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  11. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  12. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  13. package/android/build.gradle +1 -1
  14. package/android/src/main/java/com/reactnativerowndplugin/RowndPluginModule.kt +2 -2
  15. package/expo/plugin.js +2 -2
  16. package/ios/RowndPlugin.swift +1 -1
  17. package/lib/commonjs/components/GlobalContext.js +13 -33
  18. package/lib/commonjs/components/GlobalContext.js.map +1 -1
  19. package/lib/commonjs/components/GlobalContext.types.js.map +1 -1
  20. package/lib/commonjs/components/GlobalContext.web.js +4 -10
  21. package/lib/commonjs/components/GlobalContext.web.js.map +1 -1
  22. package/lib/commonjs/components/RequireSignIn.js +10 -20
  23. package/lib/commonjs/components/RequireSignIn.js.map +1 -1
  24. package/lib/commonjs/components/SignedIn.js +4 -13
  25. package/lib/commonjs/components/SignedIn.js.map +1 -1
  26. package/lib/commonjs/components/SignedOut.js +4 -13
  27. package/lib/commonjs/components/SignedOut.js.map +1 -1
  28. package/lib/commonjs/constants/action.js +1 -3
  29. package/lib/commonjs/constants/action.js.map +1 -1
  30. package/lib/commonjs/hooks/rownd.js +2 -4
  31. package/lib/commonjs/hooks/rownd.js.map +1 -1
  32. package/lib/commonjs/hooks/rownd.web.js +4 -4
  33. package/lib/commonjs/hooks/rownd.web.js.map +1 -1
  34. package/lib/commonjs/index.js +0 -6
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/commonjs/reducer/rowndReducer.js +18 -22
  37. package/lib/commonjs/reducer/rowndReducer.js.map +1 -1
  38. package/lib/commonjs/utils/config.js.map +1 -1
  39. package/lib/commonjs/utils/nativeModule.js +3 -21
  40. package/lib/commonjs/utils/nativeModule.js.map +1 -1
  41. package/lib/module/components/GlobalContext.js +7 -17
  42. package/lib/module/components/GlobalContext.js.map +1 -1
  43. package/lib/module/components/GlobalContext.types.js.map +1 -1
  44. package/lib/module/components/GlobalContext.web.js +4 -7
  45. package/lib/module/components/GlobalContext.web.js.map +1 -1
  46. package/lib/module/components/RequireSignIn.js +7 -11
  47. package/lib/module/components/RequireSignIn.js.map +1 -1
  48. package/lib/module/components/SignedIn.js +3 -8
  49. package/lib/module/components/SignedIn.js.map +1 -1
  50. package/lib/module/components/SignedOut.js +3 -8
  51. package/lib/module/components/SignedOut.js.map +1 -1
  52. package/lib/module/constants/action.js +0 -1
  53. package/lib/module/constants/action.js.map +1 -1
  54. package/lib/module/hooks/rownd.js +2 -1
  55. package/lib/module/hooks/rownd.js.map +1 -1
  56. package/lib/module/hooks/rownd.web.js +4 -2
  57. package/lib/module/hooks/rownd.web.js.map +1 -1
  58. package/lib/module/index.js.map +1 -1
  59. package/lib/module/reducer/rowndReducer.js +17 -17
  60. package/lib/module/reducer/rowndReducer.js.map +1 -1
  61. package/lib/module/utils/config.js.map +1 -1
  62. package/lib/module/utils/nativeModule.js +0 -3
  63. package/lib/module/utils/nativeModule.js.map +1 -1
  64. package/lib/typescript/components/GlobalContext.types.d.ts +1 -0
  65. package/lib/typescript/hooks/rownd.d.ts +2 -1
  66. package/package.json +2 -1
  67. package/rownd-react-native.podspec +1 -1
  68. package/src/components/GlobalContext.types.ts +1 -0
  69. package/src/hooks/rownd.ts +3 -1
  70. package/src/hooks/rownd.web.ts +1 -0
  71. package/src/reducer/rowndReducer.ts +2 -0
@@ -4,8 +4,9 @@ export const initialRowndState = {
4
4
  user: {
5
5
  data: {
6
6
  email: null
7
- } // meta: {}
8
-
7
+ },
8
+ isLoading: false
9
+ // meta: {}
9
10
  },
10
11
  auth: {
11
12
  access_token: null,
@@ -15,38 +16,37 @@ export const initialRowndState = {
15
16
  app: {
16
17
  schema: null,
17
18
  config: null
18
- } // is_saving_user_data: false,
19
+ }
20
+ // is_saving_user_data: false,
19
21
  // config,
20
-
21
22
  };
22
23
  export function rowndReducer(state, action) {
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
-
24
+ var _action$payload, _action$payload2, _action$payload3, _action$payload4, _action$payload5, _action$payload6, _action$payload$appCo;
25
25
  let newState;
26
-
27
26
  switch (action.type) {
28
27
  case ActionType.UPDATE_STATE:
29
28
  newState = {
30
29
  user: {
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: {}
34
-
30
+ data: {
31
+ ...((_action$payload = action.payload) === null || _action$payload === void 0 || (_action$payload = _action$payload.user) === null || _action$payload === void 0 ? void 0 : _action$payload.data),
32
+ email: (_action$payload2 = action.payload) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.user) === null || _action$payload2 === void 0 || (_action$payload2 = _action$payload2.data) === null || _action$payload2 === void 0 ? void 0 : _action$payload2.email
33
+ },
34
+ isLoading: Boolean((_action$payload3 = action.payload) === null || _action$payload3 === void 0 || (_action$payload3 = _action$payload3.user) === null || _action$payload3 === void 0 ? void 0 : _action$payload3.isLoading)
35
+ // meta: {}
35
36
  },
36
37
  auth: {
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
38
+ access_token: (_action$payload4 = action.payload) === null || _action$payload4 === void 0 || (_action$payload4 = _action$payload4.auth) === null || _action$payload4 === void 0 ? void 0 : _action$payload4.access_token,
39
+ refresh_token: (_action$payload5 = action.payload) === null || _action$payload5 === void 0 || (_action$payload5 = _action$payload5.auth) === null || _action$payload5 === void 0 ? void 0 : _action$payload5.refresh_token,
40
+ app_id: ((_action$payload6 = action.payload) === null || _action$payload6 === void 0 || (_action$payload6 = _action$payload6.appConfig) === null || _action$payload6 === void 0 ? void 0 : _action$payload6.id) || null
40
41
  },
41
42
  app: {
42
43
  schema: (_action$payload$appCo = action.payload.appConfig) === null || _action$payload$appCo === void 0 ? void 0 : _action$payload$appCo.schema,
43
44
  config: null
44
- } // is_saving_user_data: false,
45
+ }
46
+ // is_saving_user_data: false,
45
47
  // config
46
-
47
48
  };
48
49
  return newState;
49
-
50
50
  default:
51
51
  newState = state;
52
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","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"}
1
+ {"version":3,"names":["ActionType","initialRowndState","user","data","email","isLoading","auth","access_token","refresh_token","app_id","app","schema","config","rowndReducer","state","action","_action$payload","_action$payload2","_action$payload3","_action$payload4","_action$payload5","_action$payload6","_action$payload$appCo","newState","type","UPDATE_STATE","payload","Boolean","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 isLoading: false\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 isLoading: Boolean(action.payload?.user?.isLoading)\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,UAAU,QAAiB,qBAAqB;AAEzD,OAAO,MAAMC,iBAA8B,GAAG;EAC5C;EACAC,IAAI,EAAE;IACJC,IAAI,EAAE;MACJC,KAAK,EAAE;IACT,CAAC;IACDC,SAAS,EAAE;IACX;EACF,CAAC;EACDC,IAAI,EAAE;IACJC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE,IAAI;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,GAAG,EAAE;IACHC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAE;EACV;EACA;EACA;AACF,CAAC;AAED,OAAO,SAASC,YAAYA,CAACC,KAAkB,EAAEC,MAAe,EAAe;EAAA,IAAAC,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,qBAAA;EAC7E,IAAIC,QAAqB;EAEzB,QAAQR,MAAM,CAACS,IAAI;IACjB,KAAKxB,UAAU,CAACyB,YAAY;MAC1BF,QAAQ,GAAG;QACTrB,IAAI,EAAE;UACJC,IAAI,EAAE;YACJ,KAAAa,eAAA,GAAGD,MAAM,CAACW,OAAO,cAAAV,eAAA,gBAAAA,eAAA,GAAdA,eAAA,CAAgBd,IAAI,cAAAc,eAAA,uBAApBA,eAAA,CAAsBb,IAAI;YAC7BC,KAAK,GAAAa,gBAAA,GAAEF,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ey: string;\n apiUrl?: string;\n baseUrl?: string;\n}\n\nexport interface Customizations {\n sheetBackgroundHexColor?: string;\n sheetCornerBorderRadius?: string;\n loadingAnimation?: string;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["config.ts"],"sourcesContent":["export interface IConfig {\n appKey: string;\n apiUrl?: string;\n baseUrl?: string;\n}\n\nexport interface Customizations {\n sheetBackgroundHexColor?: string;\n sheetCornerBorderRadius?: string;\n loadingAnimation?: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -7,13 +7,11 @@ export const Rownd = NativeModules.RowndPlugin ? NativeModules.RowndPlugin : new
7
7
  get() {
8
8
  throw new Error(LINKING_ERROR);
9
9
  }
10
-
11
10
  });
12
11
  export const IOSRowndEventEmitter = Platform.OS !== 'ios' ? null : NativeModules.RowndPluginEventEmitter ? NativeModules.RowndPluginEventEmitter : new Proxy({}, {
13
12
  get() {
14
13
  throw new Error(LINKING_ERROR);
15
14
  }
16
-
17
15
  });
18
16
  export function configure(config) {
19
17
  return Rownd.configure(config);
@@ -27,7 +25,6 @@ export function requestSignIn(config) {
27
25
  method: 'default'
28
26
  });
29
27
  }
30
-
31
28
  return Rownd.requestSignIn({
32
29
  method: config === null || config === void 0 ? void 0 : config.method,
33
30
  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,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,MAAM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AASC,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
+ {"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,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAItD,OAAO,MAAMC,aAAa,GACvB,8EAA6E,GAC9ED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,OAAO,MAAMC,KAAK,GAAGN,aAAa,CAACO,WAAW,GAC1CP,aAAa,CAACO,WAAW,GACzB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,MAAMS,oBAAoB,GAC/BV,QA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C;AAEA,OAAO,SAASC,gBAAgBA,CAACC,GAAW,EAAEC,KAAU,EAAE;EACxD,OAAOvB,KAAK,CAACqB,gBAAgB,CAC3BC,GAAG,EACH3B,QAAQ,CAACW,EAAE,KAAK,SAAS,GAAG;IAAEiB;EAAM,CAAC,GAAGA,KAC1C,CAAC;AACH;AAEA,OAAO,SAASC,WAAWA,CAACC,IAAyB,EAAE;EACrD,OAAOzB,KAAK,CAACwB,WAAW,CAACC,IAAI,CAAC;AAChC;AAEA,OAAO,SAASC,gBAAgBA,CAACC,GAAW,EAAE;EAC5C,OAAO3B,KAAK,CAAC0B,gBAAgB,CAACC,GAAG,CAAC;AACpC","ignoreList":[]}
@@ -14,6 +14,7 @@ export declare type GlobalState = {
14
14
  email?: string | null;
15
15
  [key: string]: any;
16
16
  };
17
+ isLoading: boolean;
17
18
  };
18
19
  auth: {
19
20
  access_token: string | null;
@@ -14,13 +14,14 @@ export declare type TRowndContext = {
14
14
  };
15
15
  declare type UserContext = {
16
16
  data: {
17
- id?: string;
17
+ user_id?: string;
18
18
  email?: string | null;
19
19
  phone?: string | null;
20
20
  [key: string]: any;
21
21
  };
22
22
  set: (data: Record<string, any>) => void;
23
23
  setValue: (key: string, value: any) => void;
24
+ isLoading: boolean;
24
25
  };
25
26
  declare type AuthContext = {
26
27
  access_token: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rownd/react-native",
3
- "version": "3.0.1",
3
+ "version": "3.2.0",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -61,6 +61,7 @@
61
61
  "eslint": "^8.4.1",
62
62
  "eslint-config-prettier": "^8.5.0",
63
63
  "eslint-plugin-prettier": "^4.0.0",
64
+ "expo": "^50.0.17",
64
65
  "jest": "^28.1.1",
65
66
  "pod-install": "^0.1.0",
66
67
  "prettier": "^2.0.5",
@@ -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", "~> 3.0.1"
20
+ s.dependency "Rownd", "~> 3.7.0"
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
@@ -26,6 +26,7 @@ export type GlobalState = {
26
26
  email?: string | null;
27
27
  [key: string]: any;
28
28
  };
29
+ isLoading: boolean;
29
30
  // needs_refresh?: boolean;
30
31
  // redacted: string[];
31
32
  };
@@ -26,13 +26,14 @@ export type TRowndContext = {
26
26
 
27
27
  type UserContext = {
28
28
  data: {
29
- id?: string;
29
+ user_id?: string;
30
30
  email?: string | null;
31
31
  phone?: string | null;
32
32
  [key: string]: any;
33
33
  };
34
34
  set: (data: Record<string, any>) => void;
35
35
  setValue: (key: string, value: any) => void;
36
+ isLoading: boolean;
36
37
  };
37
38
 
38
39
  type AuthContext = {
@@ -64,6 +65,7 @@ export function useRownd(): TRowndContext {
64
65
  data: state.user.data,
65
66
  setValue: setUserDataValue,
66
67
  set: setUserData,
68
+ isLoading: state.user.isLoading
67
69
  },
68
70
  };
69
71
  }
@@ -35,6 +35,7 @@ export function useRownd(): TRowndContext {
35
35
  data: user.data,
36
36
  setValue: setUserValue,
37
37
  set: setUser,
38
+ isLoading: false // Waiting for react sdk update
38
39
  },
39
40
  };
40
41
  }
@@ -7,6 +7,7 @@ export const initialRowndState: GlobalState = {
7
7
  data: {
8
8
  email: null,
9
9
  },
10
+ isLoading: false
10
11
  // meta: {}
11
12
  },
12
13
  auth: {
@@ -33,6 +34,7 @@ export function rowndReducer(state: GlobalState, action: TAction): GlobalState {
33
34
  ...action.payload?.user?.data,
34
35
  email: action.payload?.user?.data?.email,
35
36
  },
37
+ isLoading: Boolean(action.payload?.user?.isLoading)
36
38
  // meta: {}
37
39
  },
38
40
  auth: {