android - Instabug, is it possible to deactivate the shake for feedback, if there is no internet access? -
i have networkstatereceiver, checks if have internet or not. if do, reinitiate instabug, if not, want deactivate. how can that? tried setting null, doesn't work.
if(haveconnectedmobile || haveconnectedwifi){ //todo need make queue, , go through queue pslocationcenter.getinstance().initinstabug(); }else{ pslocationcenter.getinstance().instabug = null; }
this init:
public void initinstabug() { string[] feedbackarray = getresources().getstringarray(r.array.feedback); string randomstr = feedbackarray[new random().nextint(feedbackarray.length)]; instabug.debug = true; instabug = instabug.initialize(this) .setannotationactivityclass(instabugannotationactivity.class) .setshowintrodialog(true, pstimelineactivity.class) .enableemailfield(true, false) .setenableoverflowmenuitem(true) .setdebugenabled(true) .setcommentrequired(true) .setpostfeedbackmessage(randomstr) .setpostbugreportmessage(randomstr) //todo post report message, random array .setcommentfieldhint("please describe went wrong") .setpresendingrunnable(new runnable() { @override public void run() { string[] files = new string[2]; files[0] = environment.getexternalstoragedirectory() + "/passenger/passenger_log.txt"; files[1] = environment.getexternalstoragedirectory() + "/passenger/passenger_log2.txt"; compress compress = new compress(files, environment.getexternalstoragedirectory() + "/passenger/log.zip"); compress.zip(new crudstatecallback() { @override public void onresponse(string string) { log.i("", "ended making archive"); } }); } }) .attachfileatlocation(environment.getexternalstoragedirectory() + "/passenger/log.zip"); }
you can use code disable instabug automatic invocation:
instabug.getinstance().setinvocationevent(ibginvocationevent.ibginvocationeventnone)
this way won't invoked automatically. affect next activity though (not current one). may force stop , restart listeners calling onpause
, onresume
on current activity. (we may address though, such changes applied on running activity).
don't forget enable shake invocation event when internet access restored.
please keep in mind instabug sdk caches reports , re-attempt send them on next app launch until they're uploaded successfully.
Comments
Post a Comment