NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

- (void)checkRatingStatus {
int showAlertInNewVersionAfterDays = 3;
int showAlertOnlyIfPastDays = 7;
int showAlertOnlyIfCanceledDays = 30;

int numberOfDaysBetweenCurrentVersionInstalledDate = (int)[self numberOfDaysBetweenCurrentVersionInstalledDate];
int numberOfDaysBetweenRateAlertCheckDate = (int)[self daysSinceDate:self.lastVersionRateCheckDate];

NSLog(@"%s InstalledDays:%d rateAlertDays:%d=%@",__FUNCTION__,numberOfDaysBetweenCurrentVersionInstalledDate,numberOfDaysBetweenRateAlertCheckDate,self.lastVersionRateCheckDate);
if(numberOfDaysBetweenCurrentVersionInstalledDate < showAlertInNewVersionAfterDays) { //Show after 3 days
NSLog(@"%s NO RATE as new version just installed let's wait 3 days",__FUNCTION__);
return;
}

//needs to check if current app insttaked is more then view alert then show 30 days otherwise 7 days
if(numberOfDaysBetweenRateAlertCheckDate < numberOfDaysBetweenCurrentVersionInstalledDate) {
NSString *isLastRateAlertCanceled = [[NSUserDefaults standardUserDefaults] valueForKey:@"lastRateAlertStatus"];
if(isLastRateAlertCanceled && [isLastRateAlertCanceled length] > 7 && [isLastRateAlertCanceled containsString:@"Cancel"] &&
numberOfDaysBetweenRateAlertCheckDate < showAlertOnlyIfCanceledDays ) {
NSLog(@"%s Already show rate alert in this version within 30 days rateAlertDays:%d Last Rate Alert Canceled:%@",__FUNCTION__,numberOfDaysBetweenRateAlertCheckDate,isLastRateAlertCanceled);
return;
} else if(isLastRateAlertCanceled && [isLastRateAlertCanceled length] > 3 && [isLastRateAlertCanceled containsString:@"YES"] ) {
NSLog(@"%s Already show rate alert in this version and user rate or feedback on it :%@",__FUNCTION__,isLastRateAlertCanceled);
return;
} else {
NSLog(@"%s Already show rate alert in this version before 30 days OR it's new let's show again rateAlertDays:%d",__FUNCTION__,numberOfDaysBetweenRateAlertCheckDate);
}
} else if(numberOfDaysBetweenRateAlertCheckDate < showAlertOnlyIfPastDays) {
NSLog(@"%s past version Already show rate alert within 7 days so avoid it rateAlertDays:%d",__FUNCTION__,numberOfDaysBetweenRateAlertCheckDate);
return;
}

self.lastVersionRateCheckDate = [NSDate date];
[[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:VIAppUpdateDefaultStoredRateCheckDate];
[[NSUserDefaults standardUserDefaults] synchronize];

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]
message:@"Oletko tyytyväinen sovellukseen?" //Do you like the app?
preferredStyle:UIAlertControllerStyleAlert];

[alertController addAction:[UIAlertAction actionWithTitle:@"Sulje" //Close
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self rateAlertCancelFrom:@"Cancel-LikeApp"];
}]];

[alertController addAction:[UIAlertAction actionWithTitle:@"Ei" //No
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
//Sorry you are not satisfied with the app, please give us feedback how to improve.

UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]
message:@"Harmi, ettet ole tyytyväinen. Kirjoita palautetta, jotta voimme parantaa tilannetta."
preferredStyle:UIAlertControllerStyleAlert];

[alertController addAction:[UIAlertAction actionWithTitle:@"Sulje" // (Close) /
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self rateAlertCancelFrom:@"Cancel-Feedback"];
}]];

[alertController addAction:[UIAlertAction actionWithTitle:@"Lähetä palaute" // (Send feedback)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self rateAlertCancelFrom:@"YES-Feedback"];
if ([MFMailComposeViewController canSendMail]) {

[[UIBarButtonItem appearance] setTintColor: [UIColor whiteColor]];
[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0xCC0303)];
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTranslucent:NO];

MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self.delegate;

NSDictionary *appDetail = [[NSUserDefaults standardUserDefaults] valueForKey:@"headerFields"];

NSString *strAppDetails = [NSString stringWithFormat:@"Sovellusversio: %@:v(%@) nLaite: %@ iOS:v(%@) nnOle hyvä ja anna alla palautetta sovelluksen kehittämiseksi:nnn",
[appDetail valueForKey:@"mobileAppName"],
[appDetail valueForKey:@"mobileAppVersion"],
[appDetail valueForKey:@"mobileDevice"],
[appDetail valueForKey:@"mobileOsVersion"]
];

[mail setSubject:@"Palaute Nettiauto-sovelluksesta"];
[mail setMessageBody:strAppDetails isHTML:NO];
[mail setToRecipients:@[@"[email protected]"]];
[_presentingViewController.tabBarController.selectedViewController presentViewController:mail animated:YES completion:NULL];
} else {
NSLog(@"This device cannot send email");
}
}]];


[_presentingViewController presentViewController:alertController
animated:YES
completion:nil];

}]];

[alertController addAction:[UIAlertAction actionWithTitle:@"Kyllä" //Yes
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {

UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]
message:@"Kiitos! Ole hyvä ja arvioi sovellus App Storessa"
//@"Thanks! Please rate us in App Store"
preferredStyle:UIAlertControllerStyleAlert];

[alertController addAction:[UIAlertAction actionWithTitle:@"Sulje" // (Close)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self rateAlertCancelFrom:@"Cancel-AppStore"];
}]];
[alertController addAction:[UIAlertAction actionWithTitle:@"Anna arvio" //Rate
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self rateAlertCancelFrom:@"YES-AppStore"];
[self launchAppStore];
}]];

[_presentingViewController presentViewController:alertController
animated:YES
completion:nil];
}]];



[_presentingViewController presentViewController:alertController
animated:YES
completion:nil];
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.