-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
5,766 additions
and
4,669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,16 @@ Proof Key for Code Exchange (PKCE) challenge generator for React Native. | |
|Node.js |🟢 | ||
|
||
## Installation | ||
### New Arch | ||
```bash | ||
yarn add react-native-pkce-challenge | ||
npx pod-install ios # iOS Only | ||
npx pod-install macos # macOS Only | ||
npx pod-install | ||
``` | ||
|
||
### Old Arch | ||
```bash | ||
yarn add [email protected] | ||
npx pod-install | ||
``` | ||
|
||
## Usage | ||
|
@@ -60,4 +66,8 @@ See [UPGRADING.md](UPGRADING.md) | |
See [CHANGELOGS.md](CHANGELOGS.md) | ||
|
||
## License | ||
Copyright © 2023 David Angulo, released under the MIT license, see [LICENSE](LICENSE). | ||
Copyright © 2024 David Angulo, released under the MIT license, see [LICENSE](LICENSE). | ||
|
||
--- | ||
|
||
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
android/src/main/java/com/pkcechallenge/PkceChallengeModule.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
android/src/main/java/com/pkcechallenge/PkceChallengeModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.pkcechallenge | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.module.annotations.ReactModule | ||
|
||
import java.security.SecureRandom | ||
import android.util.Base64 | ||
|
||
@ReactModule(name = PkceChallengeModule.NAME) | ||
class PkceChallengeModule(reactContext: ReactApplicationContext) : | ||
NativePkceChallengeSpec(reactContext) { | ||
|
||
override fun getName(): String { | ||
return NAME | ||
} | ||
|
||
// Example method | ||
// See https://reactnative.dev/docs/native-modules-android | ||
override fun getRandomBase64String(byteLength: Double): String { | ||
val bytes = ByteArray(byteLength.toInt()) | ||
val secureRandom = SecureRandom() | ||
secureRandom.nextBytes(bytes) | ||
|
||
return Base64.encodeToString(bytes, Base64.NO_WRAP) | ||
} | ||
|
||
companion object { | ||
const val NAME = "PkceChallenge" | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
android/src/main/java/com/pkcechallenge/PkceChallengePackage.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
android/src/main/java/com/pkcechallenge/PkceChallengePackage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.pkcechallenge | ||
|
||
import com.facebook.react.TurboReactPackage | ||
import com.facebook.react.bridge.NativeModule | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.module.model.ReactModuleInfo | ||
import com.facebook.react.module.model.ReactModuleInfoProvider | ||
import java.util.HashMap | ||
|
||
class PkceChallengePackage : TurboReactPackage() { | ||
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { | ||
return if (name == PkceChallengeModule.NAME) { | ||
PkceChallengeModule(reactContext) | ||
} else { | ||
null | ||
} | ||
} | ||
|
||
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider { | ||
return ReactModuleInfoProvider { | ||
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap() | ||
moduleInfos[PkceChallengeModule.NAME] = ReactModuleInfo( | ||
PkceChallengeModule.NAME, | ||
PkceChallengeModule.NAME, | ||
false, // canOverrideExistingModule | ||
false, // needsEagerInit | ||
true, // hasConstants | ||
false, // isCxxModule | ||
true // isTurboModule | ||
) | ||
moduleInfos | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
presets: [['module:react-native-builder-bob/babel-preset', { modules: 'commonjs' }]], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.