Sashimi Templates

We currently provide two ready to use templates:

  • Sashimi Minimal: this template is very compact and only contains essential information.
  • Sashimi Extended: this template is rich template using a part of the minimal format with a creative on top of it.

Templates layout

Preview

These templates are highly customizable to make the Sashimi Ad Units really blend in your application.
Check the AFAdSDKSashimiMinimalView.h and AFAdSDKSashimiExtendedView.h to access to the customizable properties.
If you want more customization, you can create you own Sashimi. Please read the Custom Mode section.

They are bundled with two predefined color schemes, in light and dark modes.

Here are examples of ads using the templates in light and dark modes.

Sashimi Minimal
Sashimi Minimal Light
Sashimi Minimal Dark
Sashimi Extended
Sashimi Extended Light
Sashimi Extended Dark

Architecture

To have an idea of the architecture of the Sashimi templates, take a look at these diagrams.

Sashimi architecture
Sashimi Minimal Layout
Sashimi Extended Layout

Specifications

Dimensions

For each templates we provide sizing recommendations to fully benefit the predefined designs:
- Sashimi Minimal: We recommend a size of 300 x 100
- Sashimi Extended: We recommend a size of 300 x 275

Resizing

Please note that the minimum allowed size for a Sashimi view is 30x30, if your view is smaller than that we will not take your impressions and clicks into account. Please verify your view respect those requirements.

While we recommend those dimensions, the templates are fairly flexible. Below you'll find a symbolized preview of the resize-ability of the Sashimi formats:

Sashimi resizing
Sashimi Minimal
Sashimi Extended

Code Integration

Before anything make sure your walked through these required steps before starting the integration of Sashimi.

The templates are UIView subclasses which you need to take care once you got them from our library. But please don't overlay anything that could prevent us to get the clicks events.

Imports

The first thing you need to do is to import the required classes:

// Required for Appsfire advertising.
#import "AppsfireAdSDK.h"

// Required if you will use the minimal format.
#import "AFAdSDKSashimiMinimalView.h"

// Required if you will use the extended format.
#import "AFAdSDKSashimiExtendedView.h"

Calculate how many ads are available

Before getting any Sashimi ads, you need to check how many ads are available for the format you want. For instance if you need to check how many ads are available for the Sashimi Minimal format you will need to do something like this:

NSUInteger sashimiMinimalAdsCount = [AppsfireAdSDK numberOfSashimiAdsAvailableForFormat:AFAdSDKSashimiFormatMinimal forZone:@"ZONE_ID"];

ZONE_ID is the zone ID for your Sashimi (in-stream) ads as provided by Appsfire.

Please check the troubleshooting section if no ads are available at this stage.

Get a sashimi ad

When the returned count is not 0, then you know you can get a Sashimi view. Getting a Sashimi view is done per format basis and for instance if you need a minimal Sashimi view you can do so with the following lines of code:

NSError *error;
AFAdSDKSashimiMinimalView *sashimiMinimalView;

// Get sashimi view
sashimiMinimalView = (AFAdSDKSashimiMinimalView *)[AppsfireAdSDK sashimiViewForFormat:AFAdSDKSashimiFormatMinimal forZone:@"ZONE_ID" withController:[UIApplication sharedApplication].keyWindow.rootViewController andError:&error];

// Before using this view make sure the returned view is not `nil` and that there is not error.
if (sashimiMinimalView != nil && error == nil) {

    // You can safely use the view

}

When you have got your Sashimi view you are ready to add it to a UIView as a subview. For instance you can add it into a UITableViewCell:
However we recommend you to subclass an UITableViewCell or an UICollectionViewCell to better handle the layout.

// Adding the sashimi view into the `contentView` of the cell.
[cell.contentView addSubview:sashimiMinimalView];

Use the delegate

As for the Interstitial ads (Sushi and Uramaki), you have a delegate method that will let you know once some ads are available. We recommend you to use it for a ideal implementation.

Be sure to:

  • Set the delegate via [AppsfireAdSDK setDelegate:object]
  • Check Sashimi ads are available for the format you need!

- (void)sashimiAdsRefreshedAndAvailable {

    NSLog("Sashimi ads were received");

    // check if a sashimi ad is available for the format
    NSUInteger sashimiMinimalAdsCount = [AppsfireAdSDK numberOfSashimiAdsAvailableForFormat:AFAdSDKSashimiFormatMinimal forZone:@"ZONE_ID"];
    NSLog("Number of Sashimi Minimal ads received:%lu", (unsigned long)sashimiMinimalAdsCount);

}
For a complete example of integration refer to the demo project dedicated to the Sashimi format. You can find it in the Xcode package of our SDK in examples/ folder.