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

Cordova #223

Merged
merged 46 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
211f9a6
Cordova support
kober32 Sep 2, 2024
7e1d385
Added rest of iOS files + better TS module export
kober32 Sep 2, 2024
9cb1732
Implemented rest of moduels in TS
kober32 Sep 2, 2024
dd85eb1
Fixed iOS testapp project
kober32 Sep 2, 2024
a205035
iOS/JS fixes
kober32 Sep 4, 2024
d52fcb3
Exporting all objects
kober32 Sep 4, 2024
01aaf6a
Not using tsbuild for cordova
kober32 Sep 4, 2024
915584c
Exporting typings
kober32 Sep 4, 2024
7ada869
Removing todos
kober32 Sep 4, 2024
d78302c
Set version to 0.1.0
kober32 Sep 5, 2024
3710010
Added cordova test app
kober32 Sep 5, 2024
6687781
Removed forgotten logs
kober32 Sep 5, 2024
1cc31cf
Improvements
kober32 Sep 5, 2024
718e2ef
Cordova build actions (#200)
kober32 Sep 10, 2024
0bc73ac
Develop -> cordova (#202)
kober32 Sep 11, 2024
3f95c80
Improve testapp-cordova scripts
TomasKypta Sep 6, 2024
5133018
Fix cordova app author
TomasKypta Sep 6, 2024
6a113d1
Update .gitignore in testapp-cordova
TomasKypta Sep 6, 2024
9f3bb70
Improved docs (#203)
kober32 Sep 12, 2024
0658cde
Refactor android code to separate React-specific code
TomasKypta Sep 18, 2024
c96ebac
Update test app scripts
TomasKypta Sep 18, 2024
5f94613
Fix Android warnings
TomasKypta Sep 18, 2024
1dc7d0d
Move manifest package to namespace
TomasKypta Sep 18, 2024
f1d81b2
Add basis of cordova implementation
TomasKypta Sep 25, 2024
6acf2bd
Updated plugin xml
kober32 Sep 25, 2024
5f748a5
Resolve most of compilation errors
TomasKypta Sep 25, 2024
e9d2a5c
Fixed tests
kober32 Sep 26, 2024
ca351f9
Fix compile errors
TomasKypta Sep 26, 2024
efab512
Fix CORS issue
TomasKypta Sep 27, 2024
1376f24
Fix Android cleartext error
TomasKypta Sep 30, 2024
df4719c
Fix some Cordova Android bugs
TomasKypta Oct 1, 2024
4e21b38
Fix Cordova Android bugs and tests
TomasKypta Oct 1, 2024
71e2810
Clean Cordova map and array implementations
TomasKypta Oct 2, 2024
e78a5d5
Improve Cordova Android scripts
TomasKypta Oct 2, 2024
9dd9923
Refactor Android's Dynamic type implementation
TomasKypta Oct 2, 2024
e62fc1b
Remove dev logs from Cordova Android
TomasKypta Oct 2, 2024
5b8605a
Fix Android warnings in Cordova
TomasKypta Oct 2, 2024
319f5d2
Merge branch 'cordova' into cordova-android-01
TomasKypta Oct 2, 2024
a44915b
Fix Cordova iOS
TomasKypta Oct 3, 2024
8e984c4
Improve build scripts
TomasKypta Oct 3, 2024
d031491
Add handling of DEBUG for Cordova
TomasKypta Oct 3, 2024
cba48ea
Merge pull request #210 from wultra/cordova-android-01
TomasKypta Oct 3, 2024
481ea3a
Prepare Cordova beta 0.2.0 (#211)
TomasKypta Oct 4, 2024
a1f1209
Cordova improvements - preparation for merge (#220)
kober32 Jan 15, 2025
f5b36a1
fix(ios): fix testapp buildability by upgrading to latest RN 0.71 patch
c0mtru1se Jan 28, 2025
fd381a8
Merge branch 'develop' into cordova
kober32 Jan 28, 2025
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
21 changes: 21 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Prepare PowerAuth JS environment

inputs:
env-file:
description: Contents of the testapp/.env file
required: false
default: "empty"

runs:
using: composite
steps:
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
shell: bash
run: npm i
- name: Set .env file
shell: bash
run: echo -e "${{ inputs.env-file }}" > testapp/.env
20 changes: 20 additions & 0 deletions .github/workflows/build-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build

on:
push:
branches:
- develop
- release/*
pull_request:

jobs:
build-library:
name: Build and Pack the Library
runs-on: macos-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepare
- name: Library build
run: npm run build
74 changes: 0 additions & 74 deletions .github/workflows/build.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/publish.yml

This file was deleted.

20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# PowerAuth SDK for React Native Mobile Apps
# PowerAuth Mobile JS SDK

[![npm](https://img.shields.io/npm/v/react-native-powerauth-mobile-sdk)](https://www.npmjs.com/package/react-native-powerauth-mobile-sdk) ![license](https://img.shields.io/github/license/wultra/react-native-powerauth-mobile-sdk) ![released](https://img.shields.io/github/release-date/wultra/react-native-powerauth-mobile-sdk)

In order to connect to the [PowerAuth](https://www.wultra.com/mobile-security-suite) service, mobile applications need to perform the required network and cryptographic processes, as described in the PowerAuth documentation. To simplify the implementation of these processes, developers can use React Native library (for Android and iOS) from this repository.
In order to connect to the [PowerAuth](https://www.wultra.com/mobile-security-suite) service, mobile applications need to perform the required network and cryptographic processes, as described in the PowerAuth documentation. To simplify the implementation of these processes, developers can use This PowerAuth JS SDK library (for Android and iOS) from this repository.

> [!NOTE]
> We currently support __REACT NATIVE__ and __APACHE CORDOVA__ development platforms.

## Documentation

The documentation is available at the [Wultra Developer Portal](https://developers.wultra.com/components/react-native-powerauth-mobile-sdk/) or inside the [docs](docs) folder.

## Support and compatibility

| Version | React-Native<sup>1</sup> | Native SDK | Server version | Support Status |
|---------|-----------------|--------------|----------------|-------------------|
| `2.5.x` | `0.73+` | `1.7.x` | `0.24+` | Fully supported |
| `2.4.x` | `0.71+` | `1.7.x` | `0.24+` | Security bugfixes |
| `2.3.x` | `0.64` - `0.70` | `1.7.x` | `0.24+` | Security bugfixes |
| `2.2.x` | | `1.6.x` | `0.24+` | Not supported |
| Version | React-Native<sup>1</sup> | Cordova | Native SDK | Server version | Support Status |
|---------|--------------------------|-----------|--------------|----------------|-------------------|
| `3.0.x` | `0.73+` | `12.0.0+` | `1.7.x` | `0.24+` | Fully supported |
| `2.5.x` | `0.73+` | - | `1.7.x` | `0.24+` | Security bugfixes |
| `2.4.x` | `0.71+` | - | `1.7.x` | `0.24+` | Security bugfixes |
| `2.3.x` | `0.64` - `0.70` | - | `1.7.x` | `0.24+` | Not supported |
| `2.2.x` | | - | `1.6.x` | `0.24+` | Not supported |

<!-- begin box info -->
> Note 1: The library may also work with other React-Native versions but we don't guarantee compatibility. The specified version is the version that we use for the development and for the tests.
Expand Down
7 changes: 5 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ext {
//
// Defaults for the standalone build
//
PowerAuthSdkRN_kotlinVersion = "1.7.0"

PowerAuthSdkRN_kotlinVersion = "1.9.22"
PowerAuthSdkRN_minSdkVersion = 21
PowerAuthSdkRN_targetSdkVersion = 33
PowerAuthSdkRN_compileSdkVersion = 33
Expand All @@ -26,6 +26,7 @@ def isNewArchitectureEnabled() {
}

apply plugin: "com.android.library"
apply plugin: "org.jetbrains.kotlin.android"

if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
Expand All @@ -40,6 +41,7 @@ def getExtOrIntegerDefault(name) {
}

android {
namespace = "com.wultra.android.powerauth.reactnative"
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")

defaultConfig {
Expand Down Expand Up @@ -69,6 +71,7 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
api "com.wultra.android.powerauth:powerauth-sdk:1.7.10"

if (project == rootProject) {
Expand Down
4 changes: 2 additions & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.wultra.android.powerauth.reactnative">
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.wultra.android.powerauth.bridge

import android.content.Context

// point to React bridge
typealias Arguments = com.facebook.react.bridge.Arguments
typealias Dynamic = com.facebook.react.bridge.Dynamic
typealias Promise = com.facebook.react.bridge.Promise
typealias ReactMethod = com.facebook.react.bridge.ReactMethod
typealias ReadableArray = com.facebook.react.bridge.ReadableArray
typealias ReadableMap = com.facebook.react.bridge.ReadableMap
typealias ReadableType = com.facebook.react.bridge.ReadableType
typealias WritableArray = com.facebook.react.bridge.WritableArray
typealias WritableMap = com.facebook.react.bridge.WritableMap



// bridge to concrete platform implementation
typealias BuildConfig = com.wultra.android.powerauth.reactnative.BuildConfig
typealias PwBuildConfig = com.wultra.android.powerauth.bridge.ReactPwBuildConfig

object ReactPwBuildConfig {
fun isDebuggable(context: Context) = BuildConfig.DEBUG
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.wultra.android.powerauth.js

import android.app.Activity

/**
* Module aware of the activity.
*/
interface ActivityAwareModule {

fun getCurrentActivity(): Activity
}

/**
* Provider of activity.
*/
interface ActivityProvider {
fun getActivity(): Activity
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.wultra.android.powerauth.js

/**
* Module base.
*/
public interface BaseJavaJsModule {

fun getName(): String
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.wultra.android.powerauth.reactnative;
package com.wultra.android.powerauth.js;

class Constants {
/**
Expand Down
Loading