How to call POST webservice in Native iOS code using Plugin - Phonegap - ios

I am trying to create a Hybrid iOS project using Phonegap. I have got the www folder contents (html, js, css and all required data). I just wanted to build iOS container and put the www contents into it. It is done.
Now I want to call a POST web service method (should pass image and text contents), written in iOS native code from one of the html page. I have followed few links to implement the plugin, but nothing seems to be working and I couldn't figure it out what am I missing.
Given below the links which I have followed:
http://www.jkrause.io/blog/2013/07/25/example-of-a-native-ios-plugin-for-using-phonegap-3/
https://cordova.apache.org/docs/en/latest/guide/platforms/ios/plugin.html
and some videos as well.

Related

Speech To Text in Safari for iphone using Angular

I am trying to build a Progressive Web Application (PWA) using angular framework and I am trying include functionality for speech to text. I scouted over the internet and I am not able to find anything that would help me to implement speech to text functionality in Safari, for Iphone.
Try integrate annyang (speech recognition library) within your Angular project
Save the library js file within the application. You can save it to an asset folder.Also, you have to add the js file path within angular.json file.Now, you can directly access library options/callbacks within a component class.

Zendesk app integration

I created a web application by using HTML, JS, JQuery, and some Jquery plugins. Now I want to integrate it into Zendesk. Can I use it like just copy all my files and paste it into zendesk zip file ? Or Do I have to re-code entire thing to make it work for ZenDesk ?
I checked the examples in online, they didn't mentioned anywhere about reusing the apps that already developed in Zendesk.
I am currently doing some fairly extensive Zendesk integration. If you are referring to customisation on the Agent Portal side then it will have to be a Zendesk App under strict Zendesk adopted frameworks jquery is included (http://developer.zendesk.com/documentation/apps/). If in the customer facing Help Center you can simply go into there on screen editor and paste your html, js, etc into the relevant sections see (https://support.zendesk.com/entries/22618341)
Good luck,
Tris
If you want to integrate your app to Zendesk as an Agent App, you might consider the chance of using within an iframe.
Note that the url to which the iframe is pointing to must be served as HTTPS. Otherwise, it won't work.
EDIT:
As of version 2.0 of ZAF (Zendesk Application Framework), it's easy to integrate any webpage. In v2.0, you aren't restricted to any technology or environment.

Can we load index.html page in native webview intead of cardova webview

I am building hybrid for ios using cardova. intially what cardova is doing , it is loading index.html in webview. I just want the same index.html to load in my native webview instead of cardova webview where i can use all the cardova features.
How can i go for this , what the steps for it.
Why i need this because we have some pages completly in native and 80% in hybrid. So within html i can't call my native page right but within webview i can call native also and html also. How should i do this.
You can embed a CordovaWebView into your native application. In this way you can build a native application that then also uses your Cordova hybrid pages. Check out the docs here: http://cordova.apache.org/docs/en/3.2.0/guide_platforms_ios_webview.md.html#iOS%20WebViews
You will still need to use a CordovaWebView and not the native browser or WebView though because of all of the hooks and overrides that have been made to the WebView. (You may be able to take a look at the CordovaWebView files and duplicate that but it seems like more work that you'd want to do.)

Combine JQM, MVC and PhoneGap together

I have a site which uses microsoft mvc 3 on the server side, jQuery Mobile on the client side and I want to combine it with PhoneGap and produce executes for Android and iOS.
Is it possible?
How?
Thanks
Yes, it is possible.
If you must use Phonegap, there are a couple of things to do:
First, you must create a project corresponding to each platform , following these instructions. Once you do that, you basically copy all the client side code (js, html, css) to the www folder of your project. This is one of the reasons, the app could load faster, since it's reading its resources from the local filesystem, and not receiving them from an http connection each time.
Second, you must find a way to provide your server side data to your app. If you are already using REST services or RPC methods to populate your website, then that's done, but if not, you must start by building them, and then calling them from your client (through ajax calls from jQUery most likely), and then rendering them through javascript (you can use the multiple templating libraries out there or just plain javascript, I recommend the latter only if the UI updates are minimal).
As you can see, the second part requires quite a little bit more work. Especially if you haven't built web services before.
The other option ,which does not require phonega/cordova is to use an embedded webview. Then you wouldn't have to do anything. It would work similarly to a browser (Loading the remote URL of your site), with the added advantage of being inside and android/ios app, and you could add other views or communicate with the embedded webview using native code. If you are planning to load html files from the filesystem and not from your server, you would have to do the same thing you have to do with phonegap.
It happened to me, if you have a web app depending on server code I would go with a WebView based app, and not a Cordova app.
It's really simple to create those webviews apps for Android or IPhone.
Here you have an example for building a webview based app on android
Here you have an example for building a webview based app on IOS
Hope it helps.
If you want to reuse your site you'll need a webview that browses it.
Phonegap wouldn't be needed if you use this approach, but the application will not be as responsive as a native app, and the IPhone moderators may reject your app for that reason (it happened to me).
Another approach would be that you recreate your site as a pure Javascript application and only communicate with your servers to execute some REST Services. In this case Apache Cordova makes sense.

Convert jquery mobile mvc4 web application to phonegap

I've created one Jquery mobile mvc4 web application using webapi support, which is well looking site in almost all mobile device as well. but now i want to convert this MVC application to phonegap to use mobile feature supports like camera,accelerometer,sound etc..
What is the best way to start converting it to phonegap, will i need to create SOAP based web-Service for webapi code. I've searched on web regarding that but not getting enough help,support.
am i going right way ? or need something else ?
any help is appreciable.
Okay so in order to convert it first you are going to have to know Objective-C because that is the only language that is allowed on the iPhone but assuming you know that here are the steps you can take in making a conversion like that.
*Make sure that any outside information the application retrieves is either a) In a REST api you can use the new WebApi in fact I am using it right now and it works like a charm. Or b) Any script src= tags are converted to local files on disk. So if you had script src="My awesome css" make that file a local file on the phone.
*Next take any views and decide where all of their API calling code is. Make not of that and then get ready to be moving that code.
*Once that is all recorded startup a phonegap project and get rid of any extra .index files or anything you don't need.
*Create your applications PhoneGap plugin. Have the OBjective-C plugin make any API calls that you will be needing and then make the javascript plugin match the objective-C function.
*Where you had any calls in your previous views, make those now call the cordova (PhoneGap) plugin.
This is a very brief roadmap to get started.
Once the tediousness is over it is worth it though. I moved my IOS application to Android and they transfer pretty easy.
Cheers

Resources