File tree 1 file changed +13
-3
lines changed
android/src/main/java/com/reactlibrary
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
package com .reactlibrary ;
2
2
3
3
import android .app .Activity ;
4
+ import android .app .PendingIntent ;
4
5
import android .content .Context ;
5
6
import android .content .Intent ;
6
7
import android .net .Uri ;
@@ -277,9 +278,18 @@ private void authorizeWithConfiguration(
277
278
}
278
279
279
280
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
+ }
283
293
}
284
294
285
295
/*
You can’t perform that action at this time.
0 commit comments