Using the IC framework to develop a cross-platform app memo 123

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.