$TRAVIS_PULL_REQUEST is a environment variable provided by Travis CI. The idea here is that each PR is to have its own JavaScript bundle.
As for generating .apk and .ipa files, I actually never got around to the iOS build, just Android. For Android, I go through the details over the course of the 6 articles.