Skip to content

Commit 51cfc6e

Browse files
Changed ActivityResult requestCode to be a value different than 0 (#641)
Changed ActivityResult requestCode to be a value different than 0, as this can cause some unforeseen issues.
1 parent 7f46adc commit 51cfc6e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

android/src/main/java/com/rnappauth/RNAppAuthModule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ public void onFetchConfigurationCompleted(
394394
*/
395395
@Override
396396
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
397-
if (requestCode == 0) {
397+
if (requestCode == 52) {
398398
if (data == null) {
399399
if (promise != null) {
400400
promise.reject("authentication_error", "Data intent is null" );
@@ -592,10 +592,10 @@ private void authorizeWithConfiguration(
592592
AuthorizationService authService = new AuthorizationService(context, appAuthConfiguration);
593593
Intent authIntent = authService.getAuthorizationRequestIntent(authRequest);
594594

595-
currentActivity.startActivityForResult(authIntent, 0);
595+
currentActivity.startActivityForResult(authIntent, 52);
596596
} else {
597597
AuthorizationService authService = new AuthorizationService(currentActivity, appAuthConfiguration);
598-
PendingIntent pendingIntent = currentActivity.createPendingResult(0, new Intent(), 0);
598+
PendingIntent pendingIntent = currentActivity.createPendingResult(52, new Intent(), 0);
599599

600600
authService.performAuthorizationRequest(authRequest, pendingIntent);
601601
}

0 commit comments

Comments
 (0)