As you may know Apple no longer accepts applications created with a technology produced by the PhoneGap build (UIWebView). It requires using an alternative technology called WKWebView not supported by PhoneGap at the moment.
Unfortunately it seems that PhoneGap is in the maintenance mode and is no longer supported by Adobe. So PhoneGap build cannot be used anymore and an alternative vendor that supports WKWebView must be used for iOS applications.
One vendor that can be used is Monaca (monaca.io). Another one is ionic (https://ionicframework.com/)
In the new version that we are working on, Aware IM will produce the .zip file that can be directly imported into Monaca and which will work with both iOS and Android phones. In the meantime if you need to build iOS applications using the current Aware IM version, you need to do it yourself.
Here is what you need to do:
- Create an account with Monaca
- Import a zip file created by Aware IM for PhoneGap into a Monaca project (read Monaca doco how to import a PhoneGap file)
Open the project using Monaca IDE
- Re-arrange the structure of the project files to conform with Monaca project requirements:
a) Create a new folder called “www” (if not created already by Monaca)
b) Create a new folder called “res” (if not created already by Monaca. This folder will contain all you images used in your app.
c) Move all of the files EXCEPT the config.xml file into the www folder
- Replace the config.xml file with the attached one
- Modify the attached file to include your icons (alternatively, add your icons using Monaca IDE) and your server (instead of YourServer.com)
- Replace index.html with the attached file. Make your custom changes to this file - replace YourServer.com and other changes if required
- Go to the Build/Build Environment Settings menu item and click on iOS 5.1.1
- Go to Configure/App Settings for iOS and make sure that WebView engine is set to WKWebView
- Perform build for iOS and Android
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" id="com.awareim.AwareIM" version="3.0.1">
<name>CRM</name>
<description>Made with Monaca (http://monaca.mobi)</description>
<author>Awaresoft</author>
<plugin name="cordova-plugin-file" source="npm"/>
<plugin name="cordova-plugin-file-transfer" source="npm"/>
<plugin name="cordova-plugin-whitelist" source="npm"/>
<plugin name="cordova-plugin-camera" source="npm"/>
<plugin name="cordova-plugin-geolocation" source="npm"/>
<plugin name="cordova-plugin-wkwebview-cookie-sync" source="npm"/>
<plugin name="cordova-plugin-wkwebview-file-xhr" source="npm"/>
<content src="index.html"/>
<allow-navigation href="http://YourServer.com:8080/AwareIM/*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<preference name="Orientation" value="default"/>
<preference name="loglevel" value="DEBUG"/>
<preference name="AndroidLaunchMode" value="singleTop"/>
<preference name="ErrorUrl" value=""/>
<preference name="Fullscreen" value="false"/>
<preference name="KeepRunning" value="true"/>
<preference name="AllowInlineMediaPlayback" value="false"/>
<preference name="BackupWebStorage" value="cloud"/>
<preference name="KeyboardDisplayRequiresUserAction" value="true"/>
<preference name="MediaPlaybackRequiresUserAction" value="false"/>
<preference name="SuppressesIncrementalRendering" value="false"/>
<preference name="TopActivityIndicator" value="gray"/>
<preference name="GapBetweenPages" value="0"/>
<preference name="PageLength" value="0"/>
<preference name="PaginationBreakingMode" value="page"/>
<preference name="PaginationMode" value="unpaginated"/>
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage"/>
</feature>
<preference name="monaca:AndroidIsPackageNameSeparate" value="false"/>
<platform name="ios">
<preference name="orientation" value="all"/>
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to get pictures from there</string>
</edit-config>
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
<edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to save pictures there</string>
</edit-config>
<edit-config target="NSContactsUsageDescription" file="*-Info.plist" mode="merge">
<string>need contacts access to search friends</string>
</edit-config>
<preference name="InterceptRemoteRequests" value="all"/>
<preference name="WKWebViewOnly" value="true"/>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine"/>
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine"/>
</feature>
<config-file platform="ios" parent="CFBundleLocalizations" target="*-Info.plist">
<array>
<string>en</string>
</array>
</config-file>
</platform>
<preference name="ios-XCBuildConfiguration-TARGETED_DEVICE_FAMILY" value="1,2"/>
<preference name="AutoHideSplashScreen" value="true"/>
<preference name="FadeSplashScreen" value="true"/>
<preference name="ShowSplashScreenSpinner" value="false"/>
<access origin="*"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="EnableViewportScale" value="false"/>
<preference name="WindowsStorePublisherName" value="My Name"/>
<preference name="WindowsStoreIdentityName" value="04869104-27ce-d285-2671-de8da516c190"/>
</widget>
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes"> <!-- this is the only required meta -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="KendoUI/styles/kendo.common.min.css" />
<link rel="stylesheet" href="KendoUI/styles/kendo.default.min.css" />
<link rel="stylesheet" href="KendoUI/styles/kendo.mobile.all.min.css" />
<script type="text/javascript" src="cordova.js"></script>
<script src="KendoUI/js/jquery.min.js"></script>
<script src="KendoUI/js/kendo.all.min.js"></script>
<script src="aware_kendo/utils.js"></script>
<script src="aware_kendo/mobileNative.js"></script>
<script>
document.addEventListener("deviceready", function () {
if (wkWebView && wkWebView.injectCookie)
{
wkWebView.injectCookie('awareim.com/AwareIM', function () {}, function () { alert ("error injecting cookie"); });
}
}, false);
</script>
</head>
<body>
<div data-role="view" data-title="Login" id="login" data-use-native-scrolling="true">
<header data-role="header" class="km-header">
<div data-role="navbar" class="km-accent km-widget km-navbar">
<div class="km-view-title">
<span data-role="view-title">Login</span>
</div>
</div>
</header>
<form action="logonOp.aw" method="post" name="submitForm" id="submitForm">
<ul data-role="listview" data-style="inset">
<li><label for="userName">User name: <input type="text" id="userName" name="userName" /></label></li>
<li><label for="password">Password: <input type="password" id="password" name="password" /></label></li>
<li id="remember_li"><label for="remember">Remember me: <input type="checkbox" id="remember" name="remember" checked="checked" data-off-label="No" data-on-label="Yes" /></li>
</ul>
<input name="domain" id="domain" type="hidden" value="CRM">
</form>
<div class="action-buttons">
<a id="login_submit" data-click="onSubmit" data-role="button" class="km-primary km-justified transitions-button">Submit</a>
</div>
</div>
<style type="text/css" media="screen">
.action-buttons { margin: 1em; }
</style>
<script>
var app = new kendo.mobile.Application(document.body, { skin: "nova" });
var localStorageDisabled = false;
try
{
localStorage.setItem ("AwareIMTest", "Test");
}
catch (e)
{
console.log (e);
localStorageDisabled = true;
}
if (localStorageDisabled)
{
$("#remember").prop ("checked", false);
$("#remember_li").css ("display", "none");
}
setTimeout (function () {
if (localStorageDisabled === false)
{
try
{
var user = localStorage.getItem ("AwareIMUser");
var pwd = localStorage.getItem ("AwareIMPassword");
if (user && pwd)
{
$("#userName").val (user);
$("#password").val (pwd);
}
}
catch (e)
{
console.log (e);
}
}
}, 300);
function onSubmit (e){
if (localStorageDisabled === false)
{
var remember = $("#remember").prop("checked");
if (! remember)
{
clearStorage ();
}
}
var a = new MobileNative_LoginAction ($("#userName").val (), $("#password").val(), $("#domain").val(), $("#remember").prop("checked"), "http://YourServer.com:8080/AwareIM/");
a.run ();
}
function clearStorage ()
{
try
{
localStorage.removeItem ("AwareIMUser");
localStorage.removeItem ("AwareIMPassword");
}
catch (e)
{
console.log (e);
}
}
</script>
</body>
</html>