Skip to content

techbyorg/tech-by-native

Repository files navigation

TechBy Native

Native apps for TechBy products

Installation

Dependencies

  • npm install -g cordova
  • npm install -g gulp

Code

git clone [email protected]:austinhallock/techby-native.git
cd techby-native
npm install

iOS

iOS Dependencies

  • Install xcode if you don't have it
  • npm install -g ios-sim ios-deploy
  • install cocoapods
  • pod setup

Building app

npm run local-ios
cd cordova
cordova plugin add [email protected]
cd ..
npm run local-ios
  • open xcode
  • find and open techby-native/platforms/ios/TechBy.xworkspace
  • xcode->preferences -> accounts tab. add/plus icon (bottom left). on your techby account, verify that under teams is "TechBy, Inc". close. (if it's not there, you need to be added as dev)
  • Click on "TechBy" in folder view on left, then "Signing" tab. select team -> "TechBy" (for both dev and release sections?)
  • Build settings -> search "signing", "basic" blue tab to "all", change to "release" to "iOS developer"

Releasing

  • Bump version in package.json
  • npm run release-ios
  • Xcode:
    • Product -> Archive
      • Validate app
        • Check upload symbols to Apple (or don't, doesn't matter a ton)
        • Automatically manage signing
        • Next until Validate
      • Distribute app
        • iOS app store
        • Upload
        • Check upload symbols to Apple (or don't, doesn't matter a ton)
        • Automatically manage signing
        • Upload

Problem solving

If npm run local-ios errors about 'xcodebuild' requires xcode, run:

xcode-select --install
sudo xcode-select --switch /Library/Developer/CommandLineTools

Module 'FirebaseInstanceID' not found

cd platforms/ios
pod install

Android

Android dependencies

Building app

npm run local-android

It'll fail (that's fine)

cd cordova
gulp cordova:closeicon
gulp cordova:notificationicon

Comment out /cordova in .gitignore

ctrl+f (regex on): play-services-(.*?):\+ replace with: play-services-$1:11.6.2

Re-comment /cordova in .gitignore

If using forked cordova-plugin-android-window-background, remove following from MainActivity in cordova/platforms/android/app/src/main/AndroidManifest.xml

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
cd ..
npm run local-android

If emulator fails, https://stackoverflow.com/a/51693703

Releasing

  • bump version in package.json
  • npm run release-android
  • Upload app bundle to Google Play (cordova/platforms/android/app/build/outputs/bundle/release/app.aab)

Generating assets

iOS icons, Android splash

splashicon-generator --imagespath="resources"

Copy relevant assets to resources/android|ios/build/... then delete the res folder that command creates

Android adaptive icons

https://easyappicon.com/

iOS storyboards

Rachel made

Commands

  • npm run local-android - Build and run debug APK on local device (plug in via USB)

  • npm run build-android - Build unaligned debug APK

  • npm run release-android - Build unaligned release APK

  • npm run local-ios

  • npm run release-ios

Be sure to bump the version number in package.json before running deploy

Available portal calls

app.exit app.exitWithoutAnimation app.isLoaded app.triggerRepaint app.getDeviceId app.onPause app.onResume app.onBack app.rate

share.any share.multi

keyboard.show keyboard.close keyboard.onShow keyboard.onHide keyboard.disableScroll keyboard.hideAccessoryBar keyboard.showAccessoryBar

intents.start

orientation.lock orientation.unlock orientation.get orientation.onChange

networkInformation.onOnline networkInformation.onOffline networkInformation.getType

push.register push.subscribeToTopic push.getBadgeNumber push.setBadgeNumber push.getHasPermission push.setContextId push.onData push.registerAction

top.getData top.onData top.clearEventListeners

browser.openWindow browser.closeWindow browser.show browser.reply

deepLink.getPath deepLink.onRoute

geolocation.getCurrentPosition

permissions.check permissions.request

statusBar.setOverlaysWebview statusBar.setBackgroundColor statusBar.hide statusBar.show statusBar.getIsVisible

MISC notes

when releasing, using autosigning may break fcm?

Add provisioning profile for the app you added https://developer.apple.com/account/ios/profile/

mach-o-link (googletoolbox) add libpodtechby to frameworks (general tab)

if you need to run pod install, close xcode before doing it

if signing error, manually sign with jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/dev/padlock/upload_keystore.jks ./app.aab upload -storepass passwordinpadlock

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published