Package

## Object InMobiSdk

- All Implemented Interfaces:

      public class InMobiSdk

  Constants and settings that have effect across the InMobi SDK.

  As part of the General Data Protection Regulation ("GDPR") publishers who collect data on their apps, are required to have a legal basis for collecting and processing the personal data of users in the European Economic Area ("EEA"). Please ensure that you obtain appropriate consent from the user before making ad requests to InMobi for Europe and indicate the same by following our recommended SDK implementation. Please do not pass any demographics information of a user; if you do not have user consent from such user in Europe.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `public enum` | `InMobiSdk.LogLevel` |
    `public enum` | `InMobiSdk.Education` |
    `public enum` | `InMobiSdk.Gender` |
    `public enum` | `InMobiSdk.AgeGroup` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `public final String` | `IM_GDPR_CONSENT_AVAILABLE` |
    `public final String` | `IM_GDPR_CONSENT_IAB` |
    `public final String` | `IM_GDPR_CONSENT_GDPR_APPLIES` |
    `public final static InMobiSdk` | `INSTANCE` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `final static Unit` | `init(Context context, @Size(min = 32, max = 36) String accountId, JSONObject consentObject, SdkInitializationListener sdkInitializationListener)` | Initialize the sdk.
    `final static Unit` | `updateGDPRConsent(JSONObject consentObject)` | Update user's GDPR consent.
    `final static Unit` | `setPartnerGDPRConsent(JSONObject consentObject)` | This method should only be used by mediation partners to provide consent object.
    `final static Unit` | `setApplicationMuted(Boolean muted)` | Inform SDK if any media which is rendered by SDK should be played muted.
    `final static String` | `getVersion()` | Use this to get the version of the SDK.
    `final static Unit` | `setLogLevel(InMobiSdk.LogLevel logLevel)` | Control the verbosity of the logs printed by the Ads SDK.
    `final static Unit` | `setAge(Integer age)` | Set the user's age for targeting purposes.
    `final static Unit` | `setIsAgeRestricted(Boolean isAgeRestricted)` | Set the age restriction for family apps
    `final static Unit` | `setAgeGroup(InMobiSdk.AgeGroup group)` | Set the user's age group for targeting purposes.
    `final static Unit` | `setAreaCode(String areaCode)` | Set the area code for targeting purposes.
    `final static Unit` | `setPostalCode(String postalCode)` | Set the postal code for targeting purposes.
    `final static Unit` | `setLocationWithCityStateCountry(String city, String state, String country)` | Set specific location parameters for targeting purposes.
    `final static Unit` | `setYearOfBirth(Integer yearOfBirth)` | Set the user's year of birth for targeting purposes.
    `final static Unit` | `setGender(InMobiSdk.Gender gender)` | Set the user's gender for targeting purposes.
    `final static Unit` | `setEducation(InMobiSdk.Education education)` | Set the educational qualifications of the user for targeting purposes.
    `final static Unit` | `setLanguage(String language)` | Set the language for targeting purposes.
    `final static Unit` | `setInterests(String interests)` | Set the user's interest areas for targeting purposes.
    `final static Unit` | `setLocation(Location location)` | Set the user's location for targeting purposes.
    `final static String` | `getToken()` | Get a token for Advanced Bidding
    `final static String` | `getToken(Map<String, String> extras, String keywords)` | Get a token for Advanced Bidding
    `final static Unit` | `setPublisherProvidedUnifiedId(JSONObject jsonObject)` | Set Unified ID procured from vendors directly.
    `final static Boolean` | `isSDKInitialized()` |
    `final String` | `getIM_GDPR_CONSENT_AVAILABLE()` | Populate this key to consentObject with boolean value.
    `final String` | `getIM_GDPR_CONSENT_IAB()` | Key to populate consent with respect to IAB norms.
    `final String` | `getIM_GDPR_CONSENT_GDPR_APPLIES()` | Key to populate GDPR applies values according to IAB norms.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

  - ### Method Detail

    - #### init

          @UiThread() final static Unit init(Context context, @Size(min = 32, max = 36) String accountId, JSONObject consentObject, SdkInitializationListener sdkInitializationListener)

      Initialize the sdk. This must be called before any other API for the SDK is used.

      Parameters:
        `context` - Represents the application context
        `accountId` - Represents the accountId of the publisher
        `consentObject` - InMobi relies on the publishers to obtain explicit consent from users for continuing business activities in EU as per GDPR.
        `sdkInitializationListener` - Represents a listener object to provide callback when SDK initialization process is complete

    - #### updateGDPRConsent

           final static Unit updateGDPRConsent(JSONObject consentObject)

      Update user's GDPR consent.

    - #### setPartnerGDPRConsent

           final static Unit setPartnerGDPRConsent(JSONObject consentObject)

      This method should only be used by mediation partners to provide consent object. Publishers should not use this method.

      Parameters:
        `consentObject` - Partner provided consent object

    - #### setApplicationMuted

           final static Unit setApplicationMuted(Boolean muted)

      Inform SDK if any media which is rendered by SDK should be played muted. Passing true indicates that all media rendered by sdk after calling this method will be played with state mute.

    - #### getVersion

           final static String getVersion()

      Use this to get the version of the SDK.

    - #### setLogLevel

           final static Unit setLogLevel(InMobiSdk.LogLevel logLevel)

      Control the verbosity of the logs printed by the Ads SDK.

      Parameters:
        `logLevel` - choose from LogLevel.DEBUG, or LogLevel.NONE

    - #### setAge

           final static Unit setAge(Integer age)

      Set the user's age for targeting purposes.

    - #### setIsAgeRestricted

           final static Unit setIsAgeRestricted(Boolean isAgeRestricted)

      Set the age restriction for family apps

    - #### setAgeGroup

           final static Unit setAgeGroup(InMobiSdk.AgeGroup group)

      Set the user's age group for targeting purposes.

    - #### setAreaCode

           final static Unit setAreaCode(String areaCode)

      Set the area code for targeting purposes.

    - #### setPostalCode

           final static Unit setPostalCode(String postalCode)

      Set the postal code for targeting purposes.

    - #### setLocationWithCityStateCountry

           final static Unit setLocationWithCityStateCountry(String city, String state, String country)

      Set specific location parameters for targeting purposes.

    - #### setYearOfBirth

           final static Unit setYearOfBirth(Integer yearOfBirth)

      Set the user's year of birth for targeting purposes.

    - #### setGender

           final static Unit setGender(InMobiSdk.Gender gender)

      Set the user's gender for targeting purposes.

    - #### setEducation

           final static Unit setEducation(InMobiSdk.Education education)

      Set the educational qualifications of the user for targeting purposes.

    - #### setLanguage

           final static Unit setLanguage(String language)

      Set the language for targeting purposes.

    - #### setInterests

           final static Unit setInterests(String interests)

      Set the user's interest areas for targeting purposes.

    - #### setLocation

           final static Unit setLocation(Location location)

      Set the user's location for targeting purposes.

    - #### getToken

           final static String getToken()

      Get a token for Advanced Bidding

    - #### getToken

          @UiThread() final static String getToken(Map<String, String> extras, String keywords)

      Get a token for Advanced Bidding

      Parameters:
        `extras` - Represents the extras
        `keywords` - Represents the keywords

    - #### setPublisherProvidedUnifiedId

           final static Unit setPublisherProvidedUnifiedId(JSONObject jsonObject)

      Set Unified ID procured from vendors directly. The ids are to be submitted in the following format. key would be the vendor and value would be the identifier. { "id5" : json(blob), "live Ramp": json(blob) }

      Parameters:
        `jsonObject` - Represents the unified id json blob.

    - #### isSDKInitialized

           final static Boolean isSDKInitialized()

    - #### getIM_GDPR_CONSENT_AVAILABLE

           final String getIM_GDPR_CONSENT_AVAILABLE()

      Populate this key to consentObject with boolean value.

    - #### getIM_GDPR_CONSENT_IAB

           final String getIM_GDPR_CONSENT_IAB()

      Key to populate consent with respect to IAB norms.

    - #### getIM_GDPR_CONSENT_GDPR_APPLIES

           final String getIM_GDPR_CONSENT_GDPR_APPLIES()

      Key to populate GDPR applies values according to IAB norms.