Wednesday, December 19, 2012

[IPHONE] How to create More App Screen for your app?

Step 1:

Go to link: https://www.chartboost.com/support/sdk_download/?os=ios and add Chartboost folder to your project.

Step 2:

Add framework to your project: QuartzCore, SystemConfiguration,CoreGraphics,
 AdSupport and StoreKit frameworks.
Note: AdSupport is Optional
Step 3:
//-----> Add follow code to your - (void)applicationDidBecomeActive:(UIApplication *)application <-----//
Chartboost *cb = [Chartboost sharedChartboost];
    
    // Add your own app id & signature. These can be found on App Edit page for your app in the Chartboost dashboard
    cb.appId = @"YOUR_CHARTBOOST_APP_ID";
    cb.appSignature = @"YOUR_CHARTBOOST_APP_SIGNATURE";
    
    cb.delegate = self;
    
    // Begin a user session. This should be done once per boot
    [cb startSession];
    
    // Cache an interstitial at the default location
    [cb cacheInterstitial];
    
    // Cache an interstitial at some named locations -- recommended!!
    [cb cacheInterstitial:@"Main Menu"];
    [cb cacheInterstitial:@"After level 1"];
    
    // Once cached, you can use showInterstitial at any point in your app to display the interstitial immediately
    
    
    // Cache the more apps page so it's ready & loaded
    [cb cacheMoreApps];

Dont't forget.. 
//--> At AppDelegate.h <--
#import "Chartboost.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, ChartboostDelegate>

Step 4: At method action for button "More App",  add code:

//------------

[[Chartboost sharedChartboost ] setDelegate:self];
    [[Chartboost sharedChartboost] showMoreApps];
//------------

Don't forget: (At ViewController contain button More App --> Example: MoreAppViewController

//----->   MoreAppViewController.h <-------
#import "Chartboost.h"
@interface MoreAppViewController : UIViewController<ChartboostDelegate>

//-----> Add two method to  MoreAppViewController.m <-------
- (BOOL)shouldDisplayMoreApps
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
    return YES;
}

- (void)didCloseMoreApps
{
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
}

==>>>> Enjoy it!



1 comment: