2013-03-12 2 views
1

모바일에 1 개의 애플리케이션을 생성 중입니다.객관적인 c + sencha touch에서 javascript 함수 호출

appdelegate (아이폰)에서, 저는 첸차 터치의 제 컨트롤러에있는 자바 스크립트를 호출하고 싶습니다. 아무도 도와 줄 수 있습니까?

정말 붙어 있습니다.

도와주세요.

미리 감사드립니다.

+0

appdelegate에서 – iPatel

+0

을 입력하십시오. function.javascript function..js 코드를 컨트롤러 (sencha touch)에 입력하고 싶습니다. –

+0

NSULConnecton..for js data를 사용하십시오 :) – iPatel

답변

0

맞춤 URL 스키마를 사용해보세요.

센차 API 문서 도구는 응용 프로그램에 다음 코드를 추가하는 당신에게 말할 것이다 :

Ext.application({ 
name: 'Sencha', 
requires: ['Ext.device.Device'], 
launch: function() { 
    if (Ext.device.Device.scheme) { 
     // the application was opened via another application. Do something: 
     alert('Applicaton pened via another application: ' + Ext.device.Device.scheme.url); 
    } 

    // Listen for future changes 
    Ext.device.Device.on('schemeupdate', function(device, scheme) { 
     // the application was launched, closed, and then launched another from another application 
     // this means onReady will not be called again (because the application is already running in the 
     // background) - but this event will be fired 
     alert('Applicated reopened via another application: ' + scheme.url); 
    }, this); 
} 
}); 

당신이 당신의 포장 업체에 다음과 같이 응용 프로그램을 포장하면서 사용하고자하는 URL이 정의를 추가,이 작동하는지 확인하십시오. json 파일 ::

{ 
... 
"rawConfig": "<key>CFBundleURLTypes</key><array><dict><key>CFBundleURLSchemes</key><array><string>sencha</string></array><key>CFBundleURLName</key><string>com.sencha.example</string></dict></array>" 
... 
} 

편집 :: 현재는 Sencha Native Packager에서만 작동하며 Phonegap에서는 작동하지 않습니다.