QuickBlox / q-municate-android

Qmunicate Android chat application
MIT License
252 stars 198 forks source link

Background Incoming call and message notification is not receiving in Android Q-Municate #244

Closed roma50 closed 1 year ago

roma50 commented 6 years ago

I modified Q-municate powered by QuickBlox (which is open source) GitHub code. But, in this app Voip is not working. when i open the application then only can call receive and message notification. So how to show incoming call screen when app will be close and phone screen will lock. Please tell me the solution of this issue. Thanks

RomanPronin commented 6 years ago

@roma50 Have a look at video-sample. There is implementation of opening IncomingCallFragment by receiving push in this sample.

roma50 commented 6 years ago

I am modifying qmunicate app provided by quickblox and according to quickblox documentation they have added firebase notification service for notifications and they have asked to add Google API key in quickblox admin panel and Google project key in project and I have done both things and after that I have checked new users are getting subscribed to firebase notifications but still I am not receiving notifications.

RomanPronin commented 6 years ago

Did you add your google-services.json to app module?

roma50 commented 6 years ago

Yes. I added but still not getting notification.

roma50 commented 6 years ago

What's the issue why the notification are not getting. How to solve this isue. Please me for solving this issue

RomanPronin commented 6 years ago

If you have successful subscription, but do not receive pushes, you always can check the next:

  1. Check certificates for pushes: Admin panel ->Push Notification ->Settings -> APNS, GCM etc.
  2. Send push from Admin Panel - > Push notifications - > Send (link )
  3. Also you can check Push Notifications Queue tab in Admin panel, there should be a log of your push. It will help you to understand what's going on with your devices.
roma50 commented 6 years ago

Mr. RomanPronin, I am not getting any notifications in Queue. Is it right it will not work in free account. ? Is it right it will work only in Premium Account of QuickBlox.? Please help me to sort out this issue. Kindly confirm me is there issue of free and premium account? or is there any other issue? Please help me in this issue i done all step what you told above but still not getting any notifications in Queue. I am using free account at this moment.

RomanPronin commented 6 years ago

Notifications work in all accounts. So, check the next: Send Push notifications from admin panel. If you do not see any error alerts, after that in Push Notifications Queue tab in Admin panel will appear new message with status. If there are no messages in Queue, most likely you don't have any subscribed user for pushes. To check subscription : Admin panel -> Push Notifications - > Subscriptions. You can check subscription for user: Admin panel -> Users - > "your" user ->In the right side below "Tags" is placed list of the subscriptions.

roma50 commented 6 years ago

RomanPronin, it's already Subscribed.

RomanPronin commented 6 years ago

@roma50 did you try to send push notifications from admin panel?

roma50 commented 6 years ago

Yes. Sent but not received anything in app checked log also.

RomanPronin commented 6 years ago

Ok, give us your Application ID, we will check it on backend side.

roma50 commented 6 years ago

Application ID is 12

RomanPronin commented 6 years ago

So, your Quickblox APP_ID is 12? Are you sure? With this APP_ID you do QBSettings.getInstance().init(getApplicationContext(), APP_ID, AUTH_KEY, AUTH_SECRET) ?

roma50 commented 6 years ago

Yes

ideav5 commented 6 years ago

Application ID is 62670

Sent but not received,auth_key has config

{"notification":{"id":9874380,"badge":null,"device_token":null,"sound":"default","alert":null,"data":{"message":"test111","collapse_key":"event21365996"},"expiry":86400,"delivered":false,"delivered_at":null,"failed":true,"failed_at":"2017-11-02T01:41:51+00:00","fail_after":"2017-11-02T02:41:51+00:00","retries":0,"error_code":401,"error_description":"Unable to deliver notification 9874380, received error 401 (Unauthorized, check your App auth_key.)","deliver_after":null,"alert_is_json":null,"app_id":12925,"collapse_key":null,"delay_while_idle":false,"registration_ids":["dYSotp1rXfM:APA91bEijjQg024ezGewA2SaoMQ0Z6pEx9SDi_8nHsxb_CsOCsh9USh-uZZXNdx_2j_rjHhyoYshh4PKr_TmE0uZ-cXeC7VqDS-s2zvKevWvpe1kD4WJgwkHeQyp5amIuKZb8n_NdBot"],"uri":null,"priority":10,"url_args":null,"category":null,"content_available":false,"mutable_content":false,"notification":null,"type":"Rpush::Client::Redis::Gcm::Notification","event_id":21365996,"event_date":"2017-11-02T01:41:50+00:00"},"log":[{"device_token":null,"delivered_at":null,"failed_at":"2017-11-02T01:41:51+00:00","error_code":401,"error_description":"Unable to deliver notification 9874380, received error 401 (Unauthorized, check your App auth_key.)"}]}

ntkhoi commented 6 years ago

My android chat app doesn't receive incoming message in the background (can receive in foreground). I am using corn. quickblox: quickblox-android-SDK-messages: 3.3.3.

RomanPronin commented 6 years ago

@ntkhoi, In background app state chat service can be destroyed, so user may be in logout state. Thus you won't receive any realtime message. But you will receive offline message. So, the better way to handle correctly chat offline messages () is to do 'Chat logout' when app goes to background and does 'Chat login' when app goes to foreground.

kushal211 commented 6 years ago

Hello,

I'm facing this same issue in only one case : Call from Android app to iOS app when the iOS app in the background.

At this stage, I'm not receiving any kind of push notification in iOS app and even it is not showing in the Queue in the dashboard as well. I've tried sending manually from the dashboard and it is working and receiving the push to iOS.

kushal211 commented 6 years ago

Just to help you guys for call push notification for iOS to Android, you need to change these in your iOS application.

  1. Go to QMCallManager.m
  2. Find method - (void)callToUserWithID:(NSUInteger)userID conferenceType:(QBRTCConferenceType)conferenceType
  3. Change the below code in the method.
[QMNotification sendPushNotificationToUser:opponentUser
                                          withText:pushText
                                       extraParams:@{
                                                     QMVoipCallEventKey : @"1",
                                                     @"type" : @"push_type_call",  // These is required for Android app
                                                     }
                                            isVoip:YES];

by changing these I'm able to solve the issue of call push for iOS to Android. Still having issue with Android to iOS.

RomanPronin commented 6 years ago

Hi @kushal211, check out latest Q-mun version 2.7, the background calls work cross-platform.

LokeshPreetisukhwal commented 4 years ago

Hi I am getting notification when video calling from other app and notification is showing,but app is not opening when app closed or device locked, Please help me

silicus-kirankhalkar commented 4 years ago

@Sukhwal I am facing problem when the iOS app has in background mode and if the Android user initiate the call. This condition iOS app not getting notification from another platform. iOS to iOS working fine.

ideav5 commented 1 year ago

您发给我的信件已经收到。 谢谢!