File tree Expand file tree Collapse file tree
java/ru/ogon/sdk/handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ plugins {
55}
66
77group = ' com.github.ogon-ru'
8- version = ' 1.0.8 '
8+ version = ' 1.0.9 '
99
1010android {
1111 compileSdkVersion 31
@@ -14,8 +14,8 @@ android {
1414 defaultConfig {
1515 minSdkVersion 19
1616 targetSdkVersion 31
17- versionCode 30
18- versionName ' 1.0.8 '
17+ versionCode 31
18+ versionName ' 1.0.9 '
1919
2020 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
2121
Original file line number Diff line number Diff line change 3737 <category android : name =" android.intent.category.BROWSABLE" />
3838 <data android : scheme =" http" />
3939 </intent >
40+ <intent >
41+ <action android : name =" android.intent.action.SENDTO" />
42+ <data android : scheme =" mailto" />
43+ </intent >
4044 <intent >
4145 <action android : name =" android.media.action.IMAGE_CAPTURE" />
4246 </intent >
Original file line number Diff line number Diff line change @@ -10,8 +10,11 @@ class OpenUrlEventHandler(private val context: Context) : MobileEventHandler {
1010 override fun handle (event : MobileEvent ): Boolean = event.takeIf {
1111 it.type == MobileEventType .MOBILE_EVENT_OPEN_URL_REQUEST
1212 }?.let {
13- val webpage = Uri .parse(it.openUrlRequest)
14- val intent = Intent (Intent .ACTION_VIEW , webpage)
13+ val uri = Uri .parse(it.openUrlRequest)
14+ val intent = when (uri.scheme) {
15+ " mailto" -> Intent (Intent .ACTION_SENDTO , uri)
16+ else -> Intent (Intent .ACTION_VIEW , uri)
17+ }
1518 if (intent.resolveActivity(context.packageManager) != null ) {
1619 context.startActivity(intent)
1720 }
You can’t perform that action at this time.
0 commit comments