Jump to content

Need help with MS - Alerts


Go to solution Solved by Chrizk0,

7 posts in this topic

Recommended Posts

Posted (edited)

This is what I have and it pop up the alert during launch of the app, but only once. What I want is to popup everytime the player launch the app.
 

          
hidden void setAlertInfo(const char *alertTitle, const char *alertMessage) {
              
title = alertTitle;
theMsg = alertMessage;
}
          
- removed -

UIAlertView *av = [[UIAlertView alloc] initWithTitle:CNCString(title) message:CNCString(theMsg) delegate:nil cancelButtonTitle:@"Thank You" otherButtonTitles:nil];
[av show];
[defaults setBool:YES forKey:@"alertShown"];
    }
}
Updated by DiDA
Posted

try this

hidden void setAlertInfo(const char *alertTitle, const char *alertMessage) {
              
title = alertTitle;
theMsg = alertMessage;
}
          
hidden void didFinishLaunching(CFNotificationCenterRef center,void *observer,CFStringRef name, const void *object, CFDictionaryRef info) {
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];

UIAlertView *av = [[UIAlertView alloc] initWithTitle:CNCString(title) message:CNCString(theMsg) delegate:nil cancelButtonTitle:@"Thank You" otherButtonTitles:nil];
[av show];

}
  • Solution
Posted (edited)

This is it.

 

%hook AppDelegate

-(BOOL)application:(id)fp8 didFinishLaunchingWithOptions:(id)fp12 {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title"
message:@"Message" delegate:nil cancelButtonTitle:@"Close"
otherButtonTitles:nil];

[alert show];
[alert release];

return %orig;
}

%end
Updated by Chrizk0

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