junaio Plugin iOS
Integrate the junaio Plugin into your application
If you base your application on Junaio template application, you only have to adjust the channel ID and application identifier.
In case you wish to integrate the Junaio plugin into your own application, please follow these steps:
- Drag the junaio plugin folder into your Xcode project and select “Copy items into destination group’s folder” (if needed)
- The junaio plugin is a static Obj-C++ library. Therefore any files including JunaioPlugin headers must be compiled as Obj-C++. To achieve this, either rename the file extension to *.mm or set the appropriate defines in Xcode to compile the file as Obj-C++.
- Add the code to launch the ARViewController, e.g.:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ARViewController alloc] initWithNibName:@"ARViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
Note: if you initialize your ARViewController using initWithNibName, you need to set the pluginDelegate in viewDidLoad:
-(void) viewDidLoad
{
self.pluginDelegate = self;
[super viewDidLoad];
}
- Adjust the implementation of the JunaioPluginDelegate protocol in ARViewController with your channel ID.
- Add “-ObjC” to Other Linker Flags.
- Add the following frameworks / libs to the XCode project if not already present:
- libXML2.dylib, libz.dylib
- AVFoundation, CoreVideo, CoreFoundation, CoreGraphics, CoreLocation, CoreMotion, CoreMedia, MediaPlayer, CFNetwork, Security, AudioToolbox, SystemConfiguration, MobileCoreServices, OpenGLES, QuartzCore, MapKit, MessageUI
Upgrading from Junaio Plugin 1.0 to 3.1/3.5/3.6
The upgrade from Junaio Plugin 1.0 to 3.1/3.5 requires a few little changes that are described
here.
Integration Troubleshooting
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'metaio'
Please make sure that the file you are compiling is compiled as Obj-C++. For this you can either change the file extension of your file to *.mm or define 'Compile as Obj-C++' in your XCode project settings
The plugin does not cache the downloaded files
The delegate method getCacheTimeOfLifeInSeconds defines how long the cache keeps downloaded information. If you return 0, no caching will be used. In general it's advisable to set several days as cache time of life. (Note, the number has to be in seconds)
junaio Plugin Error Messages
Once you start the plugin in your application, certain error messages might be displayed:
- This application ([YOUR APPLICATION IDENTIFIER]) has not been registered yet. Please contact info@metaio.com
- This message will be shown, if the Application Identifier used with your junaio Plugin is unknown. Please contact us in order to register your junaio Plugin or submit a channel (see Create And Submit Your Channel). You can always trial your channel using the junaio Augmented Reality Browser
- The trial period for this application ([YOUR APPLICATION IDENTIFIER]) ended. Please contact info@metaio.com
- If you have been granted a trial period before purchasing the plugin, this trial period might end (usually after 2 weeks). After the trial period has ended, this message will be shown.
- This application ([YOUR APPLICATION IDENTIFIER]) accessed an unauthorized channel. Please contact info@metaio.com
- If your junaio Plugin application tries to access a channel, access has not been granted for, this message will pop up.
- If you are using the demo Application Identifier (com.yourapplication.Junaio-App) you can access two channels:
--
SupportMetaio - 2011-10-18