Skip to content

Commit

Permalink
Fix base64 polyfill for react native (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke authored May 17, 2022
1 parent e051232 commit a15fd5f
Show file tree
Hide file tree
Showing 19 changed files with 2,341 additions and 1,379 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"base64url": "^3.0.1",
"bufferutil": "4.0.1",
"chalk": "^2.4.2",
"esbuild": "^0.6.5",
"esbuild": "^0.14.39",
"merge": "^1.2.1",
"mkdirp": "^0.5.1",
"rimraf": "^2.6.3",
Expand Down
8 changes: 6 additions & 2 deletions packages/nakama-js-react-native-example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ function App() {

useEffect(() => {
var useSSL = false; // Enable if server is run with an SSL certificate.
var client = new Client("defaultkey", "127.0.0.1", "7350", useSSL);
// if running in an Android emulator, use 10.0.2.2 instead of localhost to communicate
// with the host machine
var client = new Client("defaultkey", "localhost", "7350", useSSL);

console.log("authenticating...");

client.authenticateCustom("test_id").then(
session => { console.log("authenticated.");
}).catch(e => {
console.log("error authenticating.");
console.log("error authenticating: " + e.message);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@
44A2495F7AE3CEBBA1568219 /* Pods-NakamaJsReactNativeExample-tvOSTests.debug.xcconfig */,
4C356BA6277C6FD0224F95A4 /* Pods-NakamaJsReactNativeExample-tvOSTests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand All @@ -210,6 +209,7 @@
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
7EAAB96AA0080517B2437E59 /* [CP] Copy Pods Resources */,
080AD256F1151583FF7FB27B /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -232,6 +232,7 @@
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
B316FBCF03AF2BB3EE121178 /* [CP] Copy Pods Resources */,
0C5097ECB6CF7242D55775ED /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -294,6 +295,7 @@
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = C4Y58K92PG;
LastSwiftMigration = 1120;
};
2D02E47A1E0B4A5D006451C7 = {
Expand All @@ -307,7 +309,7 @@
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NakamaJsReactNativeExample" */;
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NakamaJSReactNativeExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand Down Expand Up @@ -377,6 +379,50 @@
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
};
080AD256F1151583FF7FB27B /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-NakamaJsReactNativeExample-NakamaJsReactNativeExampleTests/Pods-NakamaJsReactNativeExample-NakamaJsReactNativeExampleTests-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework/glog",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NakamaJsReactNativeExample-NakamaJsReactNativeExampleTests/Pods-NakamaJsReactNativeExample-NakamaJsReactNativeExampleTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
0C5097ECB6CF7242D55775ED /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-NakamaJsReactNativeExample/Pods-NakamaJsReactNativeExample-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-Glog/glog.framework/glog",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/double-conversion.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OpenSSL.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NakamaJsReactNativeExample/Pods-NakamaJsReactNativeExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
1724A4F56A9E54E9D3E8FA0C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -656,6 +702,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = C4Y58K92PG;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = NakamaJsReactNativeExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -679,6 +726,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = C4Y58K92PG;
INFOPLIST_FILE = NakamaJsReactNativeExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -850,7 +898,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
Expand Down Expand Up @@ -903,7 +951,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
Expand Down Expand Up @@ -955,7 +1003,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NakamaJsReactNativeExample" */ = {
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NakamaJSReactNativeExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,52 @@
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
2 changes: 1 addition & 1 deletion packages/nakama-js-react-native-example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'
platform :ios, '14.0'

target 'NakamaJsReactNativeExample' do
config = use_native_modules!
Expand Down
Loading

0 comments on commit a15fd5f

Please sign in to comment.