Animal Party! is a chat app that connects members of opposite U.S. political parties.
- Choose your political leaning: Democrat or Republican
- Get paired with someone from the opposite party
- Message each other in an anonymous, one-on-one chat room
- Leave conversations or join other ones whenever you want
Animal Party! was developed for Android & iOS in 2018 by Anshuman Dewangan and Vinit Parikh. The code is free for everyone to view, reuse, and evolve. If you do use the code in your own projects, attribution to Anshuman & Vinit would be appreciated.
Repository for Animal Party's Android & iOS front-end using React Native. Also see animalparty-api.
- Clone repository
git clone https://github.com/anshuman64/animalparty-mobile.git
cd animalparty-mobile
- Install modules
npm install
- Fix mime-types module
open ./node_modules/mime-types/index.js
Edit var extname = require('path').extname
to:
const extname = (path) => {
if (!path || path.indexOf('.') === -1) { return '' }
path = '.' + path.split('.').pop().toLowerCase()
return /.*(\..*)/g.exec(path)[1] || ''
}
- Fix react-native-video-player
open ./node_modules/react-native-video-player/index.js
Replace contents with this file: https://drive.google.com/file/d/1-99De6dgEY4WnHhBvfqVrp5ktRA5a6wg/view?usp=sharing
- Replace files with secret keys (ask anshuman64):
ios/Insiya/GoogleService-Info.plist
- Add animalparty-android.keystore (ask anshuman64) to
/android/app
directory
- Install Pods
cd ios && pod install && cd ..
- Fix search header for RCTBridgeModule.h
open ./node_modules/react-native/React/Base/RCTBridgeModule.h
Edit #import <React/RCTDefines.h>
to #import "RCTDefines.h"
- Open XCode application
File > Open > $ANIMALPARTY-MOBILE/ios
- Click on "Pods" in left panel
- Select "react-native-amplitude-analytics" from the dropdown at the top
- Click on "Header Search Paths"
- Add
"$(PODS_ROOT)/../../node_modules/react-native/React/"
- Set as "Recursive"
- Comment all logging "console.", "debugger", and "Debug Test" lines
- ENV_SETTING = ENV_TYPES.PRODUCTION in app_config.js
- LoadingScreen inital={true} in App.js
- Run the app on iOS simulator with these settings and log in with your phone number. Make sure everything works.
- Make sure you follow the steps under "Release - General"!
- Android
appcenter codepush release-react -a AnimalParty/AnimalParty-Android -d Production
- iOS
appcenter codepush release-react -a AnimalParty/AnimalParty-iOS -d Production
Note: Add option ---mandatory
if the update should cause the app to refresh on start
- Make sure you follow the steps under "Release - General"!
- Increment versionCode and versionName in android > app > build.gradle
- Generate signed release APK
cd android && ./gradlew assembleRelease && cd ..
- Search for "app-release.apk" in
animalparty-mobile/android/app/build/outputs/apk/release/app-release.apk
and drag into Google Play Console
Note: If you want to test the signed release APK, run react-native run-android --variant=release
- Make sure you follow the steps under "Release - General"!
- Increment Version and Build in XCode
- Set build target to "Generic iOS Device"
- Run
Product > Archive
- Assuming you were on "master" branch:
git checkout stable
git merge master
git tag vX.Y.Z
git push
git push origin vX.Y.Z
git checkout master
- Android
open ./android/app/src/res/values/strings.xml
Change "reactNativeCodePush_androidDeploymentKey" from Staging 0wdFZMRaBt_InRdAh5wxwr0fjqHhHkRQlzrRf
to Production ####################
- iOS
open ./ios/AnimalParty/Info.plist
Change "CodePushDeploymentKey" from Staging W5sHjCByju5UuUQ3Y1jY8EIhByDVrJOBlfH0z
to Production ####################