I am developing video calling app using Quickblox-SDK for android. App is working fine and perfect if the app is open But if the app is in background I am not able to receive call. I've created app using this link please help. I have tried following things:
1) Opening CallActivity when the notification arrive, notification using GCM but as its talking time to receive notification this thing is also not working.
Thanks.
Finally got solutions for this. You can start activity onReveiveNewSession overridden method of the CallActivity
@Override
public void onReceiveNewSession(final QBRTCSession session) {
Log.e("PLog", "Session " + session.getSessionID() + " are income");
Log.d(TAG, "Session " + session.getSessionID() + " are income");
String curSession = (getCurrentSession() == null) ? null : getCurrentSession().getSessionID();
if (getCurrentSession() == null) {
Log.d(TAG, "Start new session");
initCurrentSession(session);
setOptionsForSession(session, getDefaultSharedPrefs());
addIncomeCallFragment(session);
isInCommingCall = true;
initIncommingCallTask();
Intent i = new Intent(CallActivity.this, CallActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(i);
} else {
Log.d(TAG, "Stop new session. Device now is busy");
Map<String, String> infoMap = new HashMap<>();
infoMap.put(Consts.REJECT_REASON, "I'm on a call right now!");
session.rejectCall(infoMap);
}
}