user1134473
user1134473

Reputation: 11

Calling a SpringBoard method on iOS

I am developing a tweak and I've got a problem. I created a PreferenceBundle and in the bundle I need to call a SpringBoard method, but the results is always null. Is there a way I can call an SBApplication method?

SBApplication *app =[[objc_getClass("SBApplicationController") sharedInstance] applicationWithDisplayIdentifier:identifier];

Upvotes: 1

Views: 2768

Answers (1)

DShah
DShah

Reputation: 9866

This link will give you some insight of how to use PreferenceBundle in iPhone...

http://www.skylarcantu.com/blog/2009/08/12/creating-a-preferencebundle-for-the-iphone/

http://iphoneincubator.com/blog/tutorial/how-to-create-an-iphone-preferences-file

EDIT :

Can you try this code :

Class SBApplicationController = objc_getClass("SBApplicationController");
    id controller = [SBApplicationController sharedInstance];
    for (NSString *appId in [controller allBundleIdentifiers]) { 
        NSLog ([NSString stringWithFormat:@"bundle: %@", appId]);
        NSArray *apps = [controller applicationsWithBundleIdentifier:appId];
        if ([apps count] > 0) { 
            id app = [apps objectAtIndex:0]; 
            [self indexApp:app withName:[app displayName]];
        }
    }

or try below link...

http://pastebin.com/dQK5AXjD

Upvotes: 3

Related Questions