hybrid-mobile-app

Integrate javascript module with native SDK

可紊 提交于 2019-12-01 14:04:49
I have a React Web Application running inside a WebView using Cordova. I need to integrate the javascript context with a third party native SDK. I have used JNI in the past that allowed communication from JAVA to C code. Is there something similar for Javascript to JAVA (Android) and to Objective-C / Swift (iOS)? My understanding is that we cannot simply develop a Cordova plugin since the "JNI-like" communication has to be in plain Javascript. That's because the integration with the native SDK is done by a third party script that we inject in our Cordova App. So now the QUESTION is: how can

How to add missing referrer header to Cordova IOS App

半腔热情 提交于 2019-12-01 13:53:14
I am using Cordova to build an iOS App. I use the Ionic engine meaning that the app is served from a webserver running on the device. My window.location.origin is "ionic://my-app.com". A third party API (that I need to use in order to fetch an address suggestion based on what the user types) rejects my HTTP requests because the referrer header is missing in the request. It's not possible to programmatically add a referrer from the JS layer and these did not work: <meta name="referrer" content="origin"> <meta name="referrer" content="always"> I suspect that the issue is that the API is using

How to add missing referrer header to Cordova IOS App

那年仲夏 提交于 2019-12-01 13:04:46
问题 I am using Cordova to build an iOS App. I use the Ionic engine meaning that the app is served from a webserver running on the device. My window.location.origin is "ionic://my-app.com". A third party API (that I need to use in order to fetch an address suggestion based on what the user types) rejects my HTTP requests because the referrer header is missing in the request. It's not possible to programmatically add a referrer from the JS layer and these did not work: <meta name="referrer" content

Integrate javascript module with native SDK

左心房为你撑大大i 提交于 2019-12-01 12:31:34
问题 I have a React Web Application running inside a WebView using Cordova. I need to integrate the javascript context with a third party native SDK. I have used JNI in the past that allowed communication from JAVA to C code. Is there something similar for Javascript to JAVA (Android) and to Objective-C / Swift (iOS)? My understanding is that we cannot simply develop a Cordova plugin since the "JNI-like" communication has to be in plain Javascript. That's because the integration with the native

Not able to identify element in WEBVIEW in iOS hyprid app automation using Appium on real device

懵懂的女人 提交于 2019-12-01 12:07:11
I was trying to automate the hybrid app build using ionic2/Angular2 and typescript. I am using C# for code writing. test are in BDD - specflow Versions: iOS:9.3.1 Xcode: 7.3 Appium: 1.4.13 I am not able to identify elements after swtiching Context to WEBVIEW. Calling IOSDriver using below code private IOSDriver<IOSElement> driver = null; public IOSDriver<IOSElement> GetDriver(string platformVersion, string deviceName, string udid ,string appPath, string serverUri) { Capabilities iosCapabilities = new Capabilities(); DesiredCapabilities capabilities = iosCapabilities.Get(platformVersion,

How can we switch the theme in Ionic App from Lighter version to darker version ?

a 夏天 提交于 2019-12-01 11:16:32
I have two CSS file generated, One for lighter Version and other for darker Version. So please let me know how can i maintain two theme for same App? Any idea how can we implement it on ionic app using theme toggled? Working plunker You can easily toggle between CSS files. index.html : set your ng-app on the HTML tag: <html ng-app="starter"> dynamically set your style: <link ng-href="{{style}}" rel="stylesheet"> app.js : define your default style in run : $rootScope.style = "css/style.css"; controllers.js : add your toggle style logic: //All available styles $scope.styles = [ { name: "Default"

Visual Studio 2015 hybrid app - getting “EPERM, operation not permitted”

冷暖自知 提交于 2019-12-01 10:39:05
I having kind of absurd situation and I will glad to hear how exactly you guys handling it: I have a Hybrid App project, Visual Studio 2015 Cordova Tools. Inside it, under "res" folder I have app resources. The whole project, including resources, is under source control (TFS). During build, resource files get copied into "..\platforms\android\res" folder. First time, while the folder empty it succeeded - the files get copied as-is (e.g. read-only, since they are under source control). After that, during next build, it trying to overwrite these read-only files and failed, as expected -

Not able to identify element in WEBVIEW in iOS hyprid app automation using Appium on real device

不羁的心 提交于 2019-12-01 10:18:28
问题 I was trying to automate the hybrid app build using ionic2/Angular2 and typescript. I am using C# for code writing. test are in BDD - specflow Versions: iOS:9.3.1 Xcode: 7.3 Appium: 1.4.13 I am not able to identify elements after swtiching Context to WEBVIEW. Calling IOSDriver using below code private IOSDriver<IOSElement> driver = null; public IOSDriver<IOSElement> GetDriver(string platformVersion, string deviceName, string udid ,string appPath, string serverUri) { Capabilities

Calling a C# function through Javascript onClick event in WebView in Xamarin.Forms

十年热恋 提交于 2019-12-01 09:08:54
I have a post type WebView which I managed to bind with the service response as string but I have some links like related posts which have their ids. On clicking those links I want the user to go to that article. I have tried many solutions but its look like the JavaScript doesn't calls on click, it calls on load because my complete WebView is treated as string and if I concatenate it, it definitely doesn't remains a script. Here is my complete WebView code and the screenshot attached is the link which is made in WebView. I managed to make it work by concatenating the whole response in string.

How can we switch the theme in Ionic App from Lighter version to darker version ?

◇◆丶佛笑我妖孽 提交于 2019-12-01 08:20:39
问题 I have two CSS file generated, One for lighter Version and other for darker Version. So please let me know how can i maintain two theme for same App? Any idea how can we implement it on ionic app using theme toggled? 回答1: Working plunker You can easily toggle between CSS files. index.html : set your ng-app on the HTML tag: <html ng-app="starter"> dynamically set your style: <link ng-href="{{style}}" rel="stylesheet"> app.js : define your default style in run : $rootScope.style = "css/style