freshworks / mobihelp-android

MIT License
15 stars 13 forks source link

Mobihelp.getUnreadCount does not update until after calling Mobihelp.showSupport #4

Closed mmcmahon-jana closed 10 years ago

mmcmahon-jana commented 10 years ago

During testing of the getUnreadCount call, it appears the the count remains fixed at what the number was the first time it is called inside the application. To reproduce, I am starting a support conversation and sending at least one reply. Then I relaunch my app, the getUnreadCount returns 1 at this point. I send another reply to the support request. Repeated calls to getUnreadCount still return 1 until I actually click the support link that launches Mobihelp.showSupport.

hrishikesh-p commented 10 years ago

getUnreadCount returns the last updated count from when the app was launched or when support was launched in the app .

Please use getUnreadCountAsync ( added in v1.0.1 ) to get the latest count always. You can reference the code in the sample

https://github.com/freshdesk/mobihelp-android/blob/master/MobihelpCustomThemeDemo/src/com/example/mobihelp/customthemedemo/MainActivity.java

or refer gist here

https://gist.github.com/hrishikesh-p/747cc6c1990e00c457fa

mmcmahon-jana commented 10 years ago

Thanks