Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion android/src/main/java/com/samitha/timezone/TimezoneModule.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.samitha.timezone

import android.content.ContentResolver
import android.content.Context
import android.os.Build
import android.provider.Settings
import android.telephony.TelephonyManager
Expand Down Expand Up @@ -54,7 +55,7 @@ class TimezoneModule(reactContext: ReactApplicationContext) :
@ReactMethod(isBlockingSynchronousMethod = true)
override fun getRegionByTelephony(): String? {
return try {
val telephonyService = reactApplicationContext.getSystemService(ReactApplicationContext.TELEPHONY_SERVICE) as? TelephonyManager
val telephonyService = reactApplicationContext.getSystemService(Context.TELEPHONY_SERVICE) as? TelephonyManager
telephonyService?.networkCountryIso
} catch (e: Exception) {
null
Expand Down
Loading