|
43 | 43 | import androidx.annotation.NonNull; |
44 | 44 | import com.leanplum.ActionContext; |
45 | 45 | import com.leanplum.Leanplum; |
| 46 | +import com.leanplum.internal.Log; |
46 | 47 | import com.leanplum.messagetemplates.DialogCustomizer; |
47 | 48 | import com.leanplum.messagetemplates.MessageTemplates; |
48 | 49 | import com.leanplum.messagetemplates.options.RichHtmlOptions; |
@@ -210,27 +211,36 @@ private WebView createHtml(Context context) { |
210 | 211 | @SuppressWarnings("deprecation") |
211 | 212 | @Override |
212 | 213 | public boolean shouldOverrideUrlLoading(WebView wView, String url) { |
213 | | - if (isClosing) // prevent multiple clicks on same button |
214 | | - return true; |
215 | | - |
216 | | - // Open URL event. |
217 | | - if (handleOpenEvent(url)){ |
218 | | - return true; |
219 | | - } |
220 | | - |
221 | | - // Close URL event. |
222 | | - if (handleCloseEvent(url)) { |
223 | | - return true; |
224 | | - } |
225 | | - |
226 | | - // Track URL event. |
227 | | - if (handleTrackEvent(url)) { |
228 | | - return true; |
229 | | - } |
230 | | - |
231 | | - // Action URL or track action URL event. |
232 | | - if (handleActionEvent(url)) { |
233 | | - return true; |
| 214 | + try { |
| 215 | + if (isClosing) // prevent multiple clicks on same button |
| 216 | + return true; |
| 217 | + |
| 218 | + // Open URL event. |
| 219 | + if (handleOpenEvent(url)) { |
| 220 | + return true; |
| 221 | + } |
| 222 | + |
| 223 | + // Close URL event. |
| 224 | + if (handleCloseEvent(url)) { |
| 225 | + return true; |
| 226 | + } |
| 227 | + |
| 228 | + // Track URL event. |
| 229 | + if (handleTrackEvent(url)) { |
| 230 | + return true; |
| 231 | + } |
| 232 | + |
| 233 | + // Action URL or track action URL event. |
| 234 | + if (handleActionEvent(url)) { |
| 235 | + return true; |
| 236 | + } |
| 237 | + } catch (Throwable t) { |
| 238 | + String messageId = ""; |
| 239 | + ActionContext actionContext = richOptions.getActionContext(); |
| 240 | + if (actionContext != null) { |
| 241 | + messageId = actionContext.getMessageId(); |
| 242 | + } |
| 243 | + Log.e("Error in Rich Interstitial messageId=" + messageId, t); |
234 | 244 | } |
235 | 245 |
|
236 | 246 | return false; |
|
0 commit comments