Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader
import com.situm.plugin.WebViewReactPackage

class MainApplication : Application(), ReactApplication {

Expand All @@ -20,6 +21,16 @@ class MainApplication : Application(), ReactApplication {
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())

// Desgraciadamente este paso non fun quen de saltalo. Quizais usando a nova arquitectura
// sexa posible, pero polo menos está funcionando sin a dependencia react-native-webview
// e co noso MapView nativo.
// O plugin react-native-webview non require este paso, así que quero pensar que nós tampouco
// o necesitaremos.
// Ademais este caso é moi especial: temos un monorepo e RN non parece comportarse igual cando
// a instalación do paquete é convencional (vía npm).
// TODO: https://github.com/react-native-community/cli/blob/main/docs/autolinking.md
add(WebViewReactPackage())
}

override fun getJSMainModuleName(): String = "index"
Expand Down
46 changes: 9 additions & 37 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1333,32 +1333,8 @@ PODS:
- React-jsiexecutor
- React-RCTFBReactNativeSpec
- ReactCommon/turbomodule/core
- react-native-safe-area-context (5.4.0):
- react-native-safe-area-context (5.4.1):
- React-Core
- react-native-webview (13.13.5):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.11.18.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-hermes
- React-ImageManager
- React-jsi
- React-NativeModulesApple
- React-RCTFabric
- React-renderercss
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- React-NativeModulesApple (0.79.1):
- glog
- hermes-engine
Expand Down Expand Up @@ -1681,7 +1657,7 @@ PODS:
- React-logger (= 0.79.1)
- React-perflogger (= 0.79.1)
- React-utils (= 0.79.1)
- ReactNativeSitumPlugin (3.14.10):
- ReactNativeSitumPlugin (3.15.11):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1705,9 +1681,9 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- SitumSDK (= 3.32.1)
- SitumSDK (= 3.34.2)
- Yoga
- RNScreens (4.10.0):
- RNScreens (4.11.1):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1756,7 +1732,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- SitumSDK (3.32.1):
- SitumSDK (3.34.2):
- Protobuf (~> 3.18)
- SSZipArchive (~> 2.4)
- SocketRocket (0.7.1)
Expand Down Expand Up @@ -1805,7 +1781,6 @@ DEPENDENCIES:
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
- React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-webview (from `../node_modules/react-native-webview`)
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
- React-oscompat (from `../node_modules/react-native/ReactCommon/oscompat`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
Expand Down Expand Up @@ -1929,8 +1904,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-webview:
:path: "../node_modules/react-native-webview"
React-NativeModulesApple:
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
React-oscompat:
Expand Down Expand Up @@ -2042,8 +2015,7 @@ SPEC CHECKSUMS:
React-logger: 34debb54489c4c02e5de4cc057a0943e97d2038a
React-Mapbuffer: 206115a22168bd42d6ef21acfe5eb5b39589ed53
React-microtasksnativemodule: 32f7f13d65525e981e9a5b28cebad7d10e0ff711
react-native-safe-area-context: 8870dc3e45c8d241336cd8ee3fa3fc76f3a040ac
react-native-webview: bfc7322cc9f570bc5b5b2251fb38a08da718d00a
react-native-safe-area-context: 583e6d44b8500e4d4738119118d1fc01d754bfc0
React-NativeModulesApple: 6d750bb9829fdf0f02c56e9a68cbb390e1f5de25
React-oscompat: 74eb4badd12e93899f37a5dbb03d8a638011a292
React-perflogger: 53be4c46645bbccec870dd82a24764aca9bae4c2
Expand Down Expand Up @@ -2075,10 +2047,10 @@ SPEC CHECKSUMS:
ReactAppDependencyProvider: f3426eaf6dabae0baec543cd7bac588b6f59210c
ReactCodegen: 3288d61658273d72fbd348a74b59710b9790615f
ReactCommon: 9f975582dc535de1de110bdb46d4553140a77541
ReactNativeSitumPlugin: c150d16f6904f949705171e55c4a0f1e6934d43d
RNScreens: 4561eef339c3ebe8176b27e01af7ac494780f678
ReactNativeSitumPlugin: 1369a65c71c435ee5aba79d2cd3b4bd48f1e0bd8
RNScreens: 3dbce61975990754e4eadd42e9155d327c3445e7
RNVectorIcons: ae8e1b95f3468a360896c6242d61885efcc64241
SitumSDK: affae579fc33fe696831872dc536677386deb49f
SitumSDK: 31a8c53c5949e7add0bbc182fff70349ec1b027f
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
Yoga: d15f5aa644c466e917569ac43b19cbf17975239a
Expand Down
58 changes: 29 additions & 29 deletions example/ios/SitumReactNativeExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

/* Begin PBXBuildFile section */
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
697903932B1BA2918B795231 /* libPods-SitumReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F4BB38311068296038245A98 /* libPods-SitumReactNativeExample.a */; };
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
C284D66C73B976542CDA1727 /* libPods-SitumReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B182261EE747E97123D7AA1D /* libPods-SitumReactNativeExample.a */; };
FCB631348B825A779C6022C1 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
/* End PBXBuildFile section */

Expand All @@ -19,20 +19,20 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SitumReactNativeExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SitumReactNativeExample/Info.plist; sourceTree = "<group>"; };
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = SitumReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
5CA178648088396EBE0DACF4 /* Pods-SitumReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SitumReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample.release.xcconfig"; sourceTree = "<group>"; };
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = SitumReactNativeExample/AppDelegate.swift; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = SitumReactNativeExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
C4603C5680D9A9C692BA3430 /* Pods-SitumReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SitumReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample.debug.xcconfig"; sourceTree = "<group>"; };
AE5087B73F4DEA058329754C /* Pods-SitumReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SitumReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample.debug.xcconfig"; sourceTree = "<group>"; };
B182261EE747E97123D7AA1D /* libPods-SitumReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SitumReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
F4BB38311068296038245A98 /* libPods-SitumReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SitumReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
FE804D3F4267D10C89AD0DEF /* Pods-SitumReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SitumReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
697903932B1BA2918B795231 /* libPods-SitumReactNativeExample.a in Frameworks */,
C284D66C73B976542CDA1727 /* libPods-SitumReactNativeExample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -55,7 +55,7 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
F4BB38311068296038245A98 /* libPods-SitumReactNativeExample.a */,
B182261EE747E97123D7AA1D /* libPods-SitumReactNativeExample.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -92,8 +92,8 @@
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
C4603C5680D9A9C692BA3430 /* Pods-SitumReactNativeExample.debug.xcconfig */,
FE804D3F4267D10C89AD0DEF /* Pods-SitumReactNativeExample.release.xcconfig */,
AE5087B73F4DEA058329754C /* Pods-SitumReactNativeExample.debug.xcconfig */,
5CA178648088396EBE0DACF4 /* Pods-SitumReactNativeExample.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand All @@ -105,13 +105,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "SitumReactNativeExample" */;
buildPhases = (
B28871CEFB7A8B79239CD635 /* [CP] Check Pods Manifest.lock */,
AA0485FC4380094F313ADD3A /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
D96F17E8160FC49E07C0FD73 /* [CP] Embed Pods Frameworks */,
7E62D2B47A46B1BD0EBFBF7C /* [CP] Copy Pods Resources */,
5F76BA1953881AE0A1CCEBA6 /* [CP] Embed Pods Frameworks */,
1663C7BAC2DFF790ACC2A096 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -183,7 +183,7 @@
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
7E62D2B47A46B1BD0EBFBF7C /* [CP] Copy Pods Resources */ = {
1663C7BAC2DFF790ACC2A096 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -200,43 +200,43 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
B28871CEFB7A8B79239CD635 /* [CP] Check Pods Manifest.lock */ = {
5F76BA1953881AE0A1CCEBA6 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SitumReactNativeExample-checkManifestLockResult.txt",
"${PODS_ROOT}/Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
D96F17E8160FC49E07C0FD73 /* [CP] Embed Pods Frameworks */ = {
AA0485FC4380094F313ADD3A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SitumReactNativeExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SitumReactNativeExample/Pods-SitumReactNativeExample-frameworks.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand All @@ -255,7 +255,7 @@
/* Begin XCBuildConfiguration section */
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C4603C5680D9A9C692BA3430 /* Pods-SitumReactNativeExample.debug.xcconfig */;
baseConfigurationReference = AE5087B73F4DEA058329754C /* Pods-SitumReactNativeExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -284,7 +284,7 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FE804D3F4267D10C89AD0DEF /* Pods-SitumReactNativeExample.release.xcconfig */;
baseConfigurationReference = 5CA178648088396EBE0DACF4 /* Pods-SitumReactNativeExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
Expand Down
3 changes: 1 addition & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"react-native-paper": "^5.13.3",
"react-native-safe-area-context": "^5.3.0",
"react-native-screens": "^4.10.0",
"react-native-vector-icons": "^10.2.0",
"react-native-webview": "^13.13.5"
"react-native-vector-icons": "^10.2.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
},
"resolutions": {
"@react-native/gradle-plugin": "0.79.1",
"eslint-plugin-prettier": "^5.4.1"
"eslint-plugin-prettier": "^5.4.1",
"hermes-parser": "^0.31.0",
"@react-native/codegen": "^0.80.2",
"@react-native/js-polyfills": "^0.80.2"
},
"description": "Situm React Native plugin monorepo.",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.situm.plugin;

import androidx.annotation.NonNull;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.situm.plugin.webview.WebViewManager;

import java.util.Collections;
import java.util.List;

public class WebViewReactPackage implements ReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Collections.emptyList();
}


@NonNull
@Override
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactApplicationContext) {
return List.of(
new WebViewManager()
);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.situm.plugin.webview;

import android.util.Log;
import android.widget.FrameLayout;

import androidx.annotation.NonNull;

import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ThemedReactContext;

import es.situm.sdk.error.Error;
import es.situm.sdk.wayfinding.MapView;
import es.situm.sdk.wayfinding.MapViewConfiguration;
import es.situm.sdk.wayfinding.MapViewController;

public class WebViewManager extends SimpleViewManager<FrameLayout> {

public static final String REACT_CLASS = "WebView";
// TODO: estou metendo un estático, esto si usamos MapViewManager xa non faría falta.
private static FrameLayout view;

@NonNull
@Override
public String getName() {
return REACT_CLASS;
}

@NonNull
@Override
public FrameLayout createViewInstance(ThemedReactContext context) {
if (view == null) {
view = new FrameLayout(context);
MapView mapView = new MapView(context, null);
view.addView(mapView);
// TODO: pasar a config dalgún xeito e facer load().
MapViewConfiguration config = new MapViewConfiguration.Builder()
.setBuildingIdentifier("7033")
.build();
mapView.load(config, new MapView.MapViewCallback() {
@Override
public void onLoad(@NonNull MapViewController mapViewController) {
Log.d("ATAG", "MapView loaded!");
}

@Override
public void onError(@NonNull Error error) {
Log.e("ATAG", "MapView error: " + error.getMessage());
}
});
}
return view;
}
}
Loading