NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

-(void)showPopWithTxt :(NSDictionary *) dict {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *ecg_pop_message_status=[self getValueFrom:dict for:@"pop_message_status"];
NSString *ecg_pop_message=[self getValueFrom:dict for:@"pop_message"];
NSString *ecg_pop_message_count=[self getValueFrom:dict for:@"pop_message_count"];
NSString *ecg_pop_message_created_by=[self getValueFrom:dict for:@"pop_message_created_by"];
NSString *ecg_pop_message_id=[self getValueFrom:dict for:@"pop_message_id"];
NSString *ecg_pop_message_modified_by=[self getValueFrom:dict for:@"pop_message_modified_by"];
NSString *ecg_pop_message_modified_on=[self getValueFrom:dict for:@"pop_message_modified_on"];

// save date in session


NSString *oldDate = [defaults stringForKey:@"def_ecg_pop_message_modified_on"];

if([oldDate length] == 0)
{
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
// or @"yyyy-MM-dd hh:mm:ss a" if you prefer the time with AM/PM
oldDate = [dateFormatter stringFromDate:[NSDate date]];

}
NSString *unfilteredString = ecg_pop_message_modified_on;
NSCharacterSet *notAllowedChars = [[NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890:- "] invertedSet];
NSString *resultString = [[unfilteredString componentsSeparatedByCharactersInSet:notAllowedChars] componentsJoinedByString:@""];
NSLog (@"Result: %@", resultString);


NSString *fullDate = resultString;
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *date = [dateFormat dateFromString:fullDate];
NSTimeInterval timeInMiliseconds = [date timeIntervalSince1970]*1000;

// local date
NSString *unfilteredString1 = oldDate;
NSCharacterSet *notAllowedChars1 = [[NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890:- "] invertedSet];
NSString *resultString1 = [[unfilteredString1 componentsSeparatedByCharactersInSet:notAllowedChars1] componentsJoinedByString:@""];
NSLog (@"Result: %@", resultString1);


NSString *fullDate1 = resultString1;
NSDateFormatter *dateFormat1 = [[NSDateFormatter alloc] init];
[dateFormat1 setDateFormat:@"yyyy-MM-dd HH:mm:ss"];

NSDate *defdate = [dateFormat1 dateFromString:fullDate1];
NSTimeInterval timeInMiliseconds1 = [defdate timeIntervalSince1970]*1000;//timeInMiliseconds1 NSTimeInterval 1534491849000
//timeInMiliseconds NSTimeInterval 1534423470000 1534491849000
//2018-08-17 07:44:09
if ( timeInMiliseconds1 < timeInMiliseconds)
{
[defaults setObject:@"0" forKey:@"popupcont"];

}

if([ecg_pop_message_status isEqualToString: @"1"])
{
NSString *oldpopCount = [defaults stringForKey:@"popupcont"];
NSInteger defpopcount = [oldpopCount integerValue];
NSInteger currentpopcount = [ecg_pop_message_count integerValue];
if(defpopcount < currentpopcount)
{
_webViewPopup.hidden = false;
_popUpView.hidden = false;

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSString *embedHTML = ecg_pop_message; dispatch_async(dispatch_get_main_queue(), ^{
_webViewPopup.backgroundColor = [UIColor whiteColor];
_webViewPopup.delegate = self;
_webViewPopup.userInteractionEnabled = YES;
_webViewPopup.opaque = NO;
[_webViewPopup loadHTMLString:embedHTML baseURL: nil];
});
});

// NSAttributedString *authorStr = [[NSAttributedString alloc] initWithData:[ecg_pop_message dataUsingEncoding:NSUTF8StringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute:@(NSUTF8StringEncoding)} documentAttributes:nil error:nil];

NSInteger updatedCount = defpopcount + 1;
NSString* ucount = [NSString stringWithFormat:@"%ld",(long)updatedCount];
[defaults setObject:ucount forKey:@"popupcont"];
[defaults setObject:ecg_pop_message_modified_on forKey:@"def_ecg_pop_message_modified_on"];
}
else{
_webViewPopup.hidden = true;
_popUpView.hidden = true;
}
}
else
{
[defaults setObject:@"0" forKey:@"popupcont"];
}


}
     
 
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.