Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Proper Use Of Ti.Contacts Reload Event

$
0
0

The application I have developed requires a customized contacts list built by calling:

Ti.Contacts.getAllPeople();
Because some users have duplicate contacts, multiple linked contacts I de-duplicate the list and store a copy of the contacts with the app. This makes getting the contacts list much faster.

However, I need to listen for changes to the contacts and fire off an update to the cached list - most typical is someone adding a contact on-the-fly when using the app.

I have implemented the following in app.js

Ti.Contacts.addEventListener('reload', function(e) { ... });
It works just fine until the app is 'swipe quit'. In other words if:

-- Launch app, go to contacts, change contact, go back to app, event is fired just fine

At any point in time, quitting the app seems to consume the event listener and it will never work again until the app is deleted and reinstalled -- regardless of whether the event listener is added.

Is this a bug or do I not understand how / where / when to use this feature. I have attempted what seems to be nearly every combination of code on the device and simulator to figure out why this occurs.

Mobile iOS, Titanium 3.5.1


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>