Search code examples
iosquickblox

Can we send notification using QuickBlox as a new user joined/added to a private Group without using APNS?


i am integrating an iPhone App integrating it with QuickBlox my question is , can we send notifications to users that were added to a private group using QuickBlox? PS - i am not using APNS just dealing with local notifications.


Solution

  • It will be possible to get "all the dialogs from Quickblox" which are initiated with your Quickblox ids.

    now after getting all the dialogs - you need to identify which are new/unread messages and based on that you may able to generate the local notification for each new dialog.

    below is the code to get all the dialogs from Quickblox service.

    /** Retrieve chat dialogs for page

    @param page Page with skip and limit
     @param extendedRequest Set of request parameters
     @param successBlock Block with response instance, arrays of chat dialogs and chat dialogs users IDs and page instance if request succeded
     @param errorBlock Block with response instance if request failed
    
     @return An instance of QBRequest for cancel operation mainly.
     */
    + (QB_NONNULL QBRequest *)dialogsForPage:(QB_NULLABLE QBResponsePage *)page
                             extendedRequest:(QB_NULLABLE NSDictionary QB_GENERIC(NSString *, NSString *) *)extendedRequest
                                successBlock:(QB_NULLABLE void(^)(QBResponse * QB_NONNULL_S response, NSArray QB_GENERIC(QBChatDialog *) * QB_NULLABLE_S dialogObjects,NSSet QB_GENERIC(NSNumber *) * QB_NULLABLE_S dialogsUsersIDs, QBResponsePage * QB_NULLABLE_S page))successBlock
                                  errorBlock:(QB_NULLABLE QBRequestErrorBlock)errorBlock;
    

    Hope it will be helpful to you.