We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apptentive.addUnreadMessagesListener's success callback only gets fired after the user enters the message center.
Here is my setup code
init(userContact) { var apptentiveRegistration = { initialize: () => { document.addEventListener('deviceready', apptentiveRegistration.onDeviceReady, false); Apptentive.setPersonEmail( ()=> {this.jnLog.breadcrumb('apptentive user email registered'); }, ()=> {this.jnLog.breadcrumb('apptentive user email registration failed'); }, userContact.email); Apptentive.setPersonName( ()=> {this.jnLog.breadcrumb('apptentive user name registered'); }, ()=> {this.jnLog.breadcrumb('apptentive user name registration failed'); }, userContact._displayName()); }, onDeviceReady: () => { document.addEventListener('resume', apptentiveRegistration.onResume, false); document.addEventListener('pause', apptentiveRegistration.onPause, false); Apptentive.deviceReady( ()=> {this.jnLog.breadcrumb('apptentive device ready registered'); }, ()=> {this.jnLog.breadcrumb('apptentive device ready registration failed'); }); Apptentive.addUnreadMessagesListener( (messageCount) => { this.jnLog.breadcrumb('did enter apptentive message listener call back', messageCount); this.$rootScope.$broadcast(con.jn.eventApp.apptentiveMsgCount, messageCount); }, (error) => { this.jnLog.error('apptentive message count update error', error); } ); }, onResume: () => { Apptentive.resume( ()=> {this.jnLog.breadcrumb('apptentive resume registered'); }, ()=> {this.jnLog.breadcrumb('apptentive resume registration failed'); }); }, onPause: () => { Apptentive.pause( ()=> {this.jnLog.breadcrumb('apptentive pause registered'); }, ()=> {this.jnLog.breadcrumb('apptentive pause registration failed'); }); } }; apptentiveRegistration.initialize();
(written in typescript)
The text was updated successfully, but these errors were encountered:
👍
Sorry, something went wrong.
A way around this is to poll the plugin with this command :
setInterval(function() { Apptentive.getUnreadMessageCount(function(numMessages) { console.log(numMessages) }) }, 1000);
The issue happens also on Android. I was able to reproduce this issue when using:
Cordova Platform: 7.0.1 – 7.1.0+ Cordova Android Platform: 6.3.0+
@skykelsey is this a bug or should we use a setInterval in order to listen to changes in the unread messages count?
setInterval
Thanks 😃
No branches or pull requests
Apptentive.addUnreadMessagesListener's success callback only gets fired after the user enters the message center.
Here is my setup code
(written in typescript)
The text was updated successfully, but these errors were encountered: