Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 79

LevensGardener
Aspiring developer
Profile
Posts: 220
Reg: Sep 30, 2012
Kendal
10,450
03/20/13 11:45 AM (12 years ago)

Flashlight plugin problems... (Mr David, are you there?)

The flashlight feature enabled for us by Mr David's great plugin is a really nifty extra for any app, and one which I have certainly put in my app- in for review right now. But... In anything but the simplest on/off, in screen use, it exhibits some strange behaviour. If you back out of the flashlight screen whilst it is still on, using the bottom menu tabs the light will stay on, but when you go back to the flashlight screen to turn it off, the on/off buttons are reversed. The on switches it off, while the off switches it on. Same sort of behaviour if you use the home button to escape. If you use the top back button to move to another screen, then return to the flashlight screen to turn it off, the light stays on however much you tap through the on off buttons. Only a home screen button push will get it to go off. A bit flakey really. Any suggestions for a code tweek or two to make it behave better? Thanks for any help... Chris
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/20/13 12:20 PM (12 years ago)
add this line of code just before the DEALLOC method -(void)viewDidDisappear:(BOOL)animated { [AVSession stopRunning]; }
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
03/20/13 02:05 PM (12 years ago)
Looks like Kittsy beat me to it. It seems there were a few too many bugs found with my "simple" flashlight app, the documentation that Susan has, along with the "checklist" for testing came out way after it's release. Had I those resources now, I'm sure we would have found these before the release :) 1.1 will have a slew of updates and fixes, so thanks for reporting another. And thanks for the Fix Kittsy, you rock. David https://buzztouchmods.com
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/20/13 02:06 PM (12 years ago)
No probs as always happy to help
 
LevensGardener
Aspiring developer
Profile
Posts: 220
Reg: Sep 30, 2012
Kendal
10,450
like
03/20/13 03:04 PM (12 years ago)
Thanks once again Kittsy- heroic of you! I just knew you couldn't resist a challenge. Also thanks Mr David for a great plugin- thats just got a whole lot greater. Chris
 
LevensGardener
Aspiring developer
Profile
Posts: 220
Reg: Sep 30, 2012
Kendal
10,450
like
03/21/13 09:40 AM (12 years ago)
I tried your fix Kittsy, and it has improved things. All is well now if you use the top bar back button. Also the light goes out as it should if you move away with a bottom tab bar button or the home button. The buttons still end up reversed though on returning to it after exiting with the light left on- after using anything other than that top back button. Thanks for your help though. I look forward to Mr David's final solution in the updated plugin... Cheers. Chris
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
03/21/13 11:28 AM (12 years ago)
I never tested the tab bar try adding this line of code at the end of the view did appear method under //setup navigation bar and background [BT_viewUtilities configureBackgroundAndNavBar:self theScreenData:[self screenData]]; [flashlightButton setBackgroundImage:[UIImage imageNamed:@"dv_on.png"] forState:UIControlStateNormal];
 
LevensGardener
Aspiring developer
Profile
Posts: 220
Reg: Sep 30, 2012
Kendal
10,450
like
03/21/13 02:23 PM (12 years ago)
Fixed completely Kittsy! Total respect is due to the awesome code charmer that is - Mr Kittsy! A thousand thanks... Chris
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
03/24/13 07:57 PM (12 years ago)
Hi Guys, Thanks AGAIN. I've attributed the fix to @Kittsy and the find to @LevensGardner in the updated code for .m file. I have sent in the update to @Susan. Cheers, David https://buzztouchmods.com
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.