Jump to content

UIAlertView with a link [tweak only]


Go to solution Solved by Cyber X,

30 posts in this topic

Recommended Posts

Posted



%hook FraggerAppDelegate
- (BOOL)application:(id)fp8 didFinishLaunchingWithOptions:(id)fp12 {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Credits"

                                                    message:@"Example by castix"
                                                   delegate:self
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:@"Website",nil];
    [alert show];
}

%new
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    NSString *title = [alertView buttonTitleAtIndex:buttonIndex];
    if([title isEqualToString:@"Website"])
    {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://iosgods.com"]];
    }
}
%end


Posted

I fixed it I messed around removing stuff and the problem with the link not opening was I had to remove the %new then I ran it and it opened in no time :)

 

That's you for the help

@DiDA

@@castix

Posted

Want to share the final result incase someone else has the same problem?

 

@

Posted

@@DiDA

%hook FraggerAppDelegate
- (BOOL)application:(id)fp8 didFinishLaunchingWithOptions:(id)fp12 {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Credits"

                                                    message:@"Example by castix"
                                                   delegate:self
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:@"Website",nil];
    [alert show];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    NSString *title = [alertView buttonTitleAtIndex:buttonIndex];
    if([title isEqualToString:@"Website"])
    {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://Google.com"]];
    }
}
%end
  • Solution
Posted (edited)

Code In my tweak

%hook FraggerAppDelegate
-(void)applicationDidBecomeActive:(id)arg { 
UIAlertView *credits = [[UIAlertView alloc] initWithTitle:@"Fragger Hacked Successfully" 
                                                  message:@"Hacked by L33TPr0xY from iOSGods.com!!" 
                                                 delegate:self 
                                        cancelButtonTitle:@"Close" 
                                        otherButtonTitles:@"iOSGods", nil]; 
[credits show];
[credits release]; 
%orig;
}
 

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
 
NSString *credits = [alertView buttonTitleAtIndex:buttonIndex];
 
        if([credits isEqualToString:@"iOSGods"])
        {
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://iOSGods.com"]];                                                                                
        }
}
%end 
Updated by L33TPr0xY
Posted (edited)

So I spiced up my alert and I have 3 buttons one in cancelbutton and two in otherbutton

How can I link the 2 otherbuttons to diffrent links? @"iOSGods" , @"Credits" , nil]

Linking one to the site an the other to a members page

Updated by L33TPr0xY

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