You've already forked Commercialization.tapadn
Fix TapADN show error accessibility
This commit is contained in:
@@ -818,7 +818,7 @@ namespace Dirichlet.Mediation
|
|||||||
OnClosed();
|
OnClosed();
|
||||||
break;
|
break;
|
||||||
case DirichletNativeEventNames.ShowError:
|
case DirichletNativeEventNames.ShowError:
|
||||||
OnShowFailed(nativeEvent.Data);
|
OnShowFailed(CreateShowError(nativeEvent.Data));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -838,11 +838,16 @@ namespace Dirichlet.Mediation
|
|||||||
Closed?.Invoke();
|
Closed?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnShowFailed(DirichletNativeEventData data)
|
protected virtual void OnShowFailed(DirichletError error)
|
||||||
|
{
|
||||||
|
ShowFailed?.Invoke(error ?? new DirichletError("show_error", "Ad failed to show"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static DirichletError CreateShowError(DirichletNativeEventData data)
|
||||||
{
|
{
|
||||||
var code = data != null && data.Code != 0 ? data.Code.ToString(CultureInfo.InvariantCulture) : "show_error";
|
var code = data != null && data.Code != 0 ? data.Code.ToString(CultureInfo.InvariantCulture) : "show_error";
|
||||||
var message = data?.Message;
|
var message = data?.Message;
|
||||||
ShowFailed?.Invoke(new DirichletError(code, string.IsNullOrEmpty(message) ? "Ad failed to show" : message));
|
return new DirichletError(code, string.IsNullOrEmpty(message) ? "Ad failed to show" : message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1388,4 +1393,3 @@ namespace Dirichlet.Mediation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user