Separation of Engagement and Monetization

We did several architecture changes in an effort to separate clearly the different features of our SDK. This tutorial will help you to quickly update your project!
Don't hesitate to contact us if you have any problem.

Initialization method changed!

Former methods will still work in this release. However we removed the method setFeatures:, so you may be forced to update your code right now if you are using the Engagement SDK.

Code example

We introduced the ENUM AFSDKFeature in SDK 2.2. It allows the SDK to avoid unnecessary process. Please pay close attention to this!
In this example we are only using the Monetization SDK (AFSDKFeatureMonetization). If you are using the Engagement SDK, you may want to indicate AFSDKFeatureEngage instead.

// previous initialization
[AppsfireSDK setFeatures:AFSDKFeatureMonetization];
[AppsfireSDK connectWithAPIKey:@"YOUR_SDK_TOKEN"];

// new initialization
[AppsfireSDK connectWithSDKToken:@"YOUR_SDK_TOKEN" features:AFSDKFeatureMonetization parameters:nil];

Delay parameter

The new initialization method accepts a third parameter to specify a dictionary of options (keys/values). For example, it is still possible to specify a delay to avoid an immediate initialization of the SDK.

Let's say you want to delay the SDK of 0.5 second, you should write this:

// initialize the sdk with 0.5s delay
[AppsfireSDK connectWithSDKToken:@"YOUR_SDK_TOKEN" features:AFSDKFeatureMonetization parameters:@{kAFSDKInitDelay:@(0.5)}];

Monetization SDK

Division of the delegate in two

  • New delegate for the modal ad
    We moved all the modal delegate methods from AppsfireAdSDKDelegate to AFAdSDKModalDelegate. We added a delegate parameter to the modal request method. This method is now +requestModalAd:withController:withDelegate:. Note that the delegate methods will still be called in the SDK 2.4 if you are not using the new protocol.

  • Deprecated method for AppsfireAdSDKDelegate:

    • -modalAdIsReadyForRequest: was renamed -modalAdsRefreshedAndAvailable.
    • -sashimiAdsWereReceived: was renamed -sashimiAdsRefreshedAndAvailable.

  • New methods for AppsfireAdSDKDelegate:

    • -modalAdsRefreshedAndAvailable: called when ads were refreshed and that at least one modal ad is available.
    • -modalAdsRefreshedAndNotAvailable: called when ads were refreshed but that none is available for any modal format.
    • -sashimiAdsRefreshedAndAvailable: called when ads were refreshed and that at least one sashimi ad is available.
    • -sashimiAdsRefreshedAndNotAvailable: called when ads were refreshed but that none is available for any sashimi format.

Enhancement of existing classes

  • New methods for AppsfireAdSDK:
    You can now create the user interface of a custom sashimi by using interface builder. Note that you'll still need to create a subclass of AFAdSDKSashimiView to feed your XIB with the values.

    • +numberOfSashimiAdsAvailableForNibName:: get the number of available sashimi ads for a specific nib name.
    • +sashimiViewForNibName:: get a sashimi view based on a nib name.

  • New methods for AFAdSDKSashimiView:

    • -downloadAsset:completion:: download an asset (icon / screenshot) asynchronously. Thus, you don't need to create your own download method. We take care of the boring stuff!
    • -sashimiDidUpdateProperties: called when one or more properties were updated while the view was already created some time ago.

  • New methods for AFAdSDKUdonNoodleControl.h:

    • refreshingStrings: property that will allow you to set your own text when it's refreshing.
    • scrollDismissStyle: property to control the dismiss style of the Udon Noodle when scrolling up in the scroll view.
    • -viewControllerForUdonNoodleControl:: delegate which will let you provide the UIViewController needed to display the StoreKit controller. Prior to this change, the rootViewController was used. In order to continue using the in-app download overlay, make sure to specify a view controller.

  • Deprecated methods for AppsfireAdSDK:

    • +requestModalAd:withController:: we updated the method and added a third parameter. Please use +requestModalAd:withController:withDelegate: instead.
    • +prepare: due to update in the initialization process, the prepare method is being removed from the SDK. We'll automatically take care of 'preparing' the monetization SDK once the library is initialized.
    • +isInitialized: due to the new class for the Engagement feature, we merged the two isInitialized getters into one. Please use [AppsfireSDK isInitialized] method instead!

Engagement SDK

At first, Appsfire SDK was only focused on the Engagement features. In an effort to better separate the different features, we moved Engage into its own class named AppsfireEngageSDK.

If you were using the Engagement features, you'll have to find and replace most of 'AppsfireSDK' occurrences by 'AppsfireEngageSDK' (aside some methods, like the connect).
  • Deprecated methods for AppsfireEngageSDK:
    We plan to remove these methods in a future release. If you still find an interest in using them, please contact us!
    • +getSessionID
    • +pause
    • +resume