1, about icons and splash screen
Icon.png 192x192
Splash.png 2208x2208
Place the two images in the resources directory and execute them at the terminal:
Ionic Resources--IOCN--splash
2, release Android version
Cordova build--release android----ant
Jarsigner-verbose-sigalg sha1withrsa-digestalg sha1-keystore My-release-key.keystore./platforms/android/bin/ mainactivity-release-unsigned.apk Alias_name
Rm./fengkong.apk
/work/apps/android-sdk-macosx/build-tools/22.0.1/zipalign-v 4./platforms/android/bin/ mainactivity-release-unsigned.apk./fengkong.apk
command to generate signature file My-release-key.keystore:
Keytool-genkey-v-keystore my-release-key.keystore-alias alias_name-keyalg rsa-keysize 2048-validity 10000
Note: Zipalign is located under the specific API version.
3, Release iOS version
Use Xcode to open a project to compile, publish.
4, about cross-domain processing
Using ionic serve--lab to start debugging, you may experience cross-domain security issues.
In the server Nginx configuration file, add:
Location
/{
add_header ' access-control-allow-origin ' *;
add_header ' access-control-allow-credentials ' true ';
add_header ' access-control-allow-methods ' GET, POST, OPTIONS ';
add_header ' access-control-allow-headers ' Dnt,x-customheader,keep-alive,user-agent,x-requested-with, If-modified-since,cache-control,content-type ';
Proxy_pass http://127.0.0.1:9000;
}
Start Chrome:
open/applications/google\ chrome.app/--args--disable-web-security
The writing of 5,service
Angular.module (' starter.services ', [])
. Factory (' Consts ', function () {
//might use a resource here, returns a JSON array
return {
version:function () {
//Modify version in Config,package at the same time
return 3.23;
}
};
});
6, a $http GET request
$http. Get (URL)
. Success (function (data, status, Headers,config) {
Console.log (' data success ');
Console.log (data); Object seems fine
})
. Error (function (data, status, Headers,config) {
Console.log (' Data error ', data);
})
. then (function (Result) {
});
7, determine the pop-up window
var confirmpopup = $ionicPopup. Confirm ({
Title: ' Hints ',
Template: ' Found a new version, click OK to go to update Now '
});
Confirmpopup.then (function (res) {
if (res) {
if (ionic. Platform.isios ()) {
var iosupdateurl = "Https://fir.im/37ew";
window.open (Iosupdateurl, "_system", "" ");
}else if (ionic. Platform.isandroid ()) {
var androidupdateurl = "Https://fir.im/jca9";
window.open (Androidupdateurl, "_system", "" ");
}
} else {
Console.log (' You is not sure ');
}
});
8, Tips
$ionicPopup. Alert ({
Title: ' Hints ',
Template: ' No new version found '
});
Using the IC framework to develop a cross-platform app memo 123