I am working through the Photo Album tutorial. All was working well on both the simulator and on an IOS device (iPhone 6) until I reached step 7 which saves and retrieves images from the cloud. It still works fine from the simulator but on the IOS device it shows a blank screen - any suggestions most welcome.
Code follows:-
index.html:-
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<link href="kendo/styles/kendo.mobile.all.min.css" rel="stylesheet">
<link href="styles/main.css" rel="stylesheet">
<script src="https://bs-static.cdn.telerik.com/1.6.9/everlive.all.min.js"></script>
<script src="cordova.js"></script>
<script src="kendo/js/jquery.min.js"></script>
<script src="kendo/js/kendo.mobile.min.js"></script>
<script src="scripts/app.js"></script>
</head>
<body>
<div data-role="view" data-title="My awesome Photos" data-model="listview">
<header data-role="header">
<div data-role="navbar"> <span data-role="view-title"></span> <button data-role="button" data-align="right" data-bind="click:addImage">Add</button> </div>
</header>
<ul id="images"></ul>
</div>
</body>
</html>
apps.js :-
(function () {
var everlive = new Everlive("enpv14gfv06tp33h");
document.addEventListener("deviceready", function () {
window.listview = kendo.observable({
addImage: function () {
var success = function (data) {
everlive.Files.create({
Filename: Math.random().toString(36).substring(2, 15) + ".jpg",
ContentType: "image/jpeg",
base64: data
}).then(loadPhotos,
function (err) {
alert("Could not upload image" + err.message);
});
};
var error = function () {
navigator.notification.alert("Unfortunately we could not add the image");
};
var config = {
destinationType: Camera.DestinationType.DATA_URL,
targetHeight: 400,
targetWidth: 400
};
navigator.camera.getPicture(success, error, config);
}
});
function loadPhotos() {
everlive.Files.get().then(function (data) {
var files = [];
for (var i = data.result.length - 1; i >= 0; i--) {
var image = data.result[i];
files.push(image.Uri);
}
$("#images").kendoMobileListView({
dataSource: files,
template: "<img src='#: data #'>"
});
},
function (err) {
alert("Could not fetch images: " + err.message);
});
}
var app = new kendo.mobile.Application(document.body, { skin: "nova" });
loadPhotos();
$("#images").kendoMobileListView({
dataSource: ["images/01.jpg", "images/02.jpg", "images/03.jpg", "images/04.jpg", "images/05.jpg", "images/06.jpg", "images/07.jpg"],
template: "<img src='#: data #'>"
});
navigator.splashscreen.hide();
});
} ());