Hi
When using the RadListView to display messages received through firebase notifications, I find that, only on IOS, the view is crashing if I initialize the observable array and then push items into it. For example in my code the items property in RadlistView is bound to messagesForView. If I push content into messages for view as shown below the view crashes on IOS:
public ngOnInit() {
this
.messagesForView =
new
ObservableArray();
if
(
this
.firebaseMessagingService.getMessages() !== undefined) {
console.log(
"old messages"
+
this
.firebaseMessagingService.getMessages());
this
.messagesForView.push.apply(
this
.messagesForView, (JSON.parse(
this
.firebaseMessagingService.getMessages())));
}
}
Instead if I push the messages into an array and then create a new observable array with those messages the view does not crash (shown below)
if
(
this
.firebaseMessagingService.getMessages() !== undefined) {
console.log(
"old messages"
+
this
.firebaseMessagingService.getMessages());
//get the messages
const savedMessages = JSON.parse(
this
.firebaseMessagingService.getMessages());
this
.messagesForView =
new
ObservableArray(savedMessages);
}
however in this case when a new message is sent from firebase the view will not update automatically in both IOS and also on android. This happens correctly in Android if I use the first approach of pushing the new messages into the ObservableArray.
I would like to be able to use the RadListView in a way that it does not crash on IOS and also updates automatically each time a new message is received. Please advise on how I can get the RadListView to work?
Thank You