UnityAdlib
Public Member Functions | Properties | List of all members
Tizen.AdLib.AdProvider Class Reference

Public Member Functions

ErrorType InitAdlib (string banner_site_id, string interstitial_site_id, string js_namespace, string js_src_url, string conf_str)
 
ErrorType DeinitAdlib ()
 
void SetGender (GenderPreference gender)
 
void SetEthnicity (string ethnicity)
 
void SetAge (int age)
 
void SetDateOfBirth (string dob)
 
void SetIncome (string income)
 
void SetEducation (string education)
 
void SetLocation (string location)
 
void SetInterests (string interests)
 
void SetPostalcode (string postalcode)
 
void SetAreaCode (string areacode)
 
ErrorType SetBannerAdListener (IntPtr handle, BannerAdListener appListener)
 
ErrorType AddBannerAd (BannerAdSize size, out IntPtr adhandle)
 
ErrorType BannerAdLoad (IntPtr handle)
 
ErrorType BannerAdSetPosition (IntPtr handle, BannerAdPosition pos)
 
ErrorType BannerAdMove (IntPtr handle, int xpos, int ypos)
 
ErrorType BannerAdSetVisibility (IntPtr handle, bool value)
 
ErrorType BannerAdDestroy (IntPtr handle)
 
ErrorType BannerAdEnableAutoRefresh (IntPtr handle, bool value)
 
ErrorType BannerAdSetRefreshInterval (IntPtr handle, int duration)
 
ErrorType AddInterstitialAd ()
 
ErrorType SetInterstitialAdListener (InterstitialAdListener appListener)
 
ErrorType InterstitialAdLoad ()
 
ErrorType InterstitialAdShow ()
 

Properties

static AdProvider Instance [get]
 

Member Function Documentation

ErrorType Tizen.AdLib.AdProvider.AddBannerAd ( BannerAdSize  size,
out IntPtr  adhandle 
)

This api will add the banner ad on the parent received.

Parameters
[out]adhandle: banner ad handle to be used for this ad instance.
[in]size: size of the ad to be shown.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
ADLIB_AD_ADLIB_NOT_INITIALIZEDIf adlib is not initialised. i.e adlib_init() not called.
Note
This will only create the handle and will not show ad.
ErrorType Tizen.AdLib.AdProvider.AddInterstitialAd ( )

This api will add the interstitial ad on the parent received.

Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
ADLIB_AD_ADLIB_NOT_INITIALIZEDIf adlib is not initialised. i.e adlib_init() not called.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
Note
This will only create the object and will not show ad.
ErrorType Tizen.AdLib.AdProvider.BannerAdDestroy ( IntPtr  handle)

To delete the banner ad from a view. Application can delete the banner ad while exiting from a view or use visibility option to reuse the same in other views.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType Tizen.AdLib.AdProvider.BannerAdEnableAutoRefresh ( IntPtr  handle,
bool  value 
)

This api will set the auto refresh feature to either enabled or disabled. If set to disabled ads will not refresh automatically and the app needs to call adview_banner_load for loading a new ad.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]value: Boolean to enable or disable auto refresh feature.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType Tizen.AdLib.AdProvider.BannerAdLoad ( IntPtr  handle)

Loads and shows the ad. Returns the success or failure result to the listener callbacks.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ErrorType Tizen.AdLib.AdProvider.BannerAdMove ( IntPtr  handle,
int  xpos,
int  ypos 
)

Move the position of the ad to relative coordinates. Application can set the position of the ad to the relative screen coordinates (x, y) position

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]xposx coordinate position
[in]yposy coordinate position
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType Tizen.AdLib.AdProvider.BannerAdSetPosition ( IntPtr  handle,
BannerAdPosition  pos 
)

Sets the position of the ad to predefined positions. Application can set the position of the ad to the predefined positions defined in adlib_adposition_e

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]posposition of the ad
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType Tizen.AdLib.AdProvider.BannerAdSetRefreshInterval ( IntPtr  handle,
int  duration 
)

This api will set the auto refresh interval for the ad. Minimum refresh interval should be greater than 10 secs.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]duration: Refresh interval value should be >= 10.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType Tizen.AdLib.AdProvider.BannerAdSetVisibility ( IntPtr  handle,
bool  value 
)

Sets the visibility of the ad. Application can set the visibility of the ad according to success or failure events and also during navigating between views.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]valueTrue to Show and False to Hide
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType Tizen.AdLib.AdProvider.DeinitAdlib ( )

Disconnects adlib core and clears networkconnection.

Returns
void
ErrorType Tizen.AdLib.AdProvider.InitAdlib ( string  banner_site_id,
string  interstitial_site_id,
string  js_namespace,
string  js_src_url,
string  conf_str 
)

Initializes adlib and its core.

Parameters
[in]banner_site_idsite id provided for the application by Inmobi during registration for banner ads.
[in]interstitial_site_idsite id provided for the application by Inmobi during registration for interstitial ads.
[in]js_namespacenamespace provided for the application
[in]js_src_urlsource url provided for inmobijs to the application
[in]conf_strinmobi configuration string provided for the application
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType Tizen.AdLib.AdProvider.InterstitialAdLoad ( )

Loads the interstitial ad. Returns the success or failure result to the listener callbacks. Please see OnLoadFailed and OnLoadSucceeded callbacks.

Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType Tizen.AdLib.AdProvider.InterstitialAdShow ( )

Shows the interstitial ad.

Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
void Tizen.AdLib.AdProvider.SetAge ( int  age)

Preference API to set age

Parameters
[in]age:age as integer
Returns
void
void Tizen.AdLib.AdProvider.SetAreaCode ( string  areacode)

Preference API to set area code

Parameters
[in]areacode:areacode as string
Returns
void
ErrorType Tizen.AdLib.AdProvider.SetBannerAdListener ( IntPtr  handle,
BannerAdListener  appListener 
)

Adds the banner ad callback handler.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]appListener: The set of listener functions to handle ad lifecycle events
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
void Tizen.AdLib.AdProvider.SetDateOfBirth ( string  dob)

Preference API to set DateofBirth

Parameters
[in]dob:date of birth as string in YYYY:MM:DD format
Returns
void
void Tizen.AdLib.AdProvider.SetEducation ( string  education)

Preference API to set education

Parameters
[in]education:education as string
Returns
void
void Tizen.AdLib.AdProvider.SetEthnicity ( string  ethnicity)

Preference API to set ethnicity

Parameters
[in]ethnicity:asian or hispanic
Returns
void
void Tizen.AdLib.AdProvider.SetGender ( GenderPreference  gender)

Preference API to set the Gender

Parameters
[in]gender: Female or Male
Returns
void
void Tizen.AdLib.AdProvider.SetIncome ( string  income)

Preference API to set income

Parameters
[in]income:income as string
Returns
void
void Tizen.AdLib.AdProvider.SetInterests ( string  interests)

Preference API to set interests

Parameters
[in]interests:interests as comma separated strings
Returns
void
ErrorType Tizen.AdLib.AdProvider.SetInterstitialAdListener ( InterstitialAdListener  appListener)

Adds the interstitial ad callback handler.

Parameters
[in]appListener: The set of callback functions to handle ad lifecycle events
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
ADLIB_AD_ADLIB_NOT_INITIALIZEDIf adlib is not initialised. i.e adlib_init() not called.
Returns
adlib_err : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
void Tizen.AdLib.AdProvider.SetLocation ( string  location)

Preference API to set location

Parameters
[in]location:location as string in City-State-Country format
Returns
void
void Tizen.AdLib.AdProvider.SetPostalcode ( string  postalcode)

Preference API to set postal code

Parameters
[in]postalcode:postal code as string
Returns
void

Property Documentation

AdProvider Tizen.AdLib.AdProvider.Instance
staticget

Returns the AdProvider instance on which application has to call member functions.