IOS 5.0 jailbreak how to customize/block banner notifications - ios

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

Related

How to remove 3D touch quick action thats added using swift code

I have started playing with 3D touch quick actions for my app for iPhone 6S using code from apples developer site
This worked fine, but now i am unable to remove these quick actions.I only made changes to AppDelegate and I have removed this sample code from AppDelegate but quick actions still remain. Info.plist does not have any quick actions. Any ideas?
If you removed the code, than just delete app from your phone and rerun it.
If you need to do it programmatically for any reason, just call this function
func removeAllDynamicQuickActions() {
UIApplication.shared.shortcutItems?.removeAll()
}

Detect when iOS breadcrumbs are used to return to app

I can't find information about how to detect when the iOS breadcrumbs are used to return to the app. I am looking to call a function on the controller when the view is active again specifically when this breadcrumb is used (Our use case being when location has been enabled externally).
I have tried using viewDidAppear but this isn't called. Is it possible? I find it unusual that this isn't called.
To be clear the breadcrumbs I am talking about are
I think you can use this method on Appdelegate
- (void)applicationDidBecomeActive:(UIApplication *)application {
}
then send a notification to your viewcontroller you want to handler.

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!

Use Kamcord on non Cocos2d app

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.

Resources