Results 1 to 4 of 4
Discuss 2.1 and UIApplication daemons at the iPhone Developer Exchange - Hackint0sh.org; Hi there, I'm working on a project where I have a Daemon running once a ...
  1. #1
    Rookie Array

    Join Date
    May 2008
    Posts
    15
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default 2.1 and UIApplication daemons

    Hi there,

    I'm working on a project where I have a Daemon running once a minute, logging my position. All was well on firmware 2.0.2, but I believe Apple may have added a feature to wake up the screen if an app runs while the phone is sleeping (something to do with the push notification feature?).

    My daemon depends on being a location-delegate, so I need to call the UIApplicationMain function to keep the app running, while the GPS does its work. But when I do this, the phone wakes up and beeps / vibrates.

    Snipped version of my main.m:

    int main(int argc, char *argv[])
    {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    Logger *logger = [[Logger alloc] initWithUser:[[NSUserDefaults standardUserDefaults] stringForKey:@"user"]];
    [logger updateLog];
    retVal = UIApplicationMain(argc, argv, nil, nil); // This is where the phone wakes up and goes beep
    [pool release];
    return retVal;
    }

    Would anyone know how to keep an application more daemon'y so the phone doesn't think I'm trying to tell the user something?

    Thanks in advance, and thanks for a great site/forum!

    -TB



  2. #2
    Rookie Array

    Join Date
    Aug 2008
    Posts
    12
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    sounds similar to something i'm working on with the GPS stuff I'm not sure you need the UIApplicationMain do you? I'm guessing you're just using the CLLocationManager. Could you not just create a small app that you start from within your main app as a background process using fork/exec? I haven't got to that part of my app, but i've asked around on other forums and that's the direction i've been pointed.

  3. #3
    Rookie Array

    Join Date
    May 2008
    Posts
    15
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    If I don't call the UIApplicationMain, the location manager never returns any result. ..may be something runloop specific, I don't know :/

    Thanks for the fork/exec angle - I'll try and play around with that, although I think this would just push the problem into the other background process instead. My app is a background process - and everything works just fine ..except it wakes up the screen everytime it runs (but only on OS 2.1).

  4. #4
    Rookie Array

    Join Date
    Aug 2008
    Posts
    12
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    strange. I haven't gone to 2.1 yet. Sounds like it's going to add more pain...

 

 

Similar Threads

  1. daemons and launchctl
    By tracstarr in forum iPhone Developer Exchange
    Replies: 3
    Last Post: 02-01-2009, 06:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 04:30 AM.
twitter, follow us!