You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/08/17 18:23:53 UTC

[GitHub] [cordova-plugin-inappbrowser] sardapv opened a new issue #763: InAppBrowser on .show() undefined and instance is vanished from the scope when passed from page to page?

sardapv opened a new issue #763:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/763


   # Bug Report
   
   ## Problem
   Ok question may sound weird.
   
   I have 2 pages in my ionic 5 app.
   page A has a login screen, call its .service.ts file as a.service.ts
   page B has the Camera Preview plugin installed
   a.service.ts has a method to pass InAppBrowser instance to page B from page A. ( so I can add hook of postMessage)
   When inappbrowser instance is passed successfully to a.service.ts from A and to B as well.
   
   Looks like below 
   
   inside a.service.ts
   
       setIABPosstMessageHook(iab) {
          this.iabInstance = iab; // set iab passed from page A here
          this.router.navigateByUrl('camera-rdc'); // navigated to page success
          this.cameraRdcController.getIABFromSender(this.iabInstance); // check below for method
       }
   
   inside B (camera controller)
   
       getIABFromSender(iabInstance) {
       iabInstance.on('message').subscribe((callbackData) => {
         iabInstance.hide(); // hidie inappbrowser works
         this.iab = iabInstance // iab set successfully to global variable this.iab
         this.cameraTriggeredInIAB(callbackData.data.cameraSide); //starts camera
       });
     }
   
   now on camera page, I have a close button which calls below method - 
   
   
         exitCameraView() {
           this.cameraPreview.stopCamera().then(() => { //stop cammera
             this.screenOrientation.unlock(); // unlock landscape orientation
             this.iab.show(); // ERROR COMES HERE AS show  on undefined!!!! how?
           });
         }
   
   in debug mode, I see that its there in 'this' but after I click close button, somehow this iab is gone from this!! I can't seem to find how does this object got vanished.
   
   because of that, my IAB is not showing up again. Help, please. I haven't faced any such issue in the angular or ionic side till today, but now I don't have any clue. Thanks.
   
   ### What is expected to happen?
   
   show should work, but iab object is gone
   
   ### What does actually happen?
   
   error as show on undefined
   
   ## Information
   check above
   
   
   ### Environment, Platform, Device
   latest ionic 5, testing on pixel 2 xl
   
   
   ### Version information
   
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [ x] I searched for existing GitHub issues
   - [ x] I updated all Cordova tooling to most recent version
   - [ x ] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org