Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagenone
stroeerAds.init(applicationName: string): Promise<void>
- initializes Yieldlove SDK, should be called as soon as possible

stroeerAds.loadInterstitial(slotName: string): Promise<InterstitialAd>
- loads ad based on slotName and saves it to loaded ads if no errors
- Returns:
  - InterstitialAd
      show(): Promise<void>
        - will try to show ad (same behaviour as showInterstitial)
      id(): string 
        - slotName of loaded ad
- Throws
  - could throw general javascript Error
with message
    - unexpected error during loading
    - failed to load ad because of "NO FILL"
- Events:
  - adLoaded {adId: string}

stroeerAds.showInterstitial(slotName: string): Promise<void>
- looks for loaded ads based on slotName and shows it to user
- Throws
  - could throw general javascript Error with message
    - Could not find ad for slot [slotName] 
      - happens when ad is not loaded or was already shown and removed from loaded ads
- Events
  - adShowed {adId: string}
    - when ad is shown to user
  - adImpression {adId: string}
    - when ad is shown to user
  - adShowFailed {adId: string, reason: string}
    - when showing ad was not successfull e.g. because was already shown
  - adClicked {adId: string}
    - when user clicked the ad
  - adDismissed {adId: string}
    - when ad was closed

...