iAd Addons has an error when running?

I’m running my code with the new iAd add ons from here- https://github.com/TwoLivesLeft/Codea-Addons -
I get the following returned

Undefined symbols for architecture arm64:
OBJC_CLASS$_ADBannerView”, referenced from:
objc-class-ref in iAdsAddon.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Why?

In Xcode on the left side where you have all of your project files like main.lua, Add-Ons, etc. you have to click the file at the very top named after your app (will say “1 target, iOS SDK 8.1” under the project name). Then go under the general tab, scroll to the bottom, click the plus sign, and add the iad framework.

You will also have to add a few lines to your AppDelegate.mm file. Here is how mine looks for one of my games. Basically you are doing #import for the iAds add on, and another line in the middle is registering the add on.


#import "AppDelegate.h"

#import "StandaloneCodeaViewController.h"

#import "GameCenterAddon.h"

#import "IAdsAddOn.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
    NSString* projectPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"AppNameHereNoSpaces.codea"];
    
    self.viewController = [[StandaloneCodeaViewController alloc] initWithProjectAtPath:projectPath];
    
    [self.viewController registerAddon:[iAdsAddon sharedInstance]];
    
    //Uncomment the following line if you'd like to use the basic GameCenter addon:
    //[self.viewController registerAddon:[GameCenterAddon sharedInstance]];
    
    //See GameCenterAddon.h for the Lua API description.
    
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
}

- (void)applicationWillTerminate:(UIApplication *)application
{
}

@end


@Crumble got 17 errors when running with changes

If you copy and pasted my code above, on line 12 or so you inserted your project name where it says “AppNameHereNoSpaces” in the AppDeletegate.mm?

Basically, after a fresh export from codea, I open the project in Xcode 6, drag both of the iAds addon files under the Extra folder in the project, making sure to check create groups, and check the box next to the apps name in add to targets list. Then I copy and paste the above code into my AppDelegate.mm and change the AppNameHere line to my project name.

Then all you have to do is select the project sdk file on the left on top, under general tab I add iads framework. Next still under general tab choose your team so it finds your provisioning profile (says fix issue or find profile or something, right under version number). Next in the info tab change Bundle name to your App name (with spaces), Bundle identifier to your bundle identifier “com.xxxxxxxxxx.appname”, then Bundle display name to your app name (with spaces).

After the above its ready to submit.

You submit by making sure its set to iOS device on the top toolbar, then click product on the top menu bar, select archive, then distribute. Then just complete the next little things like choosing provisioning profile, and click submit and it submits to apple.

It sounds complicated, but once you do it correctly once it is easy. Takes about 5 minutes to do.

I really need to finish the tutorial I started on for submitting.

i encourage you to finish the tutorial asap!

i hope simeon will soon implement the optional inclusion of the addons when exporting the project to xcode. it should financially benefit twolivesleft if there were more codea based games advertising the power of codea on the app store.

@Crumble submitting isn’t too bad. I’ve done it before, but not for a while and not with the new iAd files. I do think you should finish the tutorial though :)>-