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

Upgrade AppAuth-iOS to 1.0.0 #338

Merged
merged 6 commits into from
Jun 28, 2019
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
57 changes: 20 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,41 +183,8 @@ const result = await revoke(config, {

```sh
npm install react-native-app-auth --save
react-native link react-native-app-auth
```

**Then follow the [Setup](#setup) steps to configure the native iOS and Android projects.**

If you are not using `react-native link`, perform the [Manual installation](#manual-installation)
steps instead.

### Manual installation

#### iOS

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-app-auth` and add `RNAppAuth.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNAppAuth.a` to your project's
`Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<

#### Android

1. Open up `android/app/src/main/java/[...]/MainApplication.java`

* Add `import com.rnappauth.RNAppAuthPackage;` to the imports at the top of the file
* Add `new RNAppAuthPackage()` to the list returned by the `getPackages()` method

2. Append the following lines to `android/settings.gradle`:
```
include ':react-native-app-auth'
project(':react-native-app-auth').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-app-auth/android')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-app-auth')
```

## Setup

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

1. **CocoaPods**

With [CocoaPods](https://guides.cocoapods.org/using/getting-started.html), add the following line to
your `Podfile`:
**RN<0.60**:

```sh
react-native link react-native-app-auth
```

With [CocoaPods](https://guides.cocoapods.org/using/getting-started.html), add the following line to
your `Podfile`:

```sh
pod 'AppAuth', '>= 0.94'
```

Then run `pod install`.

pod 'AppAuth', '>= 0.94'
**RN>=0.60**:
With React Native 0.60 and later, linking of pods is done automatically

Then run `pod install`. Note that version 0.94 is the first of the library to support iOS 11.
```sh
cd ios
pod install
```

2. **Carthage**

Expand Down
4 changes: 2 additions & 2 deletions ios/RNAppAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ + (nullable NSString *)codeChallengeS256ForVerifier:(NSString *)codeVerifier {
// generates the code_challenge per spec https://tools.ietf.org/html/rfc7636#section-4.2
// code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))
// NB. the ASCII conversion on the code_verifier entropy was done at time of generation.
NSData *sha265Verifier = [OIDTokenUtilities sha265:codeVerifier];
return [OIDTokenUtilities encodeBase64urlNoPadding:sha265Verifier];
NSData *sha256Verifier = [OIDTokenUtilities sha256:codeVerifier];
return [OIDTokenUtilities encodeBase64urlNoPadding:sha256Verifier];
}

/*
Expand Down
20 changes: 0 additions & 20 deletions ios/RNAppAuth.podspec

This file was deleted.

11 changes: 5 additions & 6 deletions react-native-app-auth.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ Pod::Spec.new do |s|
s.version = package['version']
s.summary = package['description']
s.license = package['license']

s.authors = package['author']
s.homepage = package['homepage']
s.platform = :ios, "9.0"

s.source = { :git => "https://github.com/FormidableLabs/react-native-app-auth.git" }
s.source_files = "ios/**/*.{h,m}"

s.platform = :ios, '9.0'
s.source = { :git => 'https://github.com/FormidableLabs/react-native-app-auth.git' }
s.source_files = 'ios/**/*.{h,m}'
s.requires_arc = true
s.dependency 'React'
s.dependency 'AppAuth', '1.0.0'
end