Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 1 addition & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
script: ./gradlew :messenger:connectedAndroidTest

- name: Gradle Build and Test
uses: eskatos/gradle-command-action@v1.3.3
uses: gradle/gradle-build-action@v2
with:
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true
arguments: clean assembleDebug testDebugUnitTest --info --stacktrace
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies {

## Manual installation

[Download](https://jitpack.io/com/github/deskpro/messenger-sdk-android/0.0.6/messenger-sdk-android-0.0.6.aar) latest .aar file
[Download](https://jitpack.io/com/github/deskpro/messenger-sdk-android/0.0.7/messenger-sdk-android-0.0.7.aar) latest .aar file

- Open the build.gradle file for the app module and add the following lines:

Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Dec 28 22:40:57 CET 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import com.deskpro.messenger.util.extensions.EvaluateScriptsUtil.initAndOpenScri
import com.deskpro.messenger.util.extensions.extractAppId
import com.deskpro.messenger.util.extensions.extractUrl
import timber.log.Timber
import java.net.MalformedURLException
import java.net.URL

/**
* Activity hosting the WebView for DeskPro Messenger functionality.
Expand Down Expand Up @@ -115,8 +117,16 @@ internal class MessengerWebViewActivity : AppCompatActivity() {
error: WebResourceError?
) {
super.onReceivedError(view, request, error)
binding.progressBar.visibility = View.GONE
loadErrorHtmlPage()
// Only redirect to error page if the error came from the Messenger domain
try {
if (URL(url).host == request?.url?.host) {
binding.progressBar.visibility = View.GONE
loadErrorHtmlPage()
}
} catch (e: MalformedURLException) {
// If url is malformed then Messenger has failed to load
loadErrorHtmlPage()
}
}
}
}
Expand Down