Before You Start Make Sure:
- at least one App and Placement set up on Publisher Portal
- SDK is installed
- SDK is initialized
- placements have status "Testing" in order to test integration receiving test ad for each request
Infeed is associated with an UIView. This UIView has translatesAutoresizingMaskIntoConstraints equal to NO, so it can work with constraints by default.
In order to get Infeed UIView use:
In order to obtain Infeed height when it fills the top view-controller's width:
[[ad view] height];
In order to control if Infeed is displayed with full-width (i.e. without margins), proceed as follows before calling [adRequest requestAdWithAdReceivedHandler...]:
((DIOInFeedPlacement*)placement).fullWidth = YES;
In order to control if Infeed (video only) is displayed with top and bottom frames, proceed as follows before calling [adRequest requestAdWithAdReceivedHandler...]
((DIOInFeedPlacement*)placement).framed = YES;
In order to control Infeed behaviour in case of switching between screens:
- Call [ad finish] to stop the ad and release the resources associated with it.
- Call [ad leave] to pause the video ad.
- Call [ad reenter] to resume the video ad.
In order to detect if Infeed was clicked, subscribe to the <DIOAdClickDelegate> protocol and then define yourself as a delegate via:
ad.clickDelegate = self;
Finally implement the following to be notified whenever relevant:
See the Sample App for a fully-working example.