Skip to content

Commit f160144

Browse files
author
Kadi Kraman
authored
Upgrade AppAuth-iOS to 1.0.0 (#338)
* Upgrade AppAuth-iOS to 1.0.0 * Add AppAuth dependency in the root level Podspec * Remove duplicate podspec * Keep the root level podspec only * Rename root level podspec to match library name * Update pod install instructions
1 parent 1379494 commit f160144

File tree

4 files changed

+27
-65
lines changed

4 files changed

+27
-65
lines changed

README.md

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -183,41 +183,8 @@ const result = await revoke(config, {
183183

184184
```sh
185185
npm install react-native-app-auth --save
186-
react-native link react-native-app-auth
187186
```
188187

189-
**Then follow the [Setup](#setup) steps to configure the native iOS and Android projects.**
190-
191-
If you are not using `react-native link`, perform the [Manual installation](#manual-installation)
192-
steps instead.
193-
194-
### Manual installation
195-
196-
#### iOS
197-
198-
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
199-
2. Go to `node_modules``react-native-app-auth` and add `RNAppAuth.xcodeproj`
200-
3. In XCode, in the project navigator, select your project. Add `libRNAppAuth.a` to your project's
201-
`Build Phases``Link Binary With Libraries`
202-
4. Run your project (`Cmd+R`)<
203-
204-
#### Android
205-
206-
1. Open up `android/app/src/main/java/[...]/MainApplication.java`
207-
208-
* Add `import com.rnappauth.RNAppAuthPackage;` to the imports at the top of the file
209-
* Add `new RNAppAuthPackage()` to the list returned by the `getPackages()` method
210-
211-
2. Append the following lines to `android/settings.gradle`:
212-
```
213-
include ':react-native-app-auth'
214-
project(':react-native-app-auth').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-app-auth/android')
215-
```
216-
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
217-
```
218-
compile project(':react-native-app-auth')
219-
```
220-
221188
## Setup
222189

223190
### iOS Setup
@@ -238,12 +205,28 @@ AppAuth supports three options for dependency management.
238205

239206
1. **CocoaPods**
240207

241-
With [CocoaPods](https://guides.cocoapods.org/using/getting-started.html), add the following line to
242-
your `Podfile`:
208+
**RN<0.60**:
209+
210+
```sh
211+
react-native link react-native-app-auth
212+
```
213+
214+
With [CocoaPods](https://guides.cocoapods.org/using/getting-started.html), add the following line to
215+
your `Podfile`:
216+
217+
```sh
218+
pod 'AppAuth', '>= 0.94'
219+
```
220+
221+
Then run `pod install`.
243222

244-
pod 'AppAuth', '>= 0.94'
223+
**RN>=0.60**:
224+
With React Native 0.60 and later, linking of pods is done automatically
245225

246-
Then run `pod install`. Note that version 0.94 is the first of the library to support iOS 11.
226+
```sh
227+
cd ios
228+
pod install
229+
```
247230

248231
2. **Carthage**
249232

ios/RNAppAuth.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ + (nullable NSString *)codeChallengeS256ForVerifier:(NSString *)codeVerifier {
159159
// generates the code_challenge per spec https://tools.ietf.org/html/rfc7636#section-4.2
160160
// code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))
161161
// NB. the ASCII conversion on the code_verifier entropy was done at time of generation.
162-
NSData *sha265Verifier = [OIDTokenUtilities sha265:codeVerifier];
163-
return [OIDTokenUtilities encodeBase64urlNoPadding:sha265Verifier];
162+
NSData *sha256Verifier = [OIDTokenUtilities sha256:codeVerifier];
163+
return [OIDTokenUtilities encodeBase64urlNoPadding:sha256Verifier];
164164
}
165165

166166
/*

ios/RNAppAuth.podspec

Lines changed: 0 additions & 20 deletions
This file was deleted.

react-native-app-auth.podspec

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ Pod::Spec.new do |s|
77
s.version = package['version']
88
s.summary = package['description']
99
s.license = package['license']
10-
1110
s.authors = package['author']
1211
s.homepage = package['homepage']
13-
s.platform = :ios, "9.0"
14-
15-
s.source = { :git => "https://github.com/FormidableLabs/react-native-app-auth.git" }
16-
s.source_files = "ios/**/*.{h,m}"
17-
12+
s.platform = :ios, '9.0'
13+
s.source = { :git => 'https://github.com/FormidableLabs/react-native-app-auth.git' }
14+
s.source_files = 'ios/**/*.{h,m}'
15+
s.requires_arc = true
1816
s.dependency 'React'
17+
s.dependency 'AppAuth', '1.0.0'
1918
end

0 commit comments

Comments
 (0)