Use Kamcord on non Cocos2d app - ios

I am implementing according to kamcord tutorial :
https://github.com/kamcord/kamcord-ios-sdk/wiki/Getting-Started#wiki-kamcord-initialization
My app is a simple ios app not using the cocos2d game engine.
and for some reason I cannot see it working.
Here is the code implemented in app delegate :
_view_controller = [[ViewController alloc]init];
// Override point for customization after application launch.
// that will present the Kamcord UI.
[Kamcord setDeveloperKey:#"key"
developerSecret:#"secret"
appName:#"appName"
parentViewController:_view_controller];
and I call this methods from the viewController:
- (IBAction)stopRecording:(id)sender {
[Kamcord stopRecording];
NSLog(#"Stop");
}
- (IBAction)startRecording:(id)sender {
[Kamcord startRecording];
NSLog(#"Start");
}
-(IBAction)showUpKamcord{
[Kamcord showViewInViewController:self];
NSLog(#"kamcord");
}
First I start recording, then stop and after that I am showing the view,
any ideas?

Kamcord only works with OpenGL views. It does not record UIKit, so that won't work if that's what you're looking for.

I know this is an older question, but for those that stumble upon it looking for a solution to record your non-Open GL based screens, there is a project called ASScreenRecorder https://github.com/alskipp/ASScreenRecorder that allows you to record your UIKit based app screens and it's extremely simple to get working.

Related

iOS equivalent to Android registerActivityLifecycleCallbacks

I developed an Android app where I used the application.registerActivityLifecycleCallbacks (http://developer.android.com/reference/android/app/Application.html) to know when each Activity is started and stopped and record it for analytics purposes. I am now developing the iOS version and I cannot find an equivalent to this method to monitor the UIViewControllers or UIView displayed by the app.
Anybody has an idea ? I am a beginner on iOS so I may not be taking the right approach, feel free to suggest other ideas.
Edit
After the first answer I felt I should be more precise.
I am actually developing a SDK for other developers to include in their apps so I want the impact of the SDK on their code to be as small as possible.
I first thought about doing a BaseActivity/BaseUIViewController that developers would have to extend in all the Activity/UIViewController but it felt heavy and since both language don't allow multiple inheritance this would greatly impact their code. This is why the registerActivityLifecycleCallbacks method is great in Android because they only have to give me an Application or Activity object.
Is there a solution for iOS or I will have to create a BaseController ?
Thank you in advance.
I've not run into anything that specific as the application.registerActivityLifecycleCallbacks in iOS, but you could always implement your own using the methods that exist within the AppDelegate and each class.
From the AppDelegate, you are provided the methods to determine the state of the overall application such as determining when the application finished loading, when it enters the background, and so forth. Details on these states can be found in the UIApplicationDelegate Protocol Reference page.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
NSLog("Application did finish launching with options: %#", launchOptions);
return YES;
}
For each view controller, you can add your implementation to the individual view controller lifecycle methods within each file. Methods such as viewDidLoad, viewWillAppear, viewDidAppear, and viewDidLayoutSubviews are available.
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(#"View %# did load", self);
}

Flurry ads integration using SDK 6.0 creates performance issue app crashes

Hi I am using latest flurry SDK 6.0 in app. I need to show ads almost every where in my app. App is UINavigationControllerBased contains more viewControllers. I am using code given in flurry documentation.
I am using below code in each and every ViewController but some times I move fast just like push and pop before add received,so in that case callbacks are continuously receiving but that viewcontroller is not available in stack at that time app crash or recieve memory. I tried to set adDelegate to nil in viewWillDisappear but flurry documentation says don't set it as nil.
Anyone has any ideas regarading this?
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
if(self.adBanner == nil){
self.adBanner = [[FlurryAdBanner alloc] initWithSpace:#"Flurry Banner"] ;
self.adBanner.adDelegate = self;
[self.adBanner fetchAndDisplayAdInView:self.view viewControllerForPresentation:self];
}
}
Perhaps you should split the code in two?
Fetch the Ad using fetchAdForFrame. This prevents Flurry from using the view you passed.
Then inside the delegate, use displayAdInView. Only call this if you know the view is visible. So in viewWillAppear set a flag to say visible, in viewWillDisappear set a flag to say not visible. This should let you cut off the rendering part.
Seems odd an API like this would have no cancelFetchAd method!

iAD implementation using self.canDisplayBannerAds = YES;

After watching an Apple WWDC video I decided to implement iAd using
#import iAd
...
self.canDisplayBannerAds = YES;
which has been nice and simple and it displays test ads both in the simulator and on device. The Apple vid I saw said that's all we have to do, but the Apple iAd doc site says we have to implement delegate methods to handle tapping, failing to load, network connectivity issues and that Apps that don't do so will be rejected.
That strikes me as confusing, not least because the implementation above doesn't add a protocol to the class so that the delegate methods can be implemented.
Does anyone know where the up to date docs are that implement iAds this new way ? Or know authoritatively that we have to ignore what was said in the Vid and implement the delegate methods (though would they even be called?)?
I had the same issue. There doesn't appear to be a way to assign a delegate unless you use the old method (which defeats the purpose). My specific issue was an error I was getting when on another screen without Ads, which said that I wasn't handling the didFailToReceiveAdWithError and hadn't set a delegate. To fix this specific issue I simply enabled and disabled ads as the view appeared and disappeared. Like so:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear: animated];
// Setup iAd Banner Ads
self.canDisplayBannerAds = YES;
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear: animated];
// Disable iAd Banner Ads
self.canDisplayBannerAds = NO;
}

ads in universal app + ad persisting even when viewController changes

I'm implementing ads for the first time in an app that will be universal. I've followed a few tutorials and sorta|kinda have it working - using adWhirl, iAd, adMob. The tutorials were a bit simplistic though and I'm wondering if there are any open source universal ad template/library projects out there.
I've seen this and while helpful, the tutorial code is kind of broken/limited.
The specific questions I have (iOS5+ universal app):
In an app with a navController where the UIViewController can segue
multiple times to other controllers and then back again, do I need to
set up the ad stuff in each viewController or is there some way I
can have the ad layer/view persist across multiple VC views?
Ad sizes - In my test app, running on iPad I am getting ads but the
size is for iPhone. In adWhirl it didn't seem possible to specify
universal - only iPhone or Android. I've seen other iPad apps that seem to have a problem presenting ads because of the size - ads
appear in weird places, etc. Is there some universal solution to
the issue of ad sizes in universal apps?
For your first question, I would recommend that you use a singleton approach for your adView. You can find a similar singleton approach for an AdMob adView here. Tweaking that with your AdWhirl view instead shouldn't be bad at all. For each view that is displayed then, you could just do something like:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
shared = [AdWhirlMasterViewController singleton];
[shared resetAdView:self];
}
For your second question, I wonder if you can't just make some minor modifications to your adapter code to get iPad ads to show. So, for example, for AdMob adapter's getAd: method, you'd probably have something that looks like:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
adSize = kGADAdSizeLeaderboard;
} else {
adSize = kGADAdSizeBanner;
}
Then create your GADBannerView doing something similar to:
GADBannerView *view =
[[GADBannerView alloc] initWithAdSize:adSize];

IOS 5.0 jailbreak how to customize/block banner notifications

I was wondering, what header/function I have to hook into to customize or block banner notifications in iOS 5? I have tried many functions so far but none of them seem to work anymore.
Any help is truly appreciated.
THX!!
Try hooking - (void)_presentBannerForItem:(id)arg1 method within SBBulletinBannerController. If you are using Theos, then the following code snippet should prevent the banner notification from being presented. For more control, look into other methods in this class
#import <SpringBoard/SpringBoard.h>
%hook SBBulletinBannerController
- (void)_presentBannerForItem:(id)arg1
{
%log;
}
%end

Resources