User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: How to monetize your MMF game with AdMob

  1. #1
    Clicker iOS Export ModuleSWF Export Module
    Giovanni_Cardona's Avatar
    Join Date
    Jun 2007
    Location
    San Juan, Puerto Rico
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to monetize your MMF game with AdMob

    Hello friends;

    Based on previous experiences on other apps I have on the AppStore, that uses AdMob to monetize my applications, I did this little research to add AdMob to MMF projects.
    This is a work in progress, and you should wait for other ClickTeam member to verify that this will not affect your game's performance, or add any tweak that must be done to make it work properly. So far this is working fine in my tests, but as you should already know, neither me or clickteam is responsible of any mishaps or lose of work (make backups!)


    // == To Start

    Im assuming you already have your AdMob publisher ID and downloaded the SDK.
    This documentation is based on a 3.1.3 Build (The MMF project was build for iPhone 4 but you can change the target build in the project properties)

    // ====== Framework Libraries

    Please read the AdMob documentation.
    The libraries included in this example are: AddressBook, AudioToolbox, MediaPlayer, MessageUI that wasn't included already (CoreGraphics and CoreLocation was already there)
    To include them in your project, under the "Targets" node, select your application name, and choose "GetInfo" option in the right right popup.
    In the "Target 'yourappname' Info" screen, go to the "General" menu, and under "Linked Libraries" section, with the "plus" button keep adding the libraries required for AdMob.

    // ==== AdMob Source code to include

    Please read the AdMob documentation.
    For this example Im using version 3.0 of AdMob SDK. There's an "AdMob" and "extras" folder.
    From the AdMob folder drop these two files into your XCode project:

    AdMobDelegateProtocol.h
    AdMobView.h

    From the extras folder drop these two files into your XCode project:

    libAdMobDevice3_0.a
    libAdMobSimulator3_0.a

    and rename them, erasing the "3_0" part like this:

    libAdMobDevice.a
    libAdMobSimulator.a

    Notice that these files already existed in the "AdMob" project, but these are supposed to be the 3.0 compatible ones.

    // ====== Code:

    ---- file RuntimeIPhoneAppDelegate.h

    After this line; #import "Application/CRunViewController.h" add these two:

    #import "AdMobView.h"
    #import "AdMobDelegateProtocol.h"

    in the interface declaration @interface RuntimeIPhoneAppDelegate : NSObject <UIApplicationDelegate> add AdMobDelegate, like this:

    @interface RuntimeIPhoneAppDelegate : NSObject <UIApplicationDelegate, AdMobDelegate>


    ---- file RuntimeIPhoneAppDelegate.m

    Just before the -(BOOL) application method and after the windows property declaration, add these two lines:

    RuntimeIPhoneAppDelegate* selfController;
    NSTimer* _timer;

    Inside the -(BOOL) application method, at the very first line before the appPath definition, add:


    selfController = self;

    Still in the -(BOOL) application method, just before returning with the value YES, add this 4 lines:


    AdMobView * ad = [AdMobView requestAdWithDelegate: selfController];
    ad.frame = CGRectMake(0, 0, 320, 48);
    [window addSubview:ad];
    _timer = [NSTimer scheduledTimerWithTimeInterval15.0) target: ad selector:@selector(requestFreshAd) userInfo:nil repeats:YES];


    just before the @end block of the RuntimeIPhoneAppDelegate implementation, add these two AdMob methods (using your publisher id):

    #pragma mark AdMobDelegate
    - (NSString *)publisherId;
    {
    return @"a14c48b5017d958";
    }
    - (BOOL)useTestAd;
    {
    return YES;
    }


    //NOTE: Remember to use your own AdMob published id!!!! Also, don't forget to change the return value to 'NO' in the useTestAd method when you finish your test and are ready to publish.

    //====== END

    This is it…. let me know if this works for you.

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    UrbanMonk's Avatar
    Join Date
    May 2008
    Location
    Southern U.S.A.
    Posts
    847
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    Wow, thanks, I'll test this as soon as I get a chance!

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Koji_Kabuto's Avatar
    Join Date
    Jul 2006
    Location
    Venezuela
    Posts
    2,847
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    Thanks Giovanni, how i can upload 3.1.3 Build in my Mac OS?, only appear IOS4...

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    In the Xcode project Build info scroll down to the Deployment settings and change the iOS Deployment Target to 3.1.3

    You shouldn't need to do this, unless you want to test on an older device (4.2 or under - 4.2 beta being the latest Xcode) using the latest iOS SDK.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Koji_Kabuto's Avatar
    Join Date
    Jul 2006
    Location
    Venezuela
    Posts
    2,847
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    I'm using the latest Xcode, and I do not see the Build 3.1.3, though old, I think there is still much that version installed base, at least in Latin America itself. How can I download this?

    Thanks RhysD and regards,

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    http://www.open-tutorial.com/2010/07/20/using-new-iphone-sdk-develop-old-iphone-app/

  7. #7
    Clicker iOS Export ModuleSWF Export Module
    Giovanni_Cardona's Avatar
    Join Date
    Jun 2007
    Location
    San Juan, Puerto Rico
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    Im using XCode 3.2.2 and I change the Base SDK where you can find the previous versions. You can go there by selecting the project info, and in the first GENERAL tab, go down to "Base SDK for all Configuration".
    Let me know if you can't find the SDK version there.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Koji_Kabuto's Avatar
    Join Date
    Jul 2006
    Location
    Venezuela
    Posts
    2,847
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    Thanks RhysD...

    Giovanni im using Xcode 3.2.3 and can´t find this version, only 3.2 and 4.0.

  9. #9
    Clicker iOS Export ModuleSWF Export Module
    Giovanni_Cardona's Avatar
    Join Date
    Jun 2007
    Location
    San Juan, Puerto Rico
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    Koji, I have been updating XCode since 2 years now, so probably that's why I have several versions.... Lets do some research to see if there's no problem to install previous SDK versions on the Mac (probably by uninstalling and installing from older to newer version). Is that possible, I think I still have some previous xcode installations that I can send to you.
    By the way, if you plan to do so, is time to make some Time Machine backups

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Koji_Kabuto's Avatar
    Join Date
    Jul 2006
    Location
    Venezuela
    Posts
    2,847
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: How to monetize your MMF game with AdMob

    Thanks Giovanni, but I'll try what I RhysD posting, I imagine that if you have the latest version of Xcode you can compile for any IOS, but debugging and simulator only be for IOS4. And compile with the procedure you wrote before but I could not upload it to my iPhone 2G.

    I notice that this works ...

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Best way to monetize game and are MTX possible yet for Android runtime?
    By Outcast in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 24th October 2013, 08:19 PM
  2. Using Admob
    By HadHaw in forum Android Export Module Version 2.0
    Replies: 13
    Last Post: 19th July 2013, 06:24 PM
  3. Are there any way of monetize the games?
    By Crls in forum Android Export Module Version 2.0
    Replies: 5
    Last Post: 9th April 2013, 04:20 PM
  4. AdMob
    By wesleyd in forum iOS Export Module Version 2.0
    Replies: 11
    Last Post: 13th February 2012, 07:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •