IOS/Android

From MMS Wiki
Jump to: navigation, search

General information

Settings to build the app are stored at MMS/matchmysound/mobile/ in ini files, that are similar to Ansible host files. Versions should be set in that file. Build process uses Cordova but the cordova config.xml is compiled based on the settings ini file and should be kept generic to allow for multiple different-branded apps.

iOS basic workflow

Make sure everything is up to date and that you have the right version in the settings .ini file, then run

 grunt cordova_ios_fast --mconf <inifile name, without .ini>

NB! Use cordova_ios if the HaXe part has changed to recompile it from scratch. This usually takes ~15 min extra and is usually overkill.

Now open the project in XCode from MMS/matchmysound/cordova/platforms/ios/<project name>.xcworkspace Go to project settings (first and topmost entry in the left toolbar) and set the correct signing profile. Plug in the iphone/ipad, select it as device and click run. Do some basic smoke testing.

When ready for deployment:

  • set the signing profile as manual, then as automatic again (not sure why but this is needed)
  • choose Build -> Archive from the menu
  • choose "Upload to app store"

Android basic workflow

Make sure everything is up to date and that you have the right version in the settings .ini file, then run

 grunt cordova_android_fast --mconf <inifile name, without .ini>

Now open the project in Android Studio, wait until it loads. Say "later" to gradle update if it asks. Plug in the Android device, click run in the top toolbar. Do some basic testing.

When ready for deployment:

  • In menu, choose Build -> Generate signed APK
  • Find the MMS.keystore file and its passwords, enter them. Note the path where the binary will be generated
  • Find the file android-release.apk in that path and upload via Google Play! developer console.

Adding a new app (both)

Requires access to FB and Google developer consoles, Google Play! and iTunes connect developer tools and MMS.keystore file.

Steps:

  • Create the new settings .ini file for it (at matchmysound/mobile) and fill it out (use info from the corresponding server conf file for ansible). Choose new recaptcha value.
  • Commission icon and splash screen from the client and create appropriate skin. Put splash screen and icon into matchmysound/mobile/res as <skin name>-icon.png and <skin name>-ls.png
  • Create Google login credentials for both ios and android at https://console.cloud.google.com . Update reversed api keys (NB! reversed i.e. should have com.google.xxx in the front instead of back!)
  • Create a new Facebook app and get app login credentials from there. Put them into settings .ini
  • Create a google play app metainfo, fill in required fields. Compile android version, then upload binary
  • Create iTunes connect metainfo (use wildcard bundle id, then type in the id as suffix). Compile iOS version, archive it and then upload to app store.
  • Update the ansible server config (new FB app creds, recaptcha_bypass for new users, all_domains for CORS, deep linking things such as mobile_project_id etc), then update server with them

iOS app review

  • Make sure metadata is filled out properly
  • Check that the test account works and can be used to log in
  • Check that no "contact us" or other equivalent links are removed
  • Nothing indicating people should buy or pay for something should be seen (unless it is an in-app purchase)

Misc

Compiling Ogg Vorbis (iOS)

This is needed in case ogg libraries ever need to be rebuilt for some reason (like ios devices moving to a new binary architecture):

IDZPrecompiledOgg and IDZPrecompiledVorbis are very helpful, with README file having instructions.

If new XCode has been installed xcode-select --install needs to be done

In both packages, .bash file needs to be modified so that IOS version is one for which simulator sdk is present (9.2 for XCode 7.2.1)

To get bitcode support, add "-fembed-bitcode -DENABLE_BITCODE=YES" to IDZ_FLAGS in IDZ_BUILD/idz_configuration

Vorbis will then refuse to compile, complaining of a conflict with -fembed-bitcode. Simplest workaround is to download the tar.gz manually, unpack it, edit configure and configure.ac to remove the conflicting flag, repack it and change IDZPrecompiledVorbis to use the new file instead of curl-ing from internet.

To get them to output a lipo-ed file, add

  1. Or just create a combined library with lipo

lipo -create install-*/lib/libvorbisall.a -output libFatVorbis.a

to the .bash file instead of the framework command

Files can then be found in IDZBuildRoot/lib{ogg|vorbis}/<version>/