1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    6
    Vote Rating
    0
    noelrocha is on a distinguished road

      0  

    Question Sencha Touch 2.0 PR3 not working in a UIWebView (iphone)

    Sencha Touch 2.0 PR3 not working in a UIWebView (iphone)


    Hi Guys,

    my sample app (copy/paste from the getting started) works perfect on the Mobile Safari, but when I open it in a UIWebView inside my app it doesn't work. The web app is already on a server, its not built-in the app.

    Any hints of how to solve that?

    Cheers,

    Noel

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,620
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    what doesn't work?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    - Are you using PhoneGap, Sencha Native, or your own implementation?
    - Are you using Ext.Loader? (there are sometimes issues with this).
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    6
    Vote Rating
    0
    noelrocha is on a distinguished road

      0  

    Default


    I'm not using phonegap.
    It's just a simple hello world.
    Its in my own implementation using a UIWebView.


    It loads a blank screen. The web app loads perfect in the Mobile Safari but not in my UIWebView.

  5. #5
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    I'm afraid I cannot help you without the source of the actual native application.

    Chances are, you are not including the correct JS, or not doing it at the correct time. Or you have an error.

    I've done this several times with ST.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  6. #6
    Sencha User
    Join Date
    Dec 2011
    Posts
    6
    Vote Rating
    0
    noelrocha is on a distinguished road

      0  

    Default the codes

    the codes


    Hi,

    my web app code is:
    Code:
    Ext.application({                                                                                                                                                                    
        name: 'Sencha',                                                                                                                                                                  
                                                                                                                                                                                         
        launch: function() {                                                                                                                                                             
            Ext.create("Ext.TabPanel", {                                                                                                                                                 
                fullscreen: true,                                                                                                                                                        
                tabBarPosition: 'bottom',                                                                                                                                                
                                                                                                                                                                                         
                items: [                                                                                                                                                                 
                    {                                                                                                                                                                    
                        title: 'Home',                                                                                                                                                   
                        iconCls: 'home',                                                                                                                                                 
                        cls: 'home',                                                                                                                                                     
                        html: [                                                                                                                                                          
                            '<img width="65%" src="http://staging.sencha.com/img/sencha.png" />',                                                                                        
                            '<h1>Welcome to Sencha Touch</h1>',                                                                                                                          
                            "<p>You're creating the Getting Started app. This demonstrates how ",                                                                                        
                            "to use tabs, lists and forms to create a simple app</p>",                                                                                                   
                            '<h2>Sencha Touch (2.0.0pr1)</h2>'                                                                                                                           
                        ].join("")                                                                                                                                                       
                    },                                                                                                                                                                   
                    {                                                                                                                                                                    
                        xtype: 'list',                                                                                                                                                   
                        title: 'Blog',                                                                                                                                                   
                        iconCls: 'star',                                                                                                                                                 
                                                                                                                                                                                         
                        itemTpl: '{title}',                                                                                                                                              
                        store: {                                                                                                                                                         
                            fields: ['title', 'url'],                                                                                                                                    
                            data: [                                                                                                                                                      
                                {title: 'Ext Scheduler 2.0', url: 'ext-scheduler-2-0-upgrading-to-ext-js-4'},                                                                            
                                {title: 'Previewing Sencha Touch 2', url: 'sencha-touch-2-what-to-expect'},                                                                              
                                {title: 'Sencha Con 2011', url: 'senchacon-2011-now-packed-with-more-goodness'},                                                                         
                                {title: 'Documentation in Ext JS 4', url: 'new-ext-js-4-documentation-center'}                                                                           
                            ]                                                                                                                                                            
                        }                                                                                                                                                                
                    }                                                                                                                                                                    
                ]                                                                                                                                                                        
            }).setActiveItem(1);                                                                                                                                                         
        }                                                                                                                                                                                
    });
    and my native code is:
    Code:
    @implementation ContactViewController
    
    
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {
            self.title = @"Test" ;        
        }
        return self;
    }
    
    
    #pragma mark - View lifecycle
    
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        [self loadWebView] ;
    }
    
    
    - (void)loadWebView {
    	NSURL *url = [NSURL URLWithString:@"http://feedback.mobihouse.com/"];
    	_webView = [[UIWebView alloc] initWithFrame:self.view.frame] ;
    	_webView.scalesPageToFit = NO;	
    	[_webView loadRequest:[NSURLRequest requestWithURL:url]];	
    	[self.view addSubview:_webView] ;			
    }
    as you can see its a simple UIWebView. I don't know whats happening.

    Cheers,

  7. #7
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Does it work in a browser? Which Js file are you including in your index.html file?
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  8. #8
    Sencha User
    Join Date
    Dec 2011
    Posts
    6
    Vote Rating
    0
    noelrocha is on a distinguished road

      0  

    Default


    the html code is:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <title>Sobre</title>
        <link rel="stylesheet" href="touch/resources/css/sencha-touch.css" type="text/css">
        <script type="text/javascript" src="touch/sencha-touch-all.js"></script>
        <script type="text/javascript" src="app.js"></script>
    </head>
    <body></body>
    </html>it runs in the browser but doesn't run in the UIWebView.

  9. #9
    Sencha User
    Join Date
    Dec 2011
    Posts
    6
    Vote Rating
    0
    noelrocha is on a distinguished road

      0  

    Default


    it runs in the browser but doesn't run in the UIWebView. I don't know why.

  10. #10
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    I suggest you use something like weinre to track down the issue. http://phonegap.github.com/weinre/
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.