Skip to content

Commit 6c0b1d0

Browse files
authored
chore: update example to rn 0.72 (#896)
* chore: Update Example app to RN 0.72 * chore: add changeset * test: fix tests by ignoring Example directory * chore: Improve iOS openURL handler
1 parent 129f047 commit 6c0b1d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1460
-1458
lines changed

.changeset/smart-gifts-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-app-auth': patch
3+
---
4+
5+
Update the Example app to RN 0.72

Example/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
3+
extends: '@react-native',
44
};

Example/.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

Example/.gitignore

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23+
ios/.xcode.env.local
2324

2425
# Android/IntelliJ
2526
#
@@ -28,32 +29,38 @@ build/
2829
.gradle
2930
local.properties
3031
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
3136

3237
# node.js
3338
#
3439
node_modules/
3540
npm-debug.log
3641
yarn-error.log
3742

38-
# BUCK
39-
buck-out/
40-
\.buckd/
41-
*.keystore
42-
!debug.keystore
43-
4443
# fastlane
4544
#
4645
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
4746
# screenshots whenever they are needed.
4847
# For more information about the recommended setup visit:
4948
# https://docs.fastlane.tools/best-practices/source-control/
5049

51-
*/fastlane/report.xml
52-
*/fastlane/Preview.html
53-
*/fastlane/screenshots
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
5454

5555
# Bundle artifact
5656
*.jsbundle
5757

58-
# CocoaPods
58+
# Ruby / CocoaPods
5959
/ios/Pods/
60+
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage

Example/.prettierrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
24
bracketSpacing: false,
3-
jsxBracketSameLine: true,
45
singleQuote: true,
56
trailingComma: 'all',
67
};

Example/.watchmanconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

Example/App.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {useState, useCallback, useMemo} from 'react';
2-
import {UIManager, Alert} from 'react-native';
2+
import {Alert} from 'react-native';
33
import {
44
authorize,
55
refresh,
@@ -64,27 +64,24 @@ const App = () => {
6464
});
6565
}, []);
6666

67-
const handleAuthorize = useCallback(
68-
async provider => {
69-
try {
70-
const config = configs[provider];
71-
const newAuthState = await authorize({
72-
...config,
73-
connectionTimeoutSeconds: 5,
74-
iosPrefersEphemeralSession: true
75-
});
67+
const handleAuthorize = useCallback(async provider => {
68+
try {
69+
const config = configs[provider];
70+
const newAuthState = await authorize({
71+
...config,
72+
connectionTimeoutSeconds: 5,
73+
iosPrefersEphemeralSession: true,
74+
});
7675

77-
setAuthState({
78-
hasLoggedInOnce: true,
79-
provider: provider,
80-
...newAuthState,
81-
});
82-
} catch (error) {
83-
Alert.alert('Failed to log in', error.message);
84-
}
85-
},
86-
[authState],
87-
);
76+
setAuthState({
77+
hasLoggedInOnce: true,
78+
provider: provider,
79+
...newAuthState,
80+
});
81+
} catch (error) {
82+
Alert.alert('Failed to log in', error.message);
83+
}
84+
}, []);
8885

8986
const handleRefresh = useCallback(async () => {
9087
try {

Example/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
gem 'cocoapods', '~> 1.12'

Example/__tests__/App.test.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../App';
8+
9+
// Note: import explicitly to use the types shiped with jest.
10+
import {it} from '@jest/globals';
11+
12+
// Note: test renderer must be required after react-native.
13+
import renderer from 'react-test-renderer';
14+
15+
it('renders correctly', () => {
16+
renderer.create(<App />);
17+
});

Example/_bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

0 commit comments

Comments
 (0)