You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by jcesarmobile <gi...@git.apache.org> on 2015/07/16 19:14:32 UTC

[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

GitHub user jcesarmobile opened a pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54

    CB-9347 - fix to allow to stack multiple UIAlertControllers

    Now you can stack multiple UIAlertControllers
    
    I had to add a 0.5s delay in case the user tries to present a new
    UIAlertController while one is currently being presented (on presenting
    animation)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jcesarmobile/cordova-plugin-dialogs master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-dialogs/pull/54.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #54
    
----
commit 98d3e90cd3b4879bed06c655dc9641107037c678
Author: Julio César <jc...@gmail.com>
Date:   2015-07-16T17:10:06Z

    CB-9347 - fix to allow to stack multiple UIAlertControllers
    
    Now you can stack multiple UIAlertControllers
    
    I had to add a 0.5s delay in case the user tries to present a new
    UIAlertController while one is currently being presented (on presenting
    animation)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-183376049
  
    @jcesarmobile - thanks for explaining `presentAlertcontroller,` I see it now.
    Thanks in advance for the phonegap-plugin-barcodescanner PR!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by jcesarmobile <gi...@git.apache.org>.
Github user jcesarmobile commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-183218924
  
    It's supposed to be recursive. If count > 1 it just stores it on the array (line 100), then, once it's presented (line 230), removes the presented alertController from the array (line 231), and if the array contains any other alertController on the array (line 232), it calls presentAlertcontroller again (line 233).
    
    I've tested and the problem is on the barcode scanner plugin, it returns the success or error callbacks right after calling dismissViewControllerAnimated, and dismissViewControllerAnimated takes a while, so the alert tries to present the dialog on the CDVbcsViewController that is being dismissed, so you get this error:
    Warning: Attempt to present <UIAlertController: 0x14f913bd0> on <CDVbcsViewController: 0x14f90c830> whose view is not in the window hierarchy!
    
    The solution should be not to return the callbacks until the CDVbcsViewController is dismissed. Than can be done with a block like this:
    
    `- (void)barcodeScanDone:(void (^)(void))callbackBlock {
        self.capturing = NO;
        [self.captureSession stopRunning];
        [self.parentViewController dismissViewControllerAnimated:YES completion:callbackBlock];
        
        // viewcontroller holding onto a reference to us, release them so they
        // will release us
        self.viewController = nil;
    }`
    
    and every call to barcodeScanDone should pass the block as parameter
    
    example:
    
    `[self barcodeScanDone:^{
         [self.plugin returnSuccess:text format:format cancelled:FALSE flipped:FALSE callback:self.callback];
            }];`
    
    I'll try to send a pull request to the barcode scanner plugin with this fix this afternoon.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-dialogs/pull/54


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by imaffett <gi...@git.apache.org>.
Github user imaffett commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-181897670
  
    @jcesarmobile  - thanks for the prompt reply.  This is the plugin  https://github.com/phonegap/phonegap-plugin-barcodescanner.git


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-183153364
  
    @jcesarmobile - With regard to phonegap-plugin-barcodescanner+cordova-plugin-dialogs, I was chatting with @imaffett about this.  He found that reverting from cordova-plugin-dialogs@1.2.0 to cordova-plugin-dialogs@1.1.1 fixed the issue he was seeing.  I was comparing the code from the 2 versions and am wondering about [this](https://github.com/apache/cordova-plugin-dialogs/pull/54/files#diff-b1298bd2cd777b56752fccb1b2faf4abR102).  What should happen when `[alertList count] > 1`?  Maybe I am reading it wrong, but it seems like the way it is now, it will silently fail.  Is that the intended behavior? Am I misunderstanding what will happen?  Thanks in advance for help with improving my understanding!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by jcesarmobile <gi...@git.apache.org>.
Github user jcesarmobile commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-181897098
  
    getTopPresentedViewController returns the view controller on the top, not necessarily the mainViewController, the dialog has to be presented over the top view controller. If you dismiss the barcode scanner and you still get the CDVbcsViewController as the topPresentedViewController, it might be a bug on the phonegap-barcode-scanner plugin.
    Can you link the plugin you are using? I can't find anything if I search by phonegap-barcode-scanner on npm, and there are a few on github
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by jcesarmobile <gi...@git.apache.org>.
Github user jcesarmobile commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-183466583
  
    I've just send the PR.
    https://github.com/phonegap/phonegap-plugin-barcodescanner/pull/170
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by tony-- <gi...@git.apache.org>.
Github user tony-- commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-183488008
  
    Thanks!  I cherry-picked it into a fork; we'll let you know if it worked for us ASAP.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by initialxy <gi...@git.apache.org>.
Github user initialxy commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-127353615
  
    Awesome, thanks @jcesarmobile, much appreciated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-dialogs pull request: CB-9347 - fix to allow to sta...

Posted by imaffett <gi...@git.apache.org>.
Github user imaffett commented on the pull request:

    https://github.com/apache/cordova-plugin-dialogs/pull/54#issuecomment-181886490
  
    I'm running into a similar issue where showing an alert after using the phonegap-barcode-scanner plugin is failing.  the getTopPresentedViewController method is returning the CDVbcsViewController instead of mainViewController.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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