Skip to content

2.14

Compare
Choose a tag to compare
released this 02 Nov 15:52
· 344 commits to master since this release

New

  • Added QBDarwinNotificationCenter class

    NOTE

    A notification that enables the broadcast of information to registered observers between extensions with the same QuickBlox application id.

    The Darwin notification center is a system mechanism on iOS and OS X to send signals across process boundaries. It's useful to exchange information between two or more running processes such as an iPhone app notifying a WatchKit/Share/Siri.... Extension that new data has arrived.

    Is based on Darwin notification center.

    How to use:

    @interface YouExtensionClass ()
    @property (nonatomic, strong) id logoutObserver;
    @end
    
    @implementation YourExtensionClass
    
    - (void)registerToLogoutNotificaiton {
        __weak __typeof(self)weakSelf = self;
        self.logoutObserver = [[QBDarwinNotificationCenter defaultCenter]
                               addObserverForName:@"logout" usingBlock:^{
                                   [weakSelf completeSharing:nil];
                                   NSLog(@"Logout received");
                               }];
    }
    
    @end
    
    ...
    
    @implementation YourApplicationClass
    
    - (void)postLogoutNotificaion {
        [[QBDarwinNotificationCenter defaultCenter] postNotificationName:@"logout"];
    }
    
    @end
  • Added FOUNDATION_EXPORT NSNotificationName const kQBLogoutNotification; - Posted immediately after logout from QuickBlox and session destruction. Used only for Darwin notification center.

  • Added New method + [QBRequest registeredUsersFromAddressBookWithUdid:isCompact:successBlock:errorBlock:] to retrieve registered users from address book.

    Parameter Description
    udid User's device identifier. If specified - all operations will be in this context. Max length 64 symbols.
    compact if YES - server will return only id and phone fields of User. Otherwise - all User's fields will be returned.
    successBlock The block to be executed when registered users are retrieved.
    errorBlock The block to be executed when the request is failed.

    How to use:

    [QBRequest registeredUsersFromAddressBookWithUdid:@"your udid"
                                            isCompact:NO
                                         successBlock:^(NSArray<QBUUser *> *users) {
         NSLog(@"Registered users: %@", users);
     } errorBlock:^(QBResponse *response) {
         NSLog(@"Error: %@", response.error.error.localizedDescription)
     }];