Jump to content

UIAlertView with a link [tweak only]


Go to solution Solved by Cyber X,

30 posts in this topic

Recommended Posts

Posted (edited)

Add this to your tweak.xm:

%hook SexyApplicationDelegate

 

-(void)applicationDidBecomeActive:(id)arg {

 

UIAlertView *credits = [[UIAlertView alloc] initWithTitle:@"Title of the popup"

message:@"Hacked by l33tproxy for iOSGods.com!!"

delegate:self

cancelButtonTitle:@"Close"

otherButtonTitles:@"Visit Us", nil];

[credits show];

[credits release];

%orig;

}

 

%new

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {

 

NSString *credits = [alertView buttonTitleAtIndex:buttonIndex];

 

if([credits isEqualToString:@"Visit Us"])

{

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iOSGods.com/"]];

}

}

%end

Don't forget to add:

test_FRAMEWORKS = UIKit

in makefile.

Updated by castix
Posted

Doesn't work DiDA.

 

At the start you declared it with credits and in the implementation with button.

 

This will cause the following:

 

If button = do alert ; but you can only click credits so it won't do anything

Posted

This:

 

%hook AppDelegate
-(void)applicationDidBecomeActive:(id)arg { 

UIAlertView *credits = [[UIAlertView alloc] initWithTitle:@"Smule AutoRap Cheats" 
					          message:@"Hacked by L33T for iOSGods.com!" 
                                                 delegate:self 
  					cancelButtonTitle:@"Close" 
  					otherButtonTitles:@"Visit Us", nil]; 
[credits show];
[credits release]; 
%orig();
}
 
%new
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
 
NSString *button = [alertView buttonTitleAtIndex:buttonIndex];
 
	if([button isEqualToString:@"Visit Us"])
	{
		[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iOSGods.com/"]];                                                                                
	}
}
%end
 
I'm on phone so give it a try and let me know. :)
Posted

:facepalm: im so lost now whats right whats wrong? lol this is why iv asked for someone to show me on tv its way faster and use can actually see whats wrong 

Posted

not working

Did you change the app delegate???

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines