Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unable to Load" message in Today's Widget

I'm in between with my widget development. As we have already placed our app with widget integration. But in now a days, I'm facing problem with today's widget in iOS. I've written a code for two cases. First time when widget is initially loading first time with application launch it calls web-service and fetches data over the internet and then We store them into user default for later use.

Now when next time, user pull down the notification menu, we display our old stored content first to user and then we fetch it from web-service and store in user-default and then reloading table once again.

For above operation, I'm facing content size issue for table, flickering issue and "unable to load" message in some cases.

Now take a look for below code, I'm making a web-call in below method and after the response of web-service, I just handle completion handler.

- (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler {
    // Perform any setup necessary in order to update the view.
    // If an error is encountered, use NCUpdateResultFailed
    // If there's no update required, use NCUpdateResultNoData
    // If there's an update, use NCUpdateResultNewData
    [self getBookedAppointmentsNew:completionHandler];
}

So, please share your experience and ideas with me.

like image 541
Nilesh Prajapati Avatar asked Jan 23 '15 06:01

Nilesh Prajapati


1 Answers

In general I saw the "Unable to load" message whenever there was a crash in the widget. The widget tries to load itself and if it repeatedly crashes then it will just show the "Unable to load" message. Debug your widget and make sure nothing is causing it to crash

like image 163
RPM Avatar answered Sep 29 '22 18:09

RPM