Comments (3)
cc @louischan-oursky
Notes for RN iOS:
Prerequisites
- Enable Authgear OAuth Feature
Setup
-
Install
@authgear/react-native
and@react-native-community/async-storage
packagesyarn add @authgear/react-native -S yarn add @react-native-community/async-storage -S
cd ios pod install
-
Add a URL scheme to your iOS project (iOS 10 or below)
- Open
ios/{project}.xcworkspace
- Under {project} -> {target} ->
info
tab ->URL types
section - Press '+' button
- TBC
- Open
-
Setup
UIApplicationDelegate
withAGAuthgearReactNative
bridge- Open
ios/{project}.xcworkspace
- Under
AppDelegate.m
, add... #import <authgear-react-native/AGAuthgearReactNative.h> ... - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options: (NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options { return [AGAuthgearReactNative application:app openURL:url options:options]; } - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [AGAuthgearReactNative application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; } - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler: (void (^)(NSArray<id<UIUserActivityRestoring>> *_Nullable)) restorationHandler { return [AGAuthgearReactNative application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; }
- Open
Get Started
const container = new ReactNativeContainer();
container.configure({
clientID: '{client_id}',
endpoint: 'https://localhost:3000',
});
const authorizeOptions = {
redirectURI: {redirect_uri}
};
const authResponse = await container.authorize(authorizeOptions);
console.log(authResponse.userInfo);
from docs.
@louischan-oursky
Notes:
-
iOS 11 or above: No need to setup URL scheme and app delegate
-
iOS 10:
application:openURL:options:
andapplication:continueUserActivity:restorationHandler:
-
iOS 9:
application:openURL:sourceApplication:annotation:
andapplication:continueUserActivity:restorationHandler:
-
React native 0.63 drop iOS 9 support
from docs.
iOS 11 or above: No need to setup URL scheme and app delegate
Any details?
from docs.
Related Issues (20)
- Update docs to reference new authentication settings
- Deadlink and missing Xamarin SDK mention in development setup
- In nginx reverse proxy doc, specify the link/port to use in nginx conf
- Improve the doc based on use cases
- Add `fetchUserInfo` example to the SDKs setup doc
- Document how to use LAPolicy
- Document admin api new user attributes
- Document the script specification in docs
- Newer Android SDK requires `android:exported="true"` to be explicitly set HOT 1
- Doc for x_application_type is missing in authgear.yaml reference
- Add example for extracting admin API private key from authgear.secrets.yaml
- Flutter doc AndroidManifest.xml inline comment error HOT 1
- Add all node types in admin api doc HOT 3
- Provide examples for decoding access token in Node.js
- Wechat RN SSO doc still using `authorize` method when it is updated to `authenticate` HOT 1
- Document the updated revoke session webhook event HOT 1
- Examples and more detailed description on Audit log HOT 3
- Update Passkey compatibility description HOT 3
- Provide examples for including user attributes in JWT HOT 1
- Update graphql example to use fix value
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.