("getVersion");
}
///
/// Indicates whether Android advertisement ID should be sent in the request or not.
/// By default advertisement ID will be used.
/// Possible values are:
/// true : Advertisement id will be sent in the request.
/// false : Advertisement id will not be sent in the request.
///
///
/// state of advertisement id usage
public static void AllowAdvertisingId(bool allow)
{
OpenWrapSDKClass.CallStatic("allowAdvertisingId", allow);
}
///
/// Used to enable/disable location access.
/// This value decides whether the OpenWrap SDK should access device location using
/// Core Location APIs to serve location-based ads.When set to false, the SDK will not attempt
/// to access device location.When set to true, the SDK will periodically try to fetch location
/// efficiently.
/// Note that, this only occurs if location services are enabled and the user has already
/// authorized the use of location services for the application. The OpenWrap SDK never asks
/// permission to use location services by itself.
///
/// The default value is true.
///
/// enable or disable location access behavior
public static void AllowLocationAccess(bool allow)
{
OpenWrapSDKClass.CallStatic("allowLocationAccess", allow);
}
///
/// Indicates whether the visitor is COPPA-specific or not.
/// For COPPA(Children's Online Privacy Protection Act) compliance, if the visitor's age is
/// below 13, then such visitors should not be served targeted ads.
/// Possible options are:
/// false - Indicates that the visitor is not COPPA-specific and can be served targeted ads.
/// true - Indicates that the visitor is COPPA-specific and should be served only COPPA-compliant ads.
///
/// Visitor state for COPPA compliance.
public static void SetCoppaEnabled(bool enable)
{
OpenWrapSDKClass.CallStatic("setCoppa", enable);
}
///
/// Sets user's location and its source. It is useful in delivering geographically relevant ads.
///
/// If your application is already accessing the device location, it is highly recommended to
/// set the location coordinates inferred from the device GPS.If you are inferring location
/// from any other source, make sure you set the appropriate location source.
///
/// ongitude of the location
/// latitude of the location
/// location source
public static void SetLocation(double longitude, double latitude, POBLocSource source)
{
AndroidJavaObject locationSourceJavaObject = POBAndroidUtils.ConvertLocationSourceToJavaObject(source);
AndroidJavaObject locationJavaObject = new AndroidJavaObject(POBConstants.POBLocationClassName, locationSourceJavaObject, latitude, longitude);
OpenWrapSDKClass.CallStatic("setLocation", locationJavaObject);
}
///
/// Sets log level across all ad formats. Default log level is LogLevel.Warn.
/// For more details refer
///
///
public static void SetLogLevel(POBSDKLogLevel logLevel)
{
AndroidJavaObject logLevelJavaObject = POBAndroidUtils.ConvertLogLevelToJavaObject(logLevel);
OpenWrapSDKClass.CallStatic("setLogLevel", logLevelJavaObject);
}
///
/// Enable/disable secure ad calls.
///
/// By default, OpenWrap SDK initiates secure ad calls from an application to the ad server and
/// delivers only secure ads.You can allow non secure ads by passing false to this method.
///
/// false for disable secure creative mode. Default is set to true.
public static void SetSSLEnabled(bool enable)
{
OpenWrapSDKClass.CallStatic("setSSLEnabled", enable);
}
///
/// Tells OpenWrap SDK to use internal SDK browser, instead of the default device browser,
/// for opening landing pages when the user clicks on an ad.
/// By default, use of internal browser is enabled.If disabled by setting it to false, the
/// landing page will gets opened in the default browser set by the user in device.
///
/// boolean value that enables/disables the use of internal browser.
public static void SetUseInternalBrowser(bool use)
{
OpenWrapSDKClass.CallStatic("setUseInternalBrowser", use);
}
///
/// Sets Application information, which contains various attributes about app, such as
/// application category, store URL, domain, etc for more relevant ads.
///
/// Instance of POBApplicationInfo class with required application details
public static void SetApplicationInfo(POBApplicationInfo applicationInfo)
{
AndroidJavaObject appInfoObject = new AndroidJavaObject(POBConstants.POBApplicationInfoClassName);
appInfoObject.Call("setKeywords", applicationInfo.Keywords);
appInfoObject.Call("setDomain", applicationInfo.Domain);
if(applicationInfo.StoreURL != null) {
AndroidJavaObject storeURLObject = new AndroidJavaObject("java.net.URL", applicationInfo.StoreURL.ToString());
appInfoObject.Call("setStoreURL", storeURLObject);
}
else
{
POBLog.Warning(Tag, POBLogStrings.SetApplicationInfoStoreURLLog);
}
if(applicationInfo.Paid != POBBool.Unknown)
{
appInfoObject.Call("setPaid", Convert.ToBoolean(applicationInfo.Paid));
}
else
{
POBLog.Warning(Tag, POBLogStrings.SetApplicationInfoPaidLog);
}
appInfoObject.Call("setCategories", applicationInfo.Categories);
OpenWrapSDKClass.CallStatic("setApplicationInfo", appInfoObject);
}
///
/// Gets Application info set by publisher to OpenWrap SDK
///
/// instance of POBApplicationInfo class
public static POBApplicationInfo GetApplicationInfo()
{
POBApplicationInfo appInfo = null;
AndroidJavaObject appInfoObject = OpenWrapSDKClass.CallStatic("getApplicationInfo");
if (appInfoObject != null)
{
AndroidJavaObject storeURLObject = appInfoObject.Call("getStoreURL");
appInfo = new POBApplicationInfo();
appInfo.Keywords = appInfoObject.Call("getKeywords");
appInfo.Domain = appInfoObject.Call("getDomain");
if (storeURLObject != null)
{
appInfo.StoreURL = new Uri(storeURLObject.Call("toString"));
}
if(appInfoObject.Call("isPaid") != null)
{
appInfo.Paid = (POBBool)Convert.ToInt32(appInfoObject.Call("isPaid"));
}
appInfo.Categories = appInfoObject.Call("getCategories");
}
return appInfo;
}
///
/// Sets user information, such as birth year, gender, region, etc for more relevant ads.
///
/// Instance of POBUserInfo class with required user details
public static void SetUserInfo(POBUserInfo userInfo)
{
if(userInfo != null && userInfo.client != null)
{
AndroidJavaObject userInfoObject = userInfo.client.GetNativeObject();
if(userInfoObject != null)
{
internalUserInfo = userInfo;
OpenWrapSDKClass.CallStatic("setUserInfo", userInfoObject);
}
else
{
POBLog.Warning(Tag, POBLogStrings.SetUserInfoObjectFailedLog);
}
}
else
{
POBLog.Warning(Tag, POBLogStrings.SetUserInfoFailedLog);
}
}
///
/// Gets user info set by publisher to OpenWrap SDK
///
/// instance of POBUSerInfo class
public static POBUserInfo GetUserInfo()
{
return internalUserInfo;
}
///
/// Add the External user id /Data Partner ids which helps publisher in better user targeting
///
/// Instance of POBExternalUserId
public static void AddExternalUserId(POBExternalUserId externalUserId)
{
if (externalUserId != null)
{
OpenWrapSDKClass.CallStatic("addExternalUserId", externalUserId.externalUserIdClient.GetNativeObject());
}
else
{
POBLog.Warning(Tag, POBLogStrings.AddExternalUserIdFailedLog);
}
}
///
/// Removes the external user ids of a particular source
///
public static void RemoveExternalUserIds(string source)
{
if (source != null)
{
OpenWrapSDKClass.CallStatic("removeExternalUserIds", source);
}
else
{
POBLog.Warning(Tag, POBLogStrings.RemoveExternalUserIdsFailedLog);
}
}
///
/// Remove all external user ids
///
public static void RemoveAllExternalUserIds() {
OpenWrapSDKClass.CallStatic("removeAllExternalUserIds");
}
}
}
#endif