Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR-17648 - Session management improvements and Native library upgrade #37

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions FronteggRN.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Pod::Spec.new do |s|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
if respond_to?(:install_modules_dependencies, true)
install_modules_dependencies(s)
s.dependency "FronteggSwift", "1.2.16"
s.dependency "FronteggSwift", "1.2.18"
else
s.dependency "React-Core"
s.dependency "FronteggSwift", "1.2.16"
s.dependency "FronteggSwift", "1.2.18"

# Don't install the dependencies when we run `pod install` in the old architecture.
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,11 @@ To log in with frontegg you can use the `useAuth` hook:

```tsx
import { View, Button } from 'react-native';
import { useAuth } from '@frontegg/react-native';
import { useAuth, login, logout } from '@frontegg/react-native';


export function MyScreen() {
const { isAuthenticated, login, logout } = useAuth();
const { isAuthenticated } = useAuth();

return <View>
<Button title={'Login'} onPress={login} />
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.browser:browser:1.5.0"
implementation 'io.reactivex.rxjava3:rxkotlin:3.0.1'
implementation 'com.frontegg.sdk:android:1.2.18'
implementation 'com.frontegg.sdk:android:1.2.23'
implementation 'com.google.code.gson:gson:2.10.1'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
reactContext.addActivityEventListener(activityEventListener)
fronteggConstants = reactContext.fronteggConstants



FronteggApp.init(
fronteggConstants.baseUrl,
fronteggConstants.clientId,
Expand Down Expand Up @@ -164,7 +166,7 @@ class FronteggRNModule(val reactContext: ReactApplicationContext) :
}

@ReactMethod
fun directLoginAction(type: String, data: String, ephemeralSession:Boolean, promise: Promise) {
fun directLoginAction(type: String, data: String, ephemeralSession: Boolean, promise: Promise) {
val activity = currentActivity
FronteggAuth.instance.directLoginAction(activity!!, type, data)
promise.resolve(true)
Expand Down
10 changes: 5 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ PODS:
- React-jsi (= 0.72.1)
- ReactCommon/turbomodule/core (= 0.72.1)
- fmt (6.2.1)
- FronteggRN (1.2.4):
- FronteggSwift (= 1.2.16)
- FronteggRN (1.2.5):
- FronteggSwift (= 1.2.18)
- RCT-Folly (= 2021.07.22.00)
- React-Core
- FronteggSwift (1.2.16)
- FronteggSwift (1.2.18)
- glog (0.3.5)
- hermes-engine (0.72.1):
- hermes-engine/Pre-built (= 0.72.1)
Expand Down Expand Up @@ -584,8 +584,8 @@ SPEC CHECKSUMS:
FBLazyVector: 55cd4593d570bd9e5e227488d637ce6a9581ce51
FBReactNativeSpec: 799b0e1a1561699cd0e424e24fe5624da38402f0
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
FronteggRN: 4529b26513ca97509a34dbd59c1ff41ddcd56fba
FronteggSwift: 7041ff82d1924e9be39a7c4db02cb2e8a1eb229a
FronteggRN: 402b3a01e68ebf39c7a9edcde3b320cf72d5080d
FronteggSwift: 321b0399468d237948bb9c5e53aacedb82c0f980
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 9df83855a0fd15ef8eb61694652bae636b0c466e
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"@frontegg/types": "^6.171.0",
"@frontegg/types": "^7.7.0",
"@react-native-async-storage/async-storage": "^1.19.0"
},
"devDependencies": {
Expand Down
5 changes: 1 addition & 4 deletions src/FronteggWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import React, { type ReactNode, useEffect, useState } from 'react';
import type { FronteggAppOptions } from '@frontegg/types';
import type { FC } from 'react';
import type { FronteggState } from './FronteggContext';
import FronteggContext, { defaultFronteggState } from './FronteggContext';
import { listener } from './FronteggNative';

export const FronteggWrapper: FC<
Omit<FronteggAppOptions, 'contextOptions'> & { children: ReactNode }
> = (props) => {
export const FronteggWrapper: FC<{ children: ReactNode }> = (props) => {
const [state, setState] = useState<FronteggState>(defaultFronteggState);

useEffect(() => {
Expand Down
Loading
Loading