Quickblox android push notifications not working

时间:2015-09-01 21:45:30

标签: android google-cloud-messaging chat quickblox

I have been trying to execute the following sample template provided by Quickblox in their master sdk for android.

https://github.com/QuickBlox/quickblox-android-sdk/tree/master/sample-messages

I have created my own application id and I am successfully able to create users,chat in runtime but gcm doesn't seem to work at all.

I generated a successful api key and project number.The project above just seems to generate an empty GCM once and replaced it in the consts.java file.

I have tried a multiple things but to no avail.

The following piece of code executes correctly.

    QBMessages.createEvent(qbEvent, new QBEntityCallbackImpl<QBEvent>() {
        @Override
        public void onSuccess(QBEvent qbEvent, Bundle bundle) {
            progressBar.setVisibility(View.INVISIBLE);

            // hide keyboard
            InputMethodManager imm = (InputMethodManager) getSystemService(
                    Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(messageOutEditText.getWindowToken(), 0);
        }

        @Override
        public void onError(List<String> strings) {
            // errors
            DialogUtils.showLong(MessagesActivity.this, strings.toString());

            progressBar.setVisibility(View.INVISIBLE);

            // hide keyboard
            InputMethodManager imm = (InputMethodManager) getSystemService(
                    Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(messageOutEditText.getWindowToken(), 0);
        }
    });

but I dont recieve any notification.Upto my knowledge all settings in the admin panel are correct.

Any help would be highly appreciated.

Regards Karan

2 个答案:

答案 0 :(得分:1)

您需要在“设置”标签中的应用程序的QB管理面板中添加GCM Api密钥,以检查是否有订阅的设备;你也可以看看那里的订阅标签。 要检查是否所有设置都正确,您可以将推送通知从QB管理面板发送到明确的平台(Android,iOS) - 管理面板 - &gt;您的应用程序 - &gt;消息 - &gt;发送

要获得更多信息,您还可以查看我们的文档: http://quickblox.com/developers/Messages

答案 1 :(得分:0)

根据我的经验,我在管理面板中添加了GCM Server API密钥,我更改了项目ID,添加了对清单文件的权限,以及我在推送时遇到问题的主要原因通知是因为您需要用户在初始from registration.backends.hmac.views import RegistrationView from registration.backends.model_activation.views import RegistrationView from registration.backends.simple.views import RegistrationView 课程之前登录。

希望这会有所帮助