The following code usually works, but when you try to block the connection to the SSL port (-9806) is canceled.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler { NSString *roomID = [userInfo objectForKey:@"roomId"]; if (roomID) {
Now basically updateChatRoomMessages is trying to talk to firebase, but I assume the problem is with some kind of network connection. Is there any sort restriction known?
Any ideas?
Update - the rest of the code
(void)updateChatRoomMessages:(NSString *)roomID withBlock:(void (^)(BOOL))completionBlock{ ChatRoomSummary *room = [[DataCollections shared] getChatRoomById:roomID]; Firebase *ref = [[Firebase alloc] initWithUrl:[NSString stringWithFormat:@"%@/chatdata/messages/%@", self.baseURL, roomID]]; [ref observeSingleEventOfType:FEventTypeValue withBlock:^(FDataSnapshot *allMsgs) { dispatch_async(dispatch_get_main_queue(), ^{ [room.messages removeAllObjects];
ios objective-c firebase
Mark camilleri
source share