Support Center

Have feedback or questions on this section? Just click the Help tab on the right side of your screen.

Publisher/Code


Step 1: Serve Ads in fewer than 10 minutes


You can serve interstitial and banner ads very quickly and with little effort using Flurry for Publishers.

The following steps are common to all ad types served through Flurry for Publishers, and are applicable whether you are using Flurry to monetize, to cross-promote, or to serve in-house targeted messages to your users.

This set of instructions applies to Flurry’s latest SDK 5.4 that is compatible with iOS 8 and iPhone 6 release.
For instructions how to integrate the earlier versions of Flurry SDK, please follow this link
For highlights on how to update from earlier Flurry SDK versions please follow this link

Sample iOS application with different banner and takeover ad types integrated: Download the sample code and follow the guide for the integration instructions.


Download and Incorporate the Flurry iOS SDK into Your App


  1. Download the Flurry iOS SDK. This download will contain both the Flurry Analytics and Flurry Ads modular libraries. Keep a reference to the API Key found on the download page. This will identify your app in the Flurry system.
  2. In the finder, drag Flurry/ and FlurryAds/ into your project's file folder. (NOTE: If you are upgrading the Flurry iOS SDK, be sure to remove any existing Flurry library folders from your project's file folder before proceeding.)
  3. Now add these 2 folders to your project: File > Add Files to "YOUR PROJECT"
  4. Add the following frameworks to your application's target in XCode:
    • AdSupport.framework (Mark as Optional to support < iOS 6.0)
    • CoreGraphics.framework
    • Foundation.framework
    • MediaPlayer.framework
    • Security.framework
    • StoreKit.framework (Mark as Optional to support < iOS 6.0)
    • SystemConfiguration.framework
    • UIKit.framework
    • libz.dylib (as of SDK version 5.0 we require this library added)


***CHECKPOINT***

Verify that your Xcode project appears as below.

  1. Flurry and FlurryAds folders appear in Project Navigation
  2. Your application target is linked with the above frameworks, including the Flurry static libraries.


Xcode lib setup annotated3.png

Integrate Code for Interstitial Display


Every application is different, we encourage you to experiment to find what works best. Use Flurry Analytic to determine places in your app with the highest user traffic. Typically, good placements include:

  • Games: On game launch, when user completes level
  • Social Networks: User completes an engagement (call, text, video)
  • Entertainment: User completes consuming media (video, music)
  • Content & Media: User completes consuming content
  • Utility: User completes using tool


Flurry ad spaces represent unique placements in the app, please create multiple ad spaces if you application supports multiple ad placements.
The following section will illustrate the method to show full screen ads within your app. The following steps are required and illustrated in the code snippet below:

Step 1. Initialize the Flurry Ad system in your AppDelegate

Step 2. Display the interstitial (takeover ad) and pause/resume activity in your app
As seen in the above code snippet you should pause any activity in your app before the takeover will display and resume it after the takeover is closed.

Please Note: It is recommended to not set ad delegate to nil or remove ad in the viewWillDisappear or viewDidDisappear method of the presenting view controller that is passed into fetchAndDisplayAdForSpace: and displayAdForSpace:onView:viewControllerForPresentation routines. When a full screen ad is shown on the view controller passed into these routine then the viewWillDisappear and viewDidDisappear methods of this view controller will get called.



***CHECKPOINT*** Run the app to see an Interstitial ad display. You should now see an ad similar to the below:


Phone.png



If you are not seeing any ads, check our troubleshooting section for tips.


Integrate Code for Banner Display


Flurry ad spaces represent unique placements in the app, please create multiple ad spaces if you application supports multiple ad placements. Use Flurry Analytics to determine places in your app with the highest user traffic and session times. Typically, good placements include top of screen or a fixed location on the bottom of the screen of the Activity with the highest user traffic.

The following section will illustrate the method to show banners within your app. The following steps are required and illustrated in the code snippet below:

Step 1. Initialize the Flurry Ad System

Step 2. Display Banner Ads
Please Note: It is recommended to not set ad delegate to nil or remove ad in the viewWillDisappear or viewDidDisappear method of the presenting view controller that is passed into fetchAndDisplayAdForSpace: and displayAdForSpace:onView:viewControllerForPresentation routines. When a full screen ad is shown on the view controller passed into these routine then the viewWillDisappear and viewDidDisappear methods of this view controller will get called.

Once displayed, the banners will be refreshed every 30 seconds while its containing UIViewController is the top window. To explicitly remove the banner ad call [FlurryAds removeAdFromSpace:adSpace] method. The default 30 seconds refresh can be changed on the ad space setup page in the dev portal.

***CHECKPOINT***

Run the app to see Banner ads display. You should now see ads similar to the below:


PhoneBanner.png



If you are not seeing any ads, check our troubleshooting section for tips.

Step 2: Implement Ad Delegate (Optional)


To be notified of certain events during the full lifecycle of the Ad, you can implement the FlurryAdDelegate and then call the [FlurryAds setDelegate:] method to attach your delegate to the FlurryAds.

You should set the delegate in each UIVIewController where you are presenting Flurry ads.

When you implement the FlurryAdDelegate you will implement the following callback methods:

  • (void) spaceDidReceiveAd:(NSString*)adSpace;
    • This method is called when an ad has been received and is available for display on the ad space specified by adSpace.
  • (void) spaceDidFailToReceiveAd:(NSString*) adSpace error:(NSError *)error;
    • This method informs the app that an ad has failed to be received for the given adSpace.
  • (BOOL) spaceShouldDisplay:(NSString*)adSpace interstitial:(BOOL)interstitial;
    • This method informs the app that an ad is about to be displayed on the adSpace. The parameter interstitial will be YES/NO if the space to display will be an interstitial. You can decide at this point not to show this ad by simply returning NO. Returning YES will allow the ad to be shown.
  • (void) spaceDidFailToRender:(NSString *)space error:(NSError *)error;
    • This method informs the user an ad was retrieved, however, was unsuccessful in displaying to the user (could be lost network connectivity for example).
  • (void) spaceWillDismiss:(NSString *)adSpace;
    • This method will be called when the user dismisses the current Ad for the provided Ad Space name.
  • (void)spaceDidDismiss:(NSString *)adSpace interstitial:(BOOL)interstitial;
    • This method informs the app that an ad has closed. You can use this to resume app states.
  • (void) spaceWillLeaveApplication:(NSString *)adSpace
    • This method will be called when the user is leaving the application after following events associated with the current Ad in the provided Ad Space name.
  • (void)videoDidFinish:(NSString *)adSpace;
    • This method will be called when a video finishes playing to inform the app that a video associated with an ad has finished playing. This method is invoked for Rewarded ad spaces only (this includes the following ad mix options: Rewarded, Let Flurry Decide and Client-side Rewarded). The ad space configured as Standard ad mix will not invoke this delegate. The ad space mix configuration is done on the server side, see further instructions: for Client Side Rewarded ads and for Server Side rewarded ads.


Example usage:

Step 3: Configure Ad serving (Optional)


There are a number of configuration parameters that you can use to modify the behavior of your ad spaces.

Option 1. Enable Test Ads

Add a call to receive test ads from the flurry server to ensure proper implementation. Test ads do not generate revenue and therefore MUST be disabled before submitting to the AppStore:


Option 2. Set Location

Add a call to set the location (lat,long) that you want associated with the ad request, to be used with geographical targeting:
Option 3. User Cookies

Add a call to identify any user specific information you want associated with the ad request:

Option 4. Keyword Targeting Add a call to specify keywords to be used when targeting ads: