What is USeek?
The USeek interactive advertising solution turns your videos into engaging experiences full of rewards...
...Increasing viewer attention while searching your creative for objects.
USeek Library
USeek
library is designed to help developers easily add the enjoyable features of USeek in their own application.
Warning
- USeek utilizes the power of
safari
's interactive video feature, and this is only available from iOS 10.0 or later.
Requirements
USeek:-
Minimum iOS Target: iOS 10.0
Minimum Xcode Version: Xcode 8.0
Installation
From CocoaPods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like USeek
in your projects. First, add the following line to your Podfile:
pod 'USeek', :git => 'https://github.com/kronos317/USeek.git'
This pulls from the master
branch directly.
Second, install USeek
into your project:
pod install
Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate USeek
into your Xcode project using Carthage, specify it in your Cartfile
:
github "kronos317/USeekFramework"
Run carthage update
to build the framework and drag the built USeek.framework
(in Carthage/Build/iOS folder) into your Xcode project (Linked Frameworks and Libraries in Targets
).
Manually
- Drag the
kronos317/USeekFramework
folder into your project. - Take care that
USeek.framework
is added toTargets->Build Phases->Embeded Frameworks
.
Usage
(see sample Xcode project in /USeekDemo
)
There are 3 main classes.
- USeekManager
- USeekPlayerView
- USeekPlayerViewController
USeekManager
is singleton class, with which you can do the following actions
- Set / Retrieve publisher ID
- Request for the points of certain user
USeekPlayerView
and USeekPlayerViewController
classes are designed to load & play the embeded video in UIView or as a standalone UIViewController.
Set Publisher ID
[[USeekManager sharedManager] setPublisherId: @"{your publisher ID}"];
How to use USeekPlayerViewController
- Instantiate USeekPlayerViewController
USeekPlayerViewController *vc = [[USeekPlayerViewController alloc] init];
- Load video
[vc loadVideoWithGameId:@"{game id}" UserId:@"{user id, can be empty}"];
- Customize View Controller
[optional]
// show / hide `close` button
[vc setCloseButtonHidden:YES];
// customize loading text
vc.loadingTitleLabel.text = @"Please wait while loading video...";
// set delegate
vc.delegate = self;
- Present View Controller
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:vc animated:YES completion:nil];
});
- Get notified when USeekPlayerViewController is closed
[optional]
USeekPlayerViewControllerDelegate defines several useful delegate methods (optional), and one of them is useekPlayerViewControllerDidClose:
which will be called when the USeekPlayerViewController is closed.
- (void)useekPlayerViewControllerDidClose:(USeekPlayerViewController *)playerViewController{
// Do anything here
}
How to use USeekPlayerView
USeekPlayerView inherits UIView, thus you can directly add it in storyboard or add as subview programmatically.
- Add as a subview programmatically
USeekPlayerView *playerView = [[USeekPlayerView alloc] initWithFrame:CGRectMake(0, 0, 100, 60)];
[self.view addSubview:playerView];
- Add in storyboard
Just change the class name of the view to USeekPlayerView in storyboard. Now you can add the view as IBOutlet and use.
How to get points from server
By calling [[USeekManager sharedManager] requestPointsWithGameId:UserId:Success:Failure]
, we can get the points the user gained while playing the gamified video.
[[USeekManager sharedManager] requestPointsWithGameId:@"game id" UserId:@"user id" Success:^(int points) {
// Do anything here
} Failure:^(NSError *error) {
// Do anything here
}];
License
USeek is available under the USEEK license. See the LICENSE file for more info.