File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
android/src/main/java/com/reactlibrary Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 11package com .reactlibrary ;
22
33import android .app .Activity ;
4+ import android .app .PendingIntent ;
45import android .content .Context ;
56import android .content .Intent ;
67import android .net .Uri ;
@@ -277,9 +278,18 @@ private void authorizeWithConfiguration(
277278 }
278279
279280 AuthorizationRequest authRequest = authRequestBuilder .build ();
280- AuthorizationService authService = new AuthorizationService (context , appAuthConfiguration );
281- Intent authIntent = authService .getAuthorizationRequestIntent (authRequest );
282- currentActivity .startActivityForResult (authIntent , 0 );
281+
282+ if (android .os .Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .LOLLIPOP ) {
283+ AuthorizationService authService = new AuthorizationService (context , appAuthConfiguration );
284+ Intent authIntent = authService .getAuthorizationRequestIntent (authRequest );
285+
286+ currentActivity .startActivityForResult (authIntent , 0 );
287+ } else {
288+ AuthorizationService authService = new AuthorizationService (currentActivity , appAuthConfiguration );
289+ PendingIntent pendingIntent = currentActivity .createPendingResult (0 , new Intent (), 0 );
290+
291+ authService .performAuthorizationRequest (authRequest , pendingIntent );
292+ }
283293 }
284294
285295 /*
You can’t perform that action at this time.
0 commit comments