Skip to content

Commit c0aba79

Browse files
committed
Android works ok
1 parent b817b34 commit c0aba79

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

android/src/main/java/com/tsauthentication/TsAuthenticationModule.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package com.tsauthentication;
2+
23
import androidx.annotation.NonNull;
34
import com.facebook.react.bridge.Promise;
45
import com.facebook.react.bridge.ReactApplicationContext;
@@ -40,7 +41,6 @@ public String getName() {
4041
if(reactContext.getCurrentActivity() != null) {
4142
TSAuthentication.initialize(
4243
reactContext,
43-
baseUrl,
4444
clientId
4545
);
4646
promise.resolve(true);
@@ -76,12 +76,12 @@ private void continueRegistration(String username, String displayName, Promise p
7676
@Override
7777
public void success(RegistrationResult registrationResult) {
7878
WritableMap map = new WritableNativeMap();
79-
map.putString(registrationResult.result(), NAME);
79+
map.putString("result",registrationResult.result());
8080
promise.resolve(map);
8181
}
8282
@Override
8383
public void error(TSWebAuthnRegistrationError tsWebAuthnRegistrationError) {
84-
promise.reject(NAME, tsWebAuthnRegistrationError.toString());
84+
promise.reject("result", tsWebAuthnRegistrationError.getEM());
8585
}
8686
}
8787
);
@@ -99,12 +99,12 @@ public void error(TSWebAuthnRegistrationError tsWebAuthnRegistrationError) {
9999
@Override
100100
public void success(AuthenticationResult authenticationResult) {
101101
WritableMap map = new WritableNativeMap();
102-
map.putString(authenticationResult.result(), NAME);
102+
map.putString("result", authenticationResult.result());
103103
promise.resolve(map);
104104
}
105105
@Override
106106
public void error(TSWebAuthnAuthenticationError tsWebAuthnAuthenticationError) {
107-
promise.reject(NAME, tsWebAuthnAuthenticationError.toString());
107+
promise.reject("result", tsWebAuthnAuthenticationError.toString());
108108
}
109109
});
110110
}
@@ -121,13 +121,13 @@ public void error(TSWebAuthnAuthenticationError tsWebAuthnAuthenticationError) {
121121
@Override
122122
public void success(AuthenticationResult authenticationResult) {
123123
WritableMap map = new WritableNativeMap();
124-
map.putString(authenticationResult.result(), NAME);
124+
map.putString("result", authenticationResult.result());
125125
promise.resolve(map);
126126
}
127127

128128
@Override
129129
public void error(TSWebAuthnAuthenticationError tsWebAuthnAuthenticationError) {
130-
promise.reject(NAME, tsWebAuthnAuthenticationError.toString());
130+
promise.reject("result", tsWebAuthnAuthenticationError.toString());
131131
}
132132
}
133133
);
@@ -150,7 +150,7 @@ public void success(DeviceInfo deviceInfo) {
150150

151151
@Override
152152
public void error(TSDeviceInfoError tsDeviceInfoError) {
153-
promise.reject(NAME, tsDeviceInfoError.toString());
153+
promise.reject("result", tsDeviceInfoError.toString());
154154
}
155155
}
156156
);

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ android {
7575

7676
namespace "com.tsauthenticationexample"
7777
defaultConfig {
78-
applicationId "com.transmitsecurity.authsdk_rn_example"
78+
applicationId "com.tsauthenticationexample"
7979
minSdkVersion rootProject.ext.minSdkVersion
8080
targetSdkVersion rootProject.ext.targetSdkVersion
8181
versionCode 1

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<action android:name="android.intent.action.MAIN" />
2121
<category android:name="android.intent.category.LAUNCHER" />
2222
</intent-filter>
23+
<meta-data android:name="asset_statements" android:resource="@string/asset_statements" />
2324
</activity>
2425
</application>
2526
</manifest>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
<resources>
22
<string name="app_name">TsAuthenticationExample</string>
3+
<string name="asset_statements" translatable="false">
4+
[{
5+
\"include\": \"https://mobile.idsec-dev.com/.well-known/assetlinks.json\"
6+
}]
7+
</string>
38
</resources>

0 commit comments

Comments
 (0)