Giter VIP home page Giter VIP logo

Comments (12)

soulfly avatar soulfly commented on September 2, 2024

Yes, you can't just add yourself to any dialog.

Only dialog's occupants can add other users to a dialog they are in.

from quickblox-android-sdk.

satyaki1988 avatar satyaki1988 commented on September 2, 2024

First thing is I have already created a group dialog . Now, I would like to do that if any new user want to join this group, then how they will do this? What I have found that updateDialog() method will do this.

Suppose the user have the group id, then why they cannot able to join this group? If owner always do this, then how new user will join?

from quickblox-android-sdk.

soulfly avatar soulfly commented on September 2, 2024

So you can create a public group dialog, so any user in your app can join it

use dialog.setType(QBDialogType.PUBLIC_GROUP); when you create a dialog

from quickblox-android-sdk.

satyaki1988 avatar satyaki1988 commented on September 2, 2024

Thanks for your quick response, but for this is group code necessary at the time of updateDialog() method?

from quickblox-android-sdk.

soulfly avatar soulfly commented on September 2, 2024

No need to update a dialog then

from quickblox-android-sdk.

satyaki1988 avatar satyaki1988 commented on September 2, 2024

So can you please provide the code of Android 2.0 Beta version code, that if any new user join to existing public group.

from quickblox-android-sdk.

soulfly avatar soulfly commented on September 2, 2024

To create a dialog:

  QBDialog dialog = new QBDialog();
  dialog.setType(QBDialogType.PUBLIC_GROUP);

  groupChatManager.createDialog(dialog, new QBEntityCallbackImpl<QBDialog>() {
            @Override
            public void onSuccess(QBDialog dialog, Bundle args) {
                Log.i(TAG, "dialog: " + dialog);
            }

            @Override
            public void onError(List<String> errors) {
                handleErrors(errors);
            }
        });

from quickblox-android-sdk.

satyaki1988 avatar satyaki1988 commented on September 2, 2024

Sorry for late response, what you have provide I have already done, but after that I need the code which will use for join to this group by new user, i.e., a new member would like to join this specific group.

from quickblox-android-sdk.

soulfly avatar soulfly commented on September 2, 2024

Here it is

        DiscussionHistory history = new DiscussionHistory();
        history.setMaxStanzas(0);

        currentChatRoom = groupChatManager.createGroupChat(dialog.getRoomJid());

        currentChatRoom.join(history, new QBEntityCallbackImpl() {
            @Override
            public void onSuccess() {
                log("join Room success");

                // add listeners
                currentChatRoom.addMessageListener(groupChatQBMessageListener);
            }

            @Override
            public void onError(final List list) {
                log("join Room error: " + list);
            }
        });

btw you can find all these examples here https://github.com/QuickBlox/quickblox-android-sdk/blob/new_api/snippets/src/com/quickblox/snippets/modules/SnippetsChat.java

from quickblox-android-sdk.

satyaki1988 avatar satyaki1988 commented on September 2, 2024

QBRoomChatManager roomChatManager = QBChatService.getInstance().getRoomChatManager();

it's old process by QuickBlox. Now on version 2.0 there are no such package. So, it for this reason I close this issue.

from quickblox-android-sdk.

Hemant0601 avatar Hemant0601 commented on September 2, 2024

You don't have appropriate permissions to perform this operation.
I am always getting above permission while adding members to group dialog.(PUBLIC).
First time it works fine , but second time it starts giving me this error. I am adding and removing from the same account which created the dialog.
Please help, I am using following method for it.

QBRequestUpdateBuilder requestBuilder = new QBRequestUpdateBuilder();
requestBuilder.push("occupants_ids", values);

    QBGroupChatManager groupChatManager = QBChatService.getInstance().getGroupChatManager();

    groupChatManager.updateDialog(qbDialog, requestBuilder, new QBEntityCallback<QBDialog>() {
        @Override
        public void onSuccess(QBDialog qbDialog, Bundle bundle) {
            Log.v(TAG, "user added successfully");
        }

        @Override
        public void onError(QBResponseException e) {
            Log.v(TAG, "user added failed" + e.getMessage());

        }
    });

For Removing : QBRequestUpdateBuilder requestBuilder = new QBRequestUpdateBuilder();
// requestBuilder.push("occupants_ids", 378); // add another users

requestBuilder.pullAll("occupants_ids", values); // Remove yourself (user with ID 22)

QBGroupChatManager groupChatManager = QBChatService.getInstance().getGroupChatManager();
groupChatManager.updateDialog(qbDialog, requestBuilder, new QBEntityCallback<QBDialog>() {
    @Override
    public void onSuccess(QBDialog qbDialog, Bundle bundle) {
        Log.v(TAG, "Removing success");
    }

    @Override
    public void onError(QBResponseException e) {
        Log.v(TAG, "Removing Failure"+e.getMessage());

    }
});

from quickblox-android-sdk.

YogeshSeralia avatar YogeshSeralia commented on September 2, 2024

I am using the same code provided in sample of android chat code to join the group which i have created by this code :

currentChatRoom.join(history, new QBEntityCallbackImpl() {
            @Override
            public void onSuccess() {
                log("join Room success");

                // add listeners
                currentChatRoom.addMessageListener(groupChatQBMessageListener);
            }

            @Override
            public void onError(final List list) {
                log("join Room error: " + list);
            }
        });

I am not getting entered in either of onSuccess() and onError() ,control flow just goes bypassing callback methods.

from quickblox-android-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.