Skip to content

Instantly share code, notes, and snippets.

@ninabreznik
Last active September 12, 2016 00:25
Show Gist options
  • Save ninabreznik/f084cc3133f7628ede5200efb00421f7 to your computer and use it in GitHub Desktop.
Save ninabreznik/f084cc3133f7628ede5200efb00421f7 to your computer and use it in GitHub Desktop.
PHONEGAP
/*---------------------------------------------
GETTING STARTED
----------------------------------------------*/
PHONEGAP
http://docs.phonegap.com/getting-started/
myApp/www
//myApp/www/Index.js
document.addEventListener('deviceready', function(){
var script = document.createElement('script')
script.src='bundle.js'
document.body.appendChild(script)
}, false);
//myApp/www/Index.html
<body>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
quiz
package.json
add to “scripts"
"release": "browserify index.js -o bundle.js -t [ babelify --presets [ es2015 ] ]”
$ npm install --save-dev babelify (https://github.com/babel/babelify)
$ npm install --save-dev babel-preset-es2015
$ npm run release
$ cp quiz/bundle.js myApp/www/bundle.js
$ phonegap serve
// carefull - use only Woff fonts (not woff2)
/*---------------------------------------------
APPLYING CHANGES
----------------------------------------------*/
// after you apply changes
$ npm run start //to check changes locally
$ npm run release //to create a new bundle.js for production
// replace www/bundle.js with the new bundle.js
$ phonegap serve
/*---------------------------------------------
SERVE
----------------------------------------------*/
cd into the app
$ phonegap serve
/*---------------------------------------------
CREATE AND TEST AN APP FOR iOS
----------------------------------------------*/
$ phonegap platform add ios
// open a Finder and go to quiz/platforms/ios/Hello World.xcodeproj and right click and open with XCode
// in XCode switch choose for HelloWorld a phone you want to test your app with and it will run a simulator
// click run (big play button)
/*---------------------------------------------
PUBLISH THE APP
----------------------------------------------*/
//JUST FIRST TIME
// Create Apple ID
// Enroll for Apple Developer Program https://developer.apple.com/programs/enroll/
// When you have acount and you paid the membership, read more info https://developer.apple.com/programs/how-it-works/
// Register Test device (connect phone, click window/devices)
// In the Xcode project editor, choose a generic device—Generic iOS Device, Generic tvOS Device, or Generic iOS Device + watchOS Device—or your device name from the Scheme toolbar menu.
// Click RUN
// Choose Product > Archive.
// Choose Windows/Organiser/Arhives (your archived app should be there)
// Click export => Ad hoc => Choose team (your registered Apple dev profile) => Export
Whole process here: https://developer.apple.com/library/tvos/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW1
/*---------------------------------------------
ITUNES
----------------------------------------------*/
// go to https://itunesconnect.apple.com and click Apps and then + to add a New app
// in XCODE under PLAY button find mini menu bar and click on first icon (folder) => Click on the App under Targets and then click the General tab. Bundle Identifier is found under Identity (you can rename into i.e. com.VisionBaker.JSHackerQuiz).
// in Itunes Connect fill out: iOS, title and find BUNDLE ID and SKU (you can call it i.e. JSHackerQuizV1)
// In the new form choose Category and Secondary category
// click Save
// Fill out other tabs (Features, TestFlight, Activity)
/*---------------------------------------------
FINAL STEP
----------------------------------------------*/
// if you changed Bundle ID, go delete app from Archive
// Add Icon (in General/section App Icons and Launch Images, click on source and migrate => then next to Icon source click the arrow => more here https://www.youtube.com/watch?v=OQN_AwcF0GU)
// After everything is done, click Build again, then Product/Archive and at the end Window?Organizer?Archives => click on your app and Upload to AppStore
// Build again, archive again and then go to archive and click Apply to Appstore
// https://developer.apple.com/library/tvos/documentation/IDEs/Conceptual/AppDistributionGuide/UploadingYourApptoiTunesConnect/UploadingYourApptoiTunesConnect.html#//apple_ref/doc/uid/TP40012582-CH36-SW2
/*---------------------------------------------
ERRORS?
----------------------------------------------*/
// “Your binary is not optimized for iPhone 5” (ITMS-90096) when submitting
// add app icons in root of your project and try to archive and apply again
// http://stackoverflow.com/questions/28830013/your-binary-is-not-optimized-for-iphone-5-itms-90096-when-submitting
/*---------------------------------------------
LAST LAST STEPS
----------------------------------------------*/
// You will receive emails from Apple to fill more details, add screenshots, mark the type of content, make one more Icon (1024x102xpx) etc.). Just follow their emails from now on. You are super close, just few more details, more or less administration, nothing technical.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment