Android pending intent not invoked in twilio incoming call -
i making calling app using twilio sdk have integrated stuff , in wokring condition. problem when android app remains in background long time app didn't receive incoming call request , pending intent not invoked twilio here code:
if (!twilio.isinitialized()) { /* * needed setting/abandoning audio focus during call */ twilio.initialize(context, new twilio.initlistener() { /* * sdk initialized can register using capability token. * capability token json web token (jwt) specifies how associated device * can interact twilio services. */ @override public void oninitialized() { isinitialized = true; twilio.setloglevel(log.verbose); /* * retrieve capability token own web server */ retrievecapabilitytoken(); } @override public void onerror(exception e) { isinitialized = false; logging.e(tag, e.tostring()); notifyonstoplistening(null,-1,context.getstring(r.string.error_message_not_connecting)); } }); } else { retrievecapabilitytoken(); } } private void retrievecapabilitytoken() { // in success of api response if (clientdevice == null) { clientdevice = twilio.createdevice(capabilitytoken,devicelistener); } if(clientdevice != null) { intent intent = new intent(context, receivecallactivity.class); intent.addflags(intent.flag_activity_single_top | intent.flag_activity_clear_top); pendingintent pendingintent = pendingintent.getactivity(context, 0, intent, pendingintent.flag_update_current); clientdevice.setincomingintent(pendingintent); isintentadded = true; logging.e(tag,"in addpendingintent intent added"); } }
any suggestion , appreciated.
Comments
Post a Comment