Integrate Worklight project in existing IOS project - ios

I have to integrate a Worklight project into my existing IOS project (Objective-C)
I have googled but i have not found a clear "guide" on how to perform this integration.
Could you drive me in the right way of integrating this project? The idea is to have a button in my IOS project that open a WebView that loads the pages (HTML5 and javascript with AngularJS and Jquery) contained into the Worklight project.
Thank you so much

There is no guide for this approach, as I don't think it is sustainable.
In Worklight you currently have two approaches:
A native application to which you add the Worklight Native iOS SDK, allowing you to implement security features, invoke adapters and use various other features
A Hybrid application to which you can add native functionality (via Cordova or otherwise), and use the entire set of features provided by Worklight
It is important to note that a Hybrid application is a native application. It is a fully actual real native app. It is a native shell that calls a webview (provided by Cordova) into which the Worklight JS framework and the application web resources are loaded, and thus you see your web app. A Hybrid application allows you to mix & match web and native in one.
So what I am saying is that you can't take an existing iOS app and transplant it into another existing iOS app.
It sounds to me like what you are essentially trying to do, is what a Hybrid app is. A native app that displays web content...
So:
This is not an approach Worklight officially supports. By doing this, you are on your own
You could maybe take the guts of a Hybrid app's iOS environment (myapp\iphone\native) - its classes and resources and add them into your existing app and load the main class which theoretically, or at least the wanted effect, will load the Cordova webview. But I give this low chances of success...

Related

How to open a xcode framework file in telerik hybrid coredova application using telerik appbuilder

I want to open or call my iOS SDK framework file in the telerick hybrid coredova application. Share if you have any ideas.
It is not possible to open a framework directly in any of the AppBuilder clients. However, you can use a custom (or third-party) iOS framework in your app by creating a Cordova plugin. To do so, you would require knowledge in native iOS development. This article contains additional information on the subject.

Is it possible to convert angularjs web application to IOS app with Ibeacon search functionality?

I have developed a web application using angularjs, now i want to convert ios application with iBeacons device searching functionality.
Is it possible to do this, any one please give me advice on this?
Yes this is possible, you can repurpose your Angular single page app into a Cordova/PhoneGap container, then use appropriate plugins (which bridge platform specific native code to Javascript) to add iBeacon or other beacon support. If you don't find plugins that do what you want, you can create your own if you are comfortable working in the native languages of the platforms you want to use (Java for Android, Objective C or Swift for iOS).
Example plugins that already exist to help with this would be:
cordova-plugin-ibeacon
ngCordova Cordova Beacon
There's an example of how to go about this using Angular JS / Ionic framework here.
There is no way to directly scan for beacons in JavaScript. This is true whether you are talking about a web app running in Mobile Safari on iOS or inside a UIWebView container within a native iOS Web app.
If you want to combine JavaScript-based apps with beacons, the alternative is to build Hybrid apps using technologies like Cordova or Ionic (which is built off of Cordova). You can then use Cordova plugins that let you interact with native code that does the beacon scanning, and pass it back to your JavaScript application. One such plugin that accomplishes this is here:
https://github.com/petermetz/cordova-plugin-ibeacon
There are limitations with this approach. Beacon scanning typically has to be in the foreground, and you can't really wake up the app on beacon detection.
Full disclosure: I am the lead developer on the Android Beacon Library open source project upon which the above plugin is based.

iOS App: webView or PhoneGap?

We are developing a HTML5 mobile app with Sencha Touch.
Now we want to package the App, and found that we have two methods:
The first one is to use PhoneGap to generate a native app based on our html5 code.
The second one is to create a Single WebView app in Xcode, and request the url which will host our HTML5 code.
I found the second method relatively easier. So are there any advantages in using PhoneGap to generate the native app?
We usually use phonegap/cordova when we need some native function from the device, for example a barcode scanner.
Of course you can create your own barcode project, however why reinvent the wheel. Since phonegap/cordova 3.0 the effort needed for creating a app is kinda low. Just follow the guide and your all set.
http://docs.phonegap.com/en/3.4.0/guide_platforms_ios_index.md.html#iOS%20Platform%20Guide
in short:
Advantages of Phonegap/Cordova
Ready for different platforms, little effort to create android app
Native functionality already implemented (plugins)

Difference of Native packaging between Sencha touch2 and PhoneGap

What is the difference of native packaging between Sencha touch2 and PhoneGap?
Many people use PhoneGap to natively package app based on Sencha touch, but I find that Sencha touch 2 has a new feature of native packaging.
So which type of native package is better in Performance, scalability, functionality, maturity, etc. ?
How do you choose?
PhoneGap is a middle-platform which is able to access some native APIs on many platforms and its interface language is Javascript. This means that PhoneGap is able to work with many cross-platform mobile web frameworks, such as: Sencha Touch, Titanium, jQuery Mobile, etc.
Sencha Touch 2 also provides a few native APIs (currently available on iOS, Android) through its SDK.
If you are not going to use any native APIs, then they don't have any major differences on performance and functionality as the only work done is just to wrap your Javascript code into a webview native component on corresponding device.
Lastly, the 2 main differences are:
PhoneGap provides much more APIs than Sencha Touch SDK.
PhoneGap supports 7 platforms, while Sencha Touch SDK only 2.
I had the same questions, I agree it's a real mess at first glance. Here is a very good article that "clears up confusion" quite well.
To quote the gist of the article:
Sencha Touch (and jQuery Mobile) are mobile web frameworks. You can use these technologies to create web-based, mobile apps. They don’t have access to any native API’s.
You can use Sencha Touch and jQuery Mobile inside both PhoneGap and Titanium. If you decide your html/js is cool as a native app too, you can use either PhoneGap or Titanium to wrap a browser around your app and put it in the app store or marketplace. This is where, I think, the confusion comes. Putting your Sencha Touch or jQuery Mobile apps in a native wrapper doesn’t make it a native app. It makes it appear as if it is a native app. You might get some extra functionality from PhoneGap or Titanium API’s, but it’s still not necessarily a ‘native’ app. It’s a web app running locally on the device. It’s a great way to use web technologies inside a native-like area.
The difference is that Sencha Touch allows you to build native iOS-Applications even on Windows, whereas PhoneGap 'only' bundles your HTML files into an XCode project, which further needs to be compiled on OSX for distribution/packaging.

Is PhoneGap only for NativeApplications or for remote web app HTML pages too?

I am new to PhoneGap I want to know whether PhoneGap is only for Native Applications or for remote web app HTML pages too. Please any one answer me.
Thank you Lakshmi
Phonegap! enables software programmers to build applications for mobile devices using JavaScript, HTML5 and CSS3, instead of lower-level languages such as Objective-C/core-java. The resulting applications are hybrid, meaning that they are neither truly native (all layout rendering is done via the webview instead of the platform's native UI framework) nor purely web based (they are not just web apps but packed for appstore distribution, and have access to part of the device application programming interface). You can try Sencha, Ext-JS HTML5! frameworks to create remote web app HTML pages.
Phonegap! enables a web developer access to mobile devices's phonebook, Geolocation, compass, accelerometer,etc.(A browser is not exposed to these APIs')
Appcelerator Titanium! is another platform for developing mobile, tablet and desktop applications using web technologies.
PhoneGap can be used on webapps too, if loaded through PhoneGap. It won't work in mobile safari directly, you must also open the site via PhoneGap (the app on iDevices)
The power of Phonegap is that you can build apps with web technologies and then package them to install as native apps from the app stores. To the user there is no differentiation between a pure native app and a phonegap app. The average user just sees an "app" that they are used to. If you're going to build a vanilla mobile website, you won't have access to the native libraries which is what Phonegap is intended to leverage.

Resources