Skip to content

Commit

Permalink
fix: allow MutableContextWrapper for flutter sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
박주렁 authored and parkjurung committed Feb 29, 2024
1 parent c784f6b commit d4e2fd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pagecall/src/main/java/com/pagecall/PagecallWebView.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.MutableContextWrapper;
import android.content.res.AssetManager;
import android.media.AudioManager;
import android.net.Uri;
Expand Down Expand Up @@ -188,9 +189,9 @@ public void loadDataWithBaseURL(@Nullable String baseUrl, @NonNull String data,
private PagecallWebChromeClient webChromeClient;

protected void init(Context context) {
// Check if the context is ActivityContext
if (!(context instanceof Activity)) {
throw new IllegalArgumentException("Provided context is not an Activity context.");
// Check if the context is ActivityContext or MutableContextWrapper
if (!(context instanceof Activity) && !(context instanceof MutableContextWrapper)) {
throw new IllegalArgumentException("The provided context is neither an Activity nor a MutableContextWrapper.");
}
if (this.pagecallUrls == null) {
pagecallUrls = defaultPagecallUrls;
Expand Down

0 comments on commit d4e2fd8

Please sign in to comment.