Skip to content

Instantly share code, notes, and snippets.

View cohen72's full-sized avatar
🍏
I love to eat green apples

Oren Cohen cohen72

🍏
I love to eat green apples
  • Tel Aviv, Israel
View GitHub Profile
def configure_assets(platform)
unique_whitelabel_id = ENV["UNIQUE_WHITELABEL_ID"]
ios_icon_file_path = "whitelabels/#{unique_whitelabel_id}/icon.png"
android_icon_file_path = "whitelabels/#{unique_whitelabel_id}/icon_android.png"
splash_file_path = "whitelabels/#{unique_whitelabel_id}/splash.png"
unless File.exist?(ios_icon_file_path) && File.exist?(android_icon_file_path)
UI.user_error!("1024x1024 'icon.png' file required in white label directory")
end
private_lane :configure_android do
google_services_json_src = "./whitelabels/#{ENV["UNIQUE_WHITELABEL_ID"]}/google-services.json"
android_dest = "../android/app"
sh("cp #{google_services_json_src} #{android_dest}")
configure_assets("android")
android_set_version_code(
version_code: "#{@build_number}",
gradle_file: "./android/app/build.gradle", # optional
)
private_lane :configure_ios do
google_services_plist_src = "whitelabels/#{ENV["UNIQUE_WHITELABEL_ID"]}/GoogleService-Info.plist"
ios_dest = "../ios/#{ENV["XCODE_PROJECT_NAME"]}"
sh("cp #{google_services_plist_src} #{ios_dest}")
configure_assets("ios")
xcodeproj_path = "./ios/#{ENV["XCODE_PROJECT_NAME"]}.xcodeproj"
increment_build_number_in_plist(
SPLASH_SCREEN_BG_COLOR="#f8f8f8" #background color used when generating the splash screen
SKU="<Appstore Connect SKU>" #sku used when generating a new app within appstore connect
WHITE_LABEL_NAME="Cool App QA" #The name of the app as appears under the icon
BASE_URL="https://api.com" #url used for making api requests
UNIQUE_WHITELABEL_ID="<unique_whitelabel_id>" #a unique id differentiating each app
BUNDLE_IDENTIFIER="com.organization.unique.bundle.id" #unique: identifies the app within the appstore/googleplay
DEEPLINK_SCHEME="<deeplink_scheme>" #the deeplink URL prefix ex: myappscheme://
FIREBASE_DEEPLINK_URL="<firebase_deeplink_url>" #for deeplinking
ANDROID_GEO_API_KEY="<Google Maps Android API Key>" #used for google maps api calls on Android
IOS_GEO_API_KEY="<Google Maps IOS API Key>" #google maps api calls on iOS
def setup_env(unique_whitelabel_id)
ENV["UNIQUE_WHITELABEL_ID"] = unique_whitelabel_id
env_file = "./whitelabels/#{ENV["UNIQUE_WHITELABEL_ID"]}/.env"
assets = "./whitelabels/#{ENV["UNIQUE_WHITELABEL_ID"]}/assets/."
# ===== copy white label assets and env to root project
sh("cp #{env_file} ../")
sh("cp -a #{assets} ../src/assets/whitelabel")
# ===== load the env_file into the environment
@cohen72
cohen72 / gist:698f2e504fa3b30878dc
Last active August 29, 2015 14:08
Birth Chart Planets List (for Aspects, Planets, and Houses)
// Set Aspect Label if relevant
if (data[BirthChartKeys.degrees] && data[BirthChartKeys.minutes] && data[BirthChartKeys.seconds]) {
NSString *strPlanetName = [PlanetsZodiacs planetNameForPlanetId:data[BirthChartKeys.planet_id] forImage:NO];
self.lblAspect.text = [NSString stringWithFormat:@"%@ %@%@%@'%@", strPlanetName, data[BirthChartKeys.degrees], @"\u00B0", data[BirthChartKeys.minutes], data[BirthChartKeys.seconds]];
}
if ([data[BirthChartKeys.type_id] isEqualToString:TYPE_ID_ASPECTS]) {
self.imgVwPlanet.image = [UIImage imageNamed:[PlanetsZodiacs planetNameForPlanetId:data[BirthChartKeys.planet_id1] forImage:YES]];
NSString *planetName1 = [PlanetsZodiacs planetNameForPlanetId:data[BirthChartKeys.planet_id1] forImage:NO];
NSString *planetName2 = [PlanetsZodiacs planetNameForPlanetId:data[BirthChartKeys.planet_id2] forImage:NO];