Hi ,
the below script run with IOS. Only with Android. Also the Emulate have no problems.
/*jslint browser:true, devel:true, white:true, vars:true */
/*global $:false, intel:false */
(function () {
"use strict";
/*
hook up event handlers
*/
function register_event_handlers() {
intel.xdk.notification.alert(intel.xdk.device.platform, "Platform", "Ok","close me");
/* button #btVibrieren */
$(document).on("click", "#btVibrieren", function (evt) {
intel.xdk.notification.vibrate();
});
/* button #btBeep */
$(document).on("click", "#btBeep", function (evt) {
intel.xdk.notification.beep(1);
});
/* button #btPlaySound */
$(document).on("click", "#btPlaySound", function (evt) {
intel.xdk.player.playSound("www/sounds/tiere2.wav");
});
/* button #btSendSMS */
$(document).on("click", "#btSendSMS", function (evt) {
intel.xdk.device.sendSMS("Hallo Löwin", "017632897038");
});
/* button #btSendEmail */
$(document).on("click", "#btSendEmail", function (evt) {
intel.xdk.device.sendEmail("An Folke", "detlef.folke@gmail.com", "wow it's a subject", true, "", "");
});
/* button #btBarcodeScannen */
$(document).on("click", "#btBarcodeScannen", function(evt)
{
intel.xdk.device.scanBarcode();
});
}
document.addEventListener("app.Ready", register_event_handlers, false);
})();
Thanks for support
Detlef
链接已复制
Hello Detlef,
I tried your app on iOS 8.1 with App Preview 2.3 and it works. What part of the app did not work? Did you build .ipa and is that not working? I haven't tried building .ipa but with App Preview it worked fine.
Swati.
Hello Detlef,
I looked at your app, it is started as a webapp (i.e. Standard HTML5 app) and you are trying to use the intel.xdk plugins, they work in emulator and AP, but will not work in built app. All intel.xdk APIs are treated as plugins for Cordova container. So, if you want to use them you have two options.
1) Start your app with HTML5+Cordova template and transfer your code in the new app
or
2) Upgrade your app to Cordova app - on the Projects tab, under Project info there is Upgrade Project option. Click on the Cordova icon and you will be able to convert it into Cordova+HTML5 app
In both the cases make sure you check the Intel XDK device plugin, notification plugin and player plugin (on the right side) under Plugins section on the Projects page. Also, note that notification plugin is deprecated, you are encouraged to use Cordova notification plugin (on the left side of plugin section).
Swati
