Custom HTTPUtils service JobDone Callback problem

Kevin

Well-Known Member
Licensed User
Longtime User
I use several custom variations of the HTTPUtils service in my app and have run into a recent problem.

If need be, I will try to post some code but it's a bit complicated.

For now, I am just wondering if anyone would know what would cause the callback event in the main activity to not fire until the app is restarted (such as rotating the device).

The service works fine, but I never get the callback notification, until of course, I rotate the phone. :confused:

All other callbacks work fine for my other custom services so something must be funny with this one. It does use timer delays in it, but so does another custom service and I don't have this issue.

And yes, the Callback sub is declared correctly and the sub itself is named the same. :)

Any ideas?
 

Kevin

Well-Known Member
Licensed User
Longtime User
I added a toast message to show the status of the main activity but it doesn't show (called from the activity). It shouldn't be paused though, as the service gets called from a button in the main activity and the service does its thing in a second or two. It is only this service that gives me this problem.

I am going to have to start tearing it down a bit, but I did notice that I am seeing the following in the log:

Ignoring event as service was destroyed.

I assume this could be referring to the callback event? If so, it is strange that it says it was ignored, yet triggers the callback anyway after I rotate. I have a toast message in the callback sub for testing, which is how I know it doesn't fire until after rotating. Strange indeed. :)
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
Well, I'm making some progress but I am even more baffled.

I know this callback used to work months ago so after some thinking, I decided to try compiling WITHOUT obfuscation and suddenly it worked as expected.

What could be tripping it up?

Service name: MacroBlasterService
Service companion module name: MacroBlaster

MacroBlaster.CallbackActivity = "Main"
MacroBlaster.CallbackJobDoneSub = "JobMBDone"

I've tried changing the names of some things but it always fails with obfuscation enabled.
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
Funny! I just did exactly that and it worked and I came back to mention it and saw your post.

Okay, so what I don't understand now is that:

"JobMBDone" did not work. However, the original HTTPUtils callback job done sub "JobDone" does work with obfuscation enabled.

Why?
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
Thanks for clearing that up! I couldn't figure that out but your explanation makes perfect sense. :)
 
Upvote 0
Top