File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
android/app/src/main/java/com/zulipmobile/notifications Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -43,19 +43,18 @@ internal class NotificationsModule(reactContext: ReactApplicationContext) :
43
43
// that's #3838.
44
44
@ReactMethod
45
45
fun googlePlayServicesAvailability (promise : Promise ) {
46
- val result = Arguments .createMap()
47
46
val googleApiAvailability = GoogleApiAvailability .getInstance()
48
47
49
48
// https://developers.google.com/android/reference/com/google/android/gms/common/GoogleApiAvailability#isGooglePlayServicesAvailable(android.content.Context)
50
49
val connectionResult = ConnectionResult (
51
50
googleApiAvailability.isGooglePlayServicesAvailable(reactApplicationContext))
52
- result.putInt( " errorCode " , connectionResult.errorCode)
53
- result.putString( " errorMessage " , connectionResult.errorMessage)
54
- result.putBoolean( " hasResolution " , connectionResult.hasResolution() )
55
- result.putBoolean( " isSuccess " , connectionResult.isSuccess )
56
-
57
- // Keep return value in sync with the Flow type on the JS side.
58
- promise.resolve(result )
51
+ promise.resolve( Arguments .createMap(). apply {
52
+ // Keep return value in sync with the Flow type on the JS side.
53
+ putInt( " errorCode " , connectionResult.errorCode )
54
+ putString( " errorMessage " , connectionResult.errorMessage )
55
+ putBoolean( " hasResolution " , connectionResult.hasResolution())
56
+ putBoolean( " isSuccess " , connectionResult.isSuccess)
57
+ } )
59
58
}
60
59
61
60
/* *
You can’t perform that action at this time.
0 commit comments