Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@stytch/stytch-react-native
Advanced tools
noteId: "531c04906b2111ebb150c5c7eebb2104" tags: []
Requirements for iOS:
The minimum deployment target needs to be at least 12.0 Required react-native version 0.60.x+
npm install @stytch/stytch-react-native
--save or
yarn add @stytch/stytch-react-native
Update the Stytch pod with:
cd ios
pod install
pod update
You need to register your app scheme for deep link handling. Open Target -> Info tab -> URL Types, add a new one with your URL Scheme which is used in Stytch configuration (the same scheme used when sending configureWithProjectId
function param scheme
)
Add this import after import UIKit
line
import Stytch
Add these lines to the bottom of AppDelegate.swift
file
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { return Stytch.shared.handleMagicLinkUrl(userActivity.webpageURL) }
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { return Stytch.shared.handleMagicLinkUrl(url) }
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { return Stytch.shared.handleMagicLinkUrl(url) }
Add this import after #import "AppDelegate.h"
line
#import <Stytch/Stytch.h>
Add these lines to the bottom of AppDelegate.m
file
(BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id> * _Nullable))restorationHandler { return [Stytch.shared handleMagicLinkUrl: userActivity.webpageURL]; }
(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { return [Stytch.shared handleMagicLinkUrl: url]; }
(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [Stytch.shared handleMagicLinkUrl: url]; }
Configure the flow let projectId = "XXXXXX" let secretKey = "XXXXXX"
StytchSdk.configureWithProjectId(projectId, secretKey, "schema", "https://stytch.com/v1/") StytchSdk.onSuccess(res => { console.log("onSuccess", res) })
StytchSdk.onFailure(res => { console.log("onFailure", res) })
StytchSdk.onEvent(res => { console.log("onEvent", res) }) StytchSdk.onMagicLinkSent(res => { console.log("onMagicLinkSent", res) })
StytchSdk.onDeepLinkHandled(res => { console.log("onDeepLinkHandled", res) })
StytchSdk.showUI()
// StytchSdk.closeUI() // when you want to close the default Stytch UI
Customizing UI (if using showUI) StytchSdk.showTitle(true) StytchSdk.showBrandLogo(false) StytchSdk.showSubtitle(true) StytchSdk.inputCornerRadius(10) StytchSdk.buttonCornerRadius(5) StytchSdk.titleStyle({ size: 20, font: 'ArialHebrew-Bold', color: "#ffffff" }) StytchSdk.subtitleStyle({ size: 20, font: 'ArialHebrew-Bold', color: "#ffffff" }) StytchSdk.inputTextStyle({ size: 20, font: 'ArialHebrew-Bold', color: "#ffffff" }) StytchSdk.inputPlaceholderStyle({ size: 20, font: 'ArialHebrew-Bold', color: "#ffffff" }) StytchSdk.buttonTextStyle({ size: 20, font: 'ArialHebrew-Bold', color: "#ffffff" })
StytchSdk.inputBackgroundColor("#aaaaaa") StytchSdk.inputBorderColor("#aaaaaa") StytchSdk.buttonBackgroundColor("#aaaaaa") StytchSdk.backgroundColor("#aaaaaa")
More in-depth reference of functionalities: https://github.com/stytchauth/stytch-ios-example
Add this in your AndroidManifest.xml. For StytchUI ACTIVITY_NAME = "com.stytch.sdk.ui.StytchMainActivity" - if using the default stytch UI
android:host="stytch.com" />More in-depth reference of functionalities: https://github.com/stytchauth/stytch-android-example
ReactNative example repo: https://github.com/stytchauth/stytch-react-native-example
FAQs
stytch-react-native with AndroidX support
The npm package @stytch/stytch-react-native receives a total of 0 weekly downloads. As such, @stytch/stytch-react-native popularity was classified as not popular.
We found that @stytch/stytch-react-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.