Getting rid of flashing red banner

Home Forums OpenEars Getting rid of flashing red banner

Viewing 11 posts - 1 through 11 (of 11 total)

  • Author
    Posts
  • #1020313
    Carm100
    Participant

    I use openears only when my app is active. I suspend it when in background.

    I still get red flashing iOS banner.

    How can I get rid of this?

    Thanks, Carmen

    #1020319
    Halle Winkler
    Politepix

    Welcome,

    That is an OS feature and not something which originates in OpenEars, so I don’t have any advice for you on that question. Sorry!

    #1020325
    Carm100
    Participant

    I have started a question on stack overflow with details of my efforts to stop listening before entering background mode, could you have a look and offer anything? Thanks.

    http://stackoverflow.com/questions/22003433/how-to-disable-iphone-app-not-active-flashing-banner?noredirect=1#comment33352072_22003433

    #1020326
    Halle Winkler
    Politepix

    Sorry, it’s only possible to monitor and participate in a single support channel per question.

    #1020327
    Carm100
    Participant

    Sorry, don’t understand that response, here is the issue:

    If I stop OpenEars pocketsphinxController from listening with a button that calls this method while the program is active, the banner disappears when the app loses focus:

    -(void) stopListening{
    NSLog(@”Tried to stop listening”);
    [pocketsphinxController stopListening];
    }
    BUT if I call the same method from my app delegate with (I had to import my view controller.h file in my app delegate.h and add -(void) stopListening; in my view controller.h to make the below execute properly):

    – (void)applicationWillResignActive:(UIApplication *)application{
    myViewController * vc = [[myViewController alloc]init];
    [vc stopListening];
    }
    The banner persists! It is a little like ios7 has decided I am a recording culprit before I even have a chance to turn it off. OR, am I even turning it off? How do I do this effectively and in what event?

    UPDATE – So it turns out I am not really turning pocketsphinxController off when ‘stopListening’ is called from the app delegate. I know this because it DOES log the ‘Tried to stop listening’ when called from app delegate but the pocketsphinxController does not respond with its ‘pocketsphinxDidStopListening’ method. PocketsphinxController does call its ‘pocketsphinxDidStopListening’ method when I call ‘stopListening’ from a button while the app is active.

    Why won’t the pocketsphinxController respond when called from from the app delegate, I must be doing it wrong?

    Thanks,Carmen

    #1020328
    Halle Winkler
    Politepix

    My response means that I can only pay attention to these forums, not these forums + stack overflow, because I don’t have a lot of available time. In this line:

    myViewController * vc = [[myViewController alloc]init];
    [vc stopListening];
    

    it looks as if you are calling stopListening on a UIViewController and not a PocketsphinxController.

    #1020329
    Carm100
    Participant

    Sorry for confusion, I am calling my (myviewcontroller stopListening) from my app delegate, which in turn calls (PocketssphinxController stopListening) from myviewcontroler where pockectsphinxcontroller resides. I will rename to differentiate better.

    #1020332
    Halle Winkler
    Politepix

    That’s OK, but it’s a view controller that you just created at a brand-new memory address, so even if it has a PocketsphinxController, it can’t be the same PocketsphinxController that is already running. You have to tell the PocketsphinxController which is running to stop. The time that you want to do that is before exiting the view controller it is instantiated in, so that it is possible for the view controller it is instantiated in to be released without ending up with a dangling pointer that can’t be released containing a PocketsphinxController that can’t be stopped.

    #1020333
    Carm100
    Participant

    I thought it might be something like that but when the only event I know of that tells me that my app is going into background is in my app delegate so I am left with a chicken and egg conundrum. Do you know of another event that gets triggered in my view controller that tells me I am about to go to background? or of a way to turn off the original pockesphinxcontroller from app delegate?

    #1020334
    Halle Winkler
    Politepix

    Your app delegate can communicate with your original PocketsphinxController-hosting view controller if it is a class property of the app delegate that continues to use the original instantiation through the life of the app. You can also see if the backgrounding event calls any of the OpenEarsEventsObserver delegate methods (you can have all or some of them in your view controller) and put a call to stopListening in one of them.

    #1020336
    Carm100
    Participant

    Thanks for suggestions but I think I will use this method unless you think it unwise.

    My app always has a timer running, so in my app delegate where I get notice of when app goes to inactive and comes back active, i just set global flags so my timer can know app active status. Then my timer just uses pockecsphinxcontroller methods to stop and start listening and voila, the banner is no more while app not active. Thanks, Carmen

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.