diff --git a/README.md b/README.md index 823d5652..4497a859 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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** diff --git a/ios/RNAppAuth.m b/ios/RNAppAuth.m index fa81e194..18d57b95 100644 --- a/ios/RNAppAuth.m +++ b/ios/RNAppAuth.m @@ -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]; } /* diff --git a/ios/RNAppAuth.podspec b/ios/RNAppAuth.podspec deleted file mode 100644 index eba81933..00000000 --- a/ios/RNAppAuth.podspec +++ /dev/null @@ -1,20 +0,0 @@ - -Pod::Spec.new do |s| - s.name = "RNAppAuth" - s.version = "1.0.0" - s.summary = "RNAppAuth" - s.description = <<-DESC - RNAppAuth - DESC - s.homepage = "https://github.com/FormidableLabs/react-native-app-auth" - s.license = "MIT" - s.license = { :type => "MIT", :file => "../LICENSE" } - s.author = { "author" => "kadi.kraman@formidable.com" } - s.platform = :ios, "7.0" - s.source = { :git => "https://github.com/FormidableLabs/react-native-app-auth.git", :tag => "master" } - s.source_files = "**/*.{h,m}" - s.requires_arc = true - - s.dependency "React" - s.dependency "AppAuth", "0.94.0" -end diff --git a/react-native-app-auth.podspec b/react-native-app-auth.podspec index 56ab1e40..fd069b68 100644 --- a/react-native-app-auth.podspec +++ b/react-native-app-auth.podspec @@ -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