Skip to content

Mikanek/TAPromotee

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TAPromotee

TAPromotee is a pod that allows you to show a cross promotion to a iOS app just by supllying its App Store id. It automatically fetches the info about the app using the iTunes API:

  • App Name
  • App Icon
  • Screenshot

When the user taps the install button, the SKStoreProductViewController is presented.

Requirements

  • ARC only
  • iOS 8.0+
  • iPhone
  • Portrait orientation

Install

TAPromotee is available through CocoaPods, to install it simply add the following line to your Podfile:

pod 'TAPromotee'

Usage

To run the example project run pod try TAPromotee. Or go manual way: clone the repo.

Here's an example of how you should use TAPromotee.

#import "TAPromotee.h"
[TAPromotee showFromViewController:self 
                             appId:822702909 
                           caption:@"Sun clock in your pocket" 
                        completion:^(TAPromoteeUserAction userAction) {
    switch (userAction) {
        case TAPromoteeUserActionDidClose:
            // The user just closed the add
            NSLog(@"User did click close");
            break;
        case TAPromoteeUserActionDidInstall:
            // The user did click on the Install button so here you can for example disable the ad for the future
            NSLog(@"User did click install");
            break;
    }
}];
    

If you don't want to use the App Store screenshot as background, you can supply a custom background image

[TAPromotee showFromViewController:self
                             appId:937151343
                           caption:@"Your Battlefield soldier's companion"
                   backgroundImage:[UIImage imageNamed:@"sample-app-background"]
                        completion:^(TAPromoteeUserAction userAction) {
    switch (userAction) {
        case TAPromoteeUserActionDidClose:
            // The user just closed the add
            NSLog(@"User did click close");
            break;
        case TAPromoteeUserActionDidInstall:
            // The user did click on the Install button so here you can for example disable the ad for the future
            NSLog(@"User did click install");
            break;
    }
}];

Screens

Here is how it looks like

Author

Jan Chaloupecky, jan.chaloupecky@gmail.com

License

TAPromotee is available under the MIT license. See the LICENSE file for more info.

Changelog

See the release section

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 78.6%
  • Shell 15.9%
  • Ruby 3.4%
  • C 2.1%