Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[DO NOT MERGE] - codepush poc #9136

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ARTSY_PROD_API_CLIENT_KEY=-
ARTSY_PROD_API_CLIENT_SECRET=-
BRAZE_PRODUCTION_APP_KEY_IOS=-
BRAZE_STAGING_APP_KEY_IOS=-
CODE_PUSH_CANARY_DEPLOYMENT_KEY=-
CODE_PUSH_STAGING_DEPLOYMENT_KEY=-
CODE_PUSH_PRODUCTION_DEPLOYMENT_KEY=-
GOOGLE_MAPS_API_KEY=-
GRAVITY_API_KEY=-
GRAVITY_STAGING_WEBSOCKET_URL=-
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ eigen-firebase-app-distribution.json
google-services.json
GoogleService-Info.plist

# App center files
AppCenter-Config.plist

metaflags.json

# Relay
Expand Down
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ project.ext.envConfigFiles = [
debug: ".env.shared",
release: ".env.shared",
]

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os
Expand Down
6 changes: 6 additions & 0 deletions android/app/src/main/java/net/artsy/app/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.google.firebase.messaging.FirebaseMessaging;
import com.microsoft.codepush.react.CodePush;

public class MainApplication extends Application implements ReactApplication {
private static final String TAG = MainApplication.class.getName();
Expand All @@ -45,6 +46,11 @@ protected List<ReactPackage> getPackages() {
protected String getJSMainModuleName() {
return "index";
}

@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}
};

private final ReactNativeHost mNewArchitectureNativeHost =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import net.artsy.app.utils.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
import java.util.ArrayList;
import java.util.List;
import com.microsoft.codepush.react.CodePush;

/**
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
Expand Down Expand Up @@ -59,6 +60,11 @@ protected String getJSMainModuleName() {
return "index";
}

@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}

@NonNull
@Override
protected ReactPackageTurboModuleManagerDelegate.Builder
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
<string name="facebook_app_id">308278682573501</string>
<string name="facebook_client_token">5407e54f59d45eab502144b2e6943c6e</string>
<string name="fb_login_protocol_scheme">fb308278682573501</string>
<string moduleConfig="true" name="CodePushDeploymentKey">7K1pucybOoS3QVFxWhw-vnptkPjt6yfBmwPCr</string>
</resources>
3 changes: 2 additions & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
rootProject.name = 'Artsy'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
Expand Down
18 changes: 10 additions & 8 deletions ios/Artsy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4451,7 +4451,7 @@
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
MARKETING_VERSION = 6.7.7;
MARKETING_VERSION = 8.18.0;
OTHER_CFLAGS = (
"$(inherited)",
"-iframework",
Expand Down Expand Up @@ -4528,7 +4528,7 @@
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
MARKETING_VERSION = 6.7.7;
MARKETING_VERSION = 8.18.0;
OTHER_CFLAGS = (
"$(inherited)",
"-iframework",
Expand Down Expand Up @@ -4714,12 +4714,13 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ArtsyStickers/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Artsy Stickers";
INFOPLIST_KEY_UIRequiredDeviceCapabilities = arm64;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
MARKETING_VERSION = 6.7.7;
MARKETING_VERSION = 8.18.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "net.artsy.artsy.Artsy-Stickers";
Expand Down Expand Up @@ -4751,12 +4752,13 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ArtsyStickers/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Artsy Stickers";
INFOPLIST_KEY_UIRequiredDeviceCapabilities = arm64;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LIBRARY_SEARCH_PATHS = (
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
MARKETING_VERSION = 6.7.7;
MARKETING_VERSION = 8.18.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "net.artsy.artsy.Artsy-Stickers";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -4797,7 +4799,7 @@
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 8.18.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -4842,7 +4844,7 @@
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 8.18.0;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore net.artsy.artsy.BrazePushServiceExtension";
Expand Down Expand Up @@ -4886,7 +4888,7 @@
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 8.18.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -4932,7 +4934,7 @@
"$(SDKROOT)/usr/lib/swift",
"$(inherited)",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 8.18.0;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore net.artsy.artsy.ArtsyWidget";
Expand Down
34 changes: 19 additions & 15 deletions ios/Artsy/App/ARAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#import "AppboyReactUtils.h"
#import <Analytics/SEGAnalytics.h>
#import <Segment-Appboy/SEGAppboyIntegrationFactory.h>
#import <CodePush/CodePush.h>
#import <AppCenterReactNative.h>

#import "ARAnalyticsConstants.h"
#import "ARAppDelegate.h"
Expand Down Expand Up @@ -146,23 +148,25 @@ - (void)setupForAppLaunch:(NSDictionary *)launchOptions

AREmission *emission = [self setupSharedEmission];

[AppCenterReactNative register];

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
[emission setBridge:bridge];
#if RCT_NEW_ARCH_ENABLED
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#if RCT_NEW_ARCH_ENABLED
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif
NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"eigen", initProps);
NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"eigen", initProps);

if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
} else {
rootView.backgroundColor = [UIColor whiteColor];
}
if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
} else {
rootView.backgroundColor = [UIColor whiteColor];
}

self.window = [[ARWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *rootViewController = [UIViewController new];
Expand All @@ -179,7 +183,7 @@ - (void)setupForAppLaunch:(NSDictionary *)launchOptions

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTAppSetupPrepareApp(application);
RCTAppSetupPrepareApp(application);

[self setupForAppLaunch:launchOptions];

Expand Down Expand Up @@ -343,7 +347,7 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
return [CodePush bundleURL];
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion ios/Artsy/App_Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>7.3.6</string>
<string>8.18.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
8 changes: 0 additions & 8 deletions ios/ArtsyStickers/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>7.3.6</string>
<key>CFBundleVersion</key>
<string>2022.05.11.13</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
4 changes: 0 additions & 4 deletions ios/ArtsyWidget/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>7.3.6</string>
<key>CFBundleVersion</key>
<string>2022.05.11.13</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
4 changes: 0 additions & 4 deletions ios/BrazePushServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>7.3.6</string>
<key>CFBundleVersion</key>
<string>2022.05.11.13</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
Loading