IPhone application in the background

Is there a way to launch an audio or pop-up message from a closed iPhone application. Just how to "receive SMS"

+3
source share
3 answers

I don’t believe that. Apple said that third-party applications cannot run in the background (although some of them do this). This is why there was a big deal about push notifications last summer (since, unfortunately, this is not the case), this will allow the application to send some data from the server and then respond accordingly.

, , iPhone , , , .

+7

, , .

.

  • , , . . :

        id localNotif = [[NSClassFromString(@"UILocalNotification") alloc] init];
        if (!localNotif) {
            return;
        }
    
        [localNotif setTimeZone:[NSTimeZone defaultTimeZone]];
        [localNotif setAlertBody:NSLocalizedString(@"Hello!",nil)];
        [localNotif setAlertAction:NSLocalizedString(@"Hello", nil)];
        [localNotif setSoundName:UILocalNotificationDefaultSoundName];
        [localNotif setFireDate:[[NSDate date] addTimeInterval:(60*60)]];           
        [localNotif setFireDate:[[NSDate date] addTimeInterval:(24*60*60)]];
        [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
        [localNotif release];
    
  • ( ) ( ), push- ( Apple). , / . Apple iPhone, , . Urban Airship.

+7

, Apple push 3- . , , , ... , .

+1

Source: https://habr.com/ru/post/1702411/


All Articles