question

dda avatar image
dda asked dda commented

App running in background crashes when a new employee is created/deleted

When our App is running in the background and the user creates or deletes an employee via the Clover Employee App, our App crashes and a message appears; "Unfortunately, App Name has stopped.". I am running adb logcat to try and pinpoint the error but thought I would see if others have experienced this issue.

Employees
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dda avatar image dda commented ·

I'm thinking this might be associated with an App Notification and Receiver that's triggered from the employee create/delete since we also use the app notification API. I guess ours just needs to be deactivated when the application is in the background.

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

If you could supply the stacktrace of the exception that caused your app to crash from logcat that would help.

0 Likes 0 ·

1 Answer

dda avatar image
dda answered dda commented

OK, so it was the appEvent "refreshmerchantprops" which was triggering the broadcastreceiver for my App and causing the crash. Is there a way that I can identify an App Notification being specifically for my App with intent.getStringExtra(), perhaps app ID? I am currently using both the appEvent and payload for passing data to my application. Are there other clover native notifications that could crash the App? For the time being, I will check to see if payload == null to identify a notification that isn't intended for my App.

2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

voski avatar image voski commented ·

You can change your appEvent to something unique and check for that before you execute code in your receiver.

0 Likes 0 ·
dda avatar image dda commented ·

we were planning on using dynamic data in both the event and payload to pass information to the App, but might be able to adjust so that the event is always identifiable.

0 Likes 0 ·

Welcome to the
Clover Developer Community